/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    gap: 20px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
}

.logo h1 i {
    color: #f56565;
    margin-right: 10px;
    text-shadow: 0 0 10px rgba(245, 101, 101, 0.5);
}

.subtitle {
    font-size: 14px;
    color: #718096;
    font-weight: 400;
}

.header-nav {
    display: flex;
    align-items: center;
}

.header-nav-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(245, 101, 101, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-nav-btn:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    box-shadow: 0 4px 8px rgba(245, 101, 101, 0.4);
    transform: translateY(-1px);
}

.header-nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(245, 101, 101, 0.3);
}

.stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Controls Section */
.controls {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 25px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.controls-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 20px;
    align-items: center;
}

/* Search Box */
.search-container {
    position: relative;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    color: #a0aec0;
    z-index: 2;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0;
}

.clear-btn:hover {
    background: #f7fafc;
    color: #667eea;
}

.clear-btn.visible {
    opacity: 1;
}

/* Filter Selects */
.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Active Filters */
.active-filters {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tag {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-tag button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
}

/* Main Content */
.main {
    padding: 40px 0 60px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

/* Removed unused spinner styles */

/* Brand Grid */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* Brand Card */
.brand-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.brand-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.brand-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.brand-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.brand-info {
    flex: 1;
    min-width: 0;
}

.brand-logo-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 4px;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.brand-text {
    flex: 1;
    min-width: 0;
}

.brand-name {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
    line-height: 1.3;
    word-wrap: break-word;
}

.brand-category {
    font-size: 13px;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    display: inline-block;
}

.brand-score {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.score-value {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.score-stars {
    color: #ffd700;
}

.brand-summary {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brand-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.brand-position {
    font-size: 12px;
    color: #718096;
    background: #f7fafc;
    padding: 4px 8px;
    border-radius: 6px;
}

.expand-icon {
    color: #a0aec0;
    transition: transform 0.3s ease;
}

.brand-card:hover .expand-icon {
    transform: translateX(3px);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.no-results h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.no-results p {
    font-size: 16px;
    opacity: 0.8;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    z-index: 1001;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2d3748;
}

.modal-brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 4px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #a0aec0;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f7fafc;
    color: #667eea;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

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

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section p {
    color: #4a5568;
    line-height: 1.7;
    font-size: 14px;
}

.modal-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
    margin-bottom: 20px;
}

.meta-item {
    text-align: center;
}

.meta-label {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.meta-value {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .stats {
        gap: 20px;
    }

    .controls-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .brands-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .modal-content {
        margin: 20px;
        max-width: calc(100vw - 40px);
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    .modal-meta {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Score-based styling */
.score-excellent { color: #38a169; }
.score-good { color: #3182ce; }
.score-average { color: #d69e2e; }
.score-poor { color: #e53e3e; }

/* Awards List Styling */
.awards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.award-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ffd700;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.award-item:hover {
    background: #f0f2f5;
    transform: translateX(2px);
}

.award-item i {
    color: #ffd700;
    margin-top: 2px;
    flex-shrink: 0;
}

.award-item:nth-child(even) {
    border-left-color: #667eea;
}

.award-item:nth-child(even) i {
    color: #667eea;
}

/* Custom scrollbar */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Map Section */
.map-section {
    display: none;
    background: white;
    min-height: 100vh;
    padding: 20px 0;
}

.map-section.active {
    display: block;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.map-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-header i {
    color: #667eea;
}

.back-to-database {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-to-database:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.map-container {
    width: 100%;
    height: 80vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 2px solid #e2e8f0;
    position: relative;
    background: #f8f9fa;
}

/* Removed unused map-fallback styles */

.map-container iframe {
    width: 100%;
    height: 100%;
    opacity: 1;
    position: relative;
    z-index: 5;
    border-radius: 8px;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: white;
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: white;
}

.footer-section p {
    color: #cbd5e0;
    line-height: 1.6;
    font-size: 14px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-link-btn {
    background: none;
    border: none;
    color: #cbd5e0;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
}

.footer-link-btn:hover {
    color: white;
}

.footer-link-btn i {
    color: #667eea;
}

.footer-stats {
    list-style: none;
    padding: 0;
}

.footer-stats li {
    margin-bottom: 8px;
    font-size: 14px;
    color: #cbd5e0;
}

.footer-stats span {
    font-weight: 600;
    color: #667eea;
}

/* Scoring Methodology Styles */
.scoring-info {
    font-size: 13px;
}

.scoring-info p {
    margin-bottom: 12px;
    color: #e2e8f0;
}

.scoring-metrics {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.scoring-metrics li {
    margin-bottom: 6px;
    color: #cbd5e0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.scoring-metrics li i {
    color: #f56565;
    margin-top: 2px;
    flex-shrink: 0;
}

.scoring-metrics li strong {
    color: #e2e8f0;
}

.scoring-note {
    font-size: 12px;
    color: #a0aec0;
    font-style: italic;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scoring-note i {
    color: #667eea;
    flex-shrink: 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #4a5568;
    color: #a0aec0;
    font-size: 14px;
}

/* Hide main content when map is active */
.app.map-active .header,
.app.map-active .controls,
.app.map-active .main {
    display: none;
}

.app.map-active .map-section {
    display: block;
}

/* Responsive Design Updates */
@media (max-width: 768px) {
    .map-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .map-container {
        height: 60vh;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .back-to-database {
        width: 100%;
        justify-content: center;
    }
}
