/* ===================================
   MODERN SAAS LOCATION MODAL
   Clean, minimal, professional
   =================================== */

/* Modal Overlay - Centered popup backdrop */
.modal.active {
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Centered Popup Modal - Desktop */
.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: var(--color-bg-primary);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0 auto;
    animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal.closing .modal-content {
    animation: fadeOutScale 0.25s cubic-bezier(0.4, 0, 1, 1);
}

@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Close Button - Top right, clean */
.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Location Header - Hero section */
.location-header {
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg,
        rgba(37, 87, 167, 0.08) 0%,
        rgba(26, 75, 160, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.location-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.location-address {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.location-address::before {
    content: "📍";
    font-size: 1rem;
}

.location-category {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    background: rgba(100, 150, 220, 0.12);
    border: 1px solid rgba(100, 150, 220, 0.25);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(100, 150, 220, 1);
    text-transform: capitalize;
    letter-spacing: 0.02em;
    margin-top: 0.75rem;
}

/* Cuisine Tags - Modern pills */
.cuisine-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.cuisine-tag {
    padding: 0.35rem 0.75rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(168, 85, 247, 0.9);
}

/* Verification Badges - Redesigned */
.verification-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.verification-badge {
    padding: 0.4rem 0.85rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(16, 185, 129, 1);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: 0.02em;
}

.verification-badge.admin-verified {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.3);
    color: rgba(251, 191, 36, 1);
}

.verification-badge.community-verified {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
    color: rgba(59, 130, 246, 1);
}

/* Score Section - Hero display */
.score-section {
    padding: 2rem 2.5rem;
    background: var(--color-bg-primary);
    position: relative;
}

.score-display-large {
    font-size: 4rem;
    font-weight: 900;
    text-align: center;
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1;
}

.score-label {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.score-info h3 {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0.5rem 0 1rem 0;
}

/* Confidence Badge - Clean pill */
.confidence-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin: 0 auto;
    width: fit-content;
    display: block;
}

.confidence-badge.high {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: rgba(16, 185, 129, 1);
}

.confidence-badge.medium {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: rgba(251, 191, 36, 1);
}

.confidence-badge.low {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: rgba(239, 68, 68, 1);
}

/* Score Toggle - Minimal icon button */
.score-toggle {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.score-toggle-icon {
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1;
}

/* Summary Card - Glassmorphism */
.score-section > div[style*="border-left"] {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-left: 3px solid currentColor !important;
    border-radius: 12px !important;
    padding: 1.25rem !important;
    margin-top: 1.5rem !important;
}

/* Button - Modern SAAS style */
#toggleCalculationDetails {
    background: rgba(100, 150, 220, 0.1) !important;
    border: 1px solid rgba(100, 150, 220, 0.25) !important;
    border-radius: 8px !important;
    color: rgba(100, 150, 220, 1) !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

#toggleCalculationDetails:hover {
    background: rgba(100, 150, 220, 0.15) !important;
    transform: translateY(-1px);
}

/* Photos Section - Enhanced for Sidebar */
@media (min-width: 769px) {
    .location-photos {
        padding: 0;
        background: var(--color-bg-primary);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .photo-grid {
        display: grid;
        gap: 0;
    }

    /* Single photo - full width hero */
    .photo-grid:not(.two-photos):not(.three-photos) {
        grid-template-columns: 1fr;
    }

    .photo-grid:not(.two-photos):not(.three-photos) img {
        width: 100%;
        height: 400px;
        object-fit: cover;
        border-radius: 0;
        border: none;
    }

    /* Two photos - side by side */
    .photo-grid.two-photos {
        grid-template-columns: repeat(2, 1fr);
    }

    .photo-grid.two-photos img {
        width: 100%;
        height: 300px;
        object-fit: cover;
        border-radius: 0;
        border: none;
        border-right: 1px solid rgba(0, 0, 0, 0.2);
    }

    .photo-grid.two-photos img:last-child {
        border-right: none;
    }

    /* Three photos - masonry style */
    .photo-grid.three-photos {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 200px);
    }

    .photo-grid.three-photos img:first-child {
        grid-row: span 2;
        height: 100%;
        object-fit: cover;
        border-radius: 0;
        border: none;
        border-right: 1px solid rgba(0, 0, 0, 0.2);
    }

    .photo-grid.three-photos img:not(:first-child) {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    }

    .photo-grid.three-photos img:last-child {
        border-bottom: none;
    }
}

/* Photos on mobile - keep simple */
@media (max-width: 768px) {
    .location-photos {
        padding: 1.5rem 1.25rem;
        background: var(--color-bg-primary);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .photo-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .photo-grid img {
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        width: 100%;
        height: auto;
    }
}

/* Category Breakdown - Clean cards */
#calculationDetails > div {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

#calculationDetails h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin: 0 0 1rem 0;
}

/* Evidence items - Better spacing */
#calculationDetails [style*="display: flex; flex-direction: column"] > div {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Community Feedback Section */
.community-feedback {
    padding: 1.5rem 2.5rem;
    background: var(--color-bg-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.community-feedback h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: var(--color-text-primary);
}

.feedback-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.feedback-btn {
    flex: 1;
    padding: 0.85rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.feedback-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.feedback-btn.selected {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: rgba(16, 185, 129, 1);
}

.feedback-btn.selected.down {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: rgba(239, 68, 68, 1);
}

/* Scrollable modal body - Desktop Sidebar */
@media (min-width: 769px) {
    #modalBody {
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* Scrollable modal body - All devices (popup) */
#modalBody {
    max-height: calc(85vh - 80px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar */
#modalBody::-webkit-scrollbar {
    width: 8px;
}

#modalBody::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

#modalBody::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

#modalBody::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Mobile Responsive - Larger popup on small screens */
@media (max-width: 768px) {
    .modal.active {
        padding: 1rem;
    }

    .modal-content {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        border-radius: 16px;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }

    .location-header,
    .score-section,
    .location-photos,
    .community-feedback {
        padding: 1.5rem 1.25rem;
    }

    .location-header {
        padding-top: 2rem;
    }

    .location-title {
        font-size: 1.4rem;
    }

    .score-display-large {
        font-size: 3rem;
    }

    .feedback-buttons {
        flex-direction: column;
    }
}
