* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0056b3;
    --secondary-color: #17a2b8;
    --accent-color: #ffc107;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header - 3D Hero Section */
.header-3d {
    position: relative;
    height: 600px;
    width: 100%;
    overflow: hidden;
    perspective: 1200px;
}

.hero-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a1e3f 0%, #1a3a5c 25%, #2d5a7b 50%, #1a3a5c 75%, #0a1e3f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#heroCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Floating 3D Boxes */
.floating-boxes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    perspective: 1000px;
}

.box {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: float 20s infinite ease-in-out;
    transform-style: preserve-3d;
    border-radius: 8px;
}

.box-1 {
    border-color: rgba(0, 174, 239, 0.5);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    box-shadow: 0 0 20px rgba(0, 174, 239, 0.3);
}

.box-2 {
    border-color: rgba(255, 107, 107, 0.5);
    top: 20%;
    right: 15%;
    animation-delay: 2s;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.box-3 {
    border-color: rgba(50, 200, 150, 0.5);
    top: 50%;
    left: 5%;
    animation-delay: 4s;
    box-shadow: 0 0 20px rgba(50, 200, 150, 0.3);
}

.box-4 {
    border-color: rgba(255, 193, 7, 0.5);
    bottom: 15%;
    right: 20%;
    animation-delay: 1s;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.3);
}

.box-5 {
    border-color: rgba(156, 39, 176, 0.5);
    top: 35%;
    right: 5%;
    animation-delay: 3s;
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.3);
}

.box-6 {
    border-color: rgba(33, 150, 243, 0.5);
    bottom: 25%;
    left: 20%;
    animation-delay: 2.5s;
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.3);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    25% {
        transform: translateY(-30px) rotateX(20deg) rotateY(20deg) rotateZ(10deg);
    }
    50% {
        transform: translateY(-60px) rotateX(40deg) rotateY(-20deg) rotateZ(-10deg);
    }
    75% {
        transform: translateY(-30px) rotateX(20deg) rotateY(20deg) rotateZ(10deg);
    }
}

/* Hero Content */
.hero-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    text-align: center;
    color: white;
}

.content-inner {
    animation: slideInUp 1s ease-out;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    font-size: 4.5em;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #00aef0, #ff6b6b, #32c896);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(0, 174, 239, 0.5));
}

.tagline {
    font-size: 1.8em;
    margin-bottom: 40px;
    font-weight: 300;
    letter-spacing: 1px;
    opacity: 0.95;
}

.business-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 30px;
    animation: pulse 2s ease-in-out infinite;
}

.count-number {
    font-size: 3.5em;
    font-weight: 800;
    background: linear-gradient(135deg, #00aef0, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.count-label {
    font-size: 1.2em;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* Particles */
#particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.particle {
    position: absolute;
    pointer-events: none;
}

/* Search Section */
.search-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 40px;
    margin-top: -50px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 15;
}

.search-container {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: #004085;
}

/* Filter Section */
.filter-section {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-section label {
    font-weight: 600;
}

.category-select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    min-width: 250px;
    transition: border-color 0.3s ease;
}

.category-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.reset-btn {
    padding: 8px 20px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.reset-btn:hover {
    background-color: #138496;
}

/* Stats */
.stats {
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    color: #666;
    font-size: 0.95em;
}

.stats p {
    margin: 0;
}

#resultCount {
    font-weight: 700;
    color: var(--primary-color);
}

/* Business Grid */
.directory-section {
    margin-bottom: 40px;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* Business Card */
.business-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.business-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.business-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: var(--border-color);
}

.business-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.business-rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    width: fit-content;
}

.stars {
    color: var(--accent-color);
}

.business-name {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.business-category {
    display: inline-block;
    background-color: var(--light-bg);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    margin-bottom: 12px;
    font-weight: 600;
}

.business-address {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
}

.business-address::before {
    content: "📍";
}

.business-hours {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 15px;
}

.business-contact {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: auto;
}

.contact-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-icon {
    min-width: 20px;
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-word;
}

.contact-link:hover {
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--light-bg);
    text-decoration: none;
    font-size: 1.1em;
    transition: all 0.3s ease;
    color: var(--primary-color);
}

.social-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    color: #999;
    font-size: 1.1em;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--dark-text);
}

#modalBody {
    padding: 40px;
}

.modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section-title {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 8px;
}

.modal-detail {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.modal-detail-icon {
    min-width: 24px;
    font-size: 1.2em;
}

.modal-detail-content {
    flex: 1;
}

.modal-detail-label {
    font-weight: 600;
    color: var(--primary-color);
}

.modal-detail-value {
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-3d {
        height: 400px;
    }

    .logo {
        font-size: 2.5em;
        letter-spacing: 2px;
    }

    .tagline {
        font-size: 1.1em;
    }

    .business-count {
        padding: 15px 30px;
    }

    .count-number {
        font-size: 2.5em;
    }

    .count-label {
        font-size: 1em;
    }

    .box {
        width: 60px;
        height: 60px;
    }

    .search-section {
        padding: 20px;
        margin-top: -40px;
    }

    .search-container {
        flex-direction: column;
    }

    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .category-select {
        min-width: 100%;
    }

    .business-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 20% auto;
        width: 90%;
    }

    #modalBody {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header-3d {
        height: 350px;
    }

    .logo {
        font-size: 1.8em;
        letter-spacing: 1px;
    }

    .tagline {
        font-size: 0.95em;
    }

    .business-count {
        padding: 12px 20px;
    }

    .count-number {
        font-size: 2em;
    }

    .count-label {
        font-size: 0.9em;
    }

    .box {
        width: 50px;
        height: 50px;
    }
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--primary-color);
}

.spinner {
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
