@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0a0b0e;
    --bg-card: rgba(22, 25, 34, 0.75);
    --bg-card-hover: rgba(30, 35, 48, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(242, 201, 76, 0.4);
    --accent-gold: #f2c94c;
    --accent-gold-gradient: linear-gradient(135deg, #f2c94c 0%, #f2994a 100%);
    --accent-green: #27ae60;
    --accent-red: #eb5757;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow-glow: 0 10px 30px -10px rgba(242, 201, 76, 0.25);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 10%, rgba(242, 201, 76, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(242, 153, 74, 0.06) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem 1.5rem;
    line-height: 1.6;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
}

/* Header & Navbar */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-card);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gold-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-glow);
}

.logo-text h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #f2c94c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    font-family: 'Outfit', sans-serif;
    padding: 0.7rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    outline: none;
}

.btn-gold {
    background: var(--accent-gold-gradient);
    color: #0e1117;
    box-shadow: 0 4px 15px rgba(242, 201, 76, 0.3);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 201, 76, 0.5);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    border-radius: 8px;
}

.btn-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.4);
}

.btn-danger:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: rgba(231, 76, 60, 0.6);
    transform: translateY(-2px);
}

/* iCalendar Share Section */
.ics-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.ics-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ics-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gold-gradient);
    opacity: 0.6;
}

.ics-card:hover {
    border-color: var(--border-glass-hover);
    transform: translateY(-3px);
}

.ics-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ics-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.badge {
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-gold {
    background: rgba(242, 201, 76, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(242, 201, 76, 0.3);
}

.badge-green {
    background: rgba(39, 174, 96, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.badge-duo {
    background: rgba(155, 89, 182, 0.15);
    color: #d291bc;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.badge-red {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.4);
}

.ics-url-box {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    align-items: center;
}

.ics-url-input {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
}

/* Tabs & Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: rgba(22, 25, 34, 0.6);
    padding: 0.35rem;
    border-radius: 14px;
    border: 1px solid var(--border-glass);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: var(--accent-gold-gradient);
    color: #0e1117;
    font-weight: 600;
}

/* Movie Cards Grid */
.screenings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
}

.movie-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: var(--shadow-card);
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(242, 201, 76, 0.35);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

.movie-card-hero {
    position: relative;
    height: 190px;
    overflow: hidden;
}

.movie-poster-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.65) contrast(1.1);
    transition: transform 0.6s ease;
}

.movie-card:hover .movie-poster-bg {
    transform: scale(1.05);
}

.movie-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(to top, rgba(10, 11, 14, 0.95) 15%, transparent);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.movie-title-area h3 {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.movie-cinema-name {
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 500;
}

.movie-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
}

.info-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-synopsis {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Duo Toggle Button */
.duo-toggle-btn {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.duo-active {
    background: rgba(39, 174, 96, 0.15);
    color: #2ecc71;
    border-color: rgba(39, 174, 96, 0.35);
}

.duo-active:hover {
    background: rgba(39, 174, 96, 0.25);
}

.duo-inactive {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-color: var(--border-glass);
}

.duo-inactive:hover {
    background: rgba(242, 201, 76, 0.15);
    color: var(--accent-gold);
    border-color: rgba(242, 201, 76, 0.4);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 11, 14, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #131722;
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.35rem;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--accent-gold);
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: #1e2330;
    border-left: 4px solid var(--accent-gold);
    color: var(--text-primary);
    padding: 0.9rem 1.4rem;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-glass);
    border-radius: 20px;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin: 1rem 0 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 450px;
    margin: 0 auto 1.5rem;
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }
    .ics-section {
        grid-template-columns: 1fr;
    }
}

/* Auth Banner */
.auth-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 1rem;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.auth-connected {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.25);
    color: #2ecc71;
}

.auth-refresh {
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid rgba(243, 156, 18, 0.25);
    color: #f39c12;
}

.auth-disconnected {
    background: rgba(235, 87, 87, 0.08);
    border: 1px solid rgba(235, 87, 87, 0.2);
    color: #eb5757;
}

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

/* Details/summary (fallback token) */
details summary {
    list-style: none;
}
details summary::-webkit-details-marker {
    display: none;
}
details summary::before {
    content: '▶ ';
    font-size: 0.7rem;
    margin-right: 0.3rem;
}
details[open] summary::before {
    content: '▼ ';
}

/* Spinner animation for sync button */
@keyframes spin-inline {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-syncing {
    pointer-events: none;
    opacity: 0.8;
}

.btn-syncing .sync-icon {
    display: inline-block;
    animation: spin-inline 1s linear infinite;
}

/* Login overlay */
.login-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    background-image:
        radial-gradient(at 10% 10%, rgba(242, 201, 76, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(242, 153, 74, 0.06) 0px, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.login-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-card .subtitle {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 1.75rem;
}

.login-card .form-input {
    text-align: center;
    margin-bottom: 1rem;
}

.login-error {
    color: var(--accent-red);
    font-size: 0.82rem;
    min-height: 1.2em;
    margin-bottom: 0.5rem;
}

/* Bottom padding to allow full scroll on category change */
#screenings-grid {
    padding-bottom: 75vh;
}
