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

:root {
    --bg-dark: #0A0A0A;
    --surface: #14141A;
    --surface-light: #1E1E26;
    --primary: #F5C518;
    --primary-hover: #D4B516;
    --secondary: #03DAC6;
    --danger: #CF6679;
    --text: #FFFFFF;
    --text-muted: #A0A0B0;
    --border: #2A2A35;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body {
    background-color: var(--bg-dark);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.montserrat {
    font-family: 'Montserrat', sans-serif;
}

/* Glassmorphism */
.glass {
    background: rgba(20, 20, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-light) var(--bg-dark);
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.admin-only {
    display: none !important;
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary);
    color: #000;
    box-shadow: 0 4px 15px rgba(245, 197, 24, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(245, 197, 24, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary);
    color: #000;
    box-shadow: 0 4px 15px rgba(3, 218, 198, 0.2);
}

.btn-secondary:hover {
    background-color: #02c0ae;
    box-shadow: 0 6px 20px rgba(3, 218, 198, 0.4);
    transform: translateY(-2px);
}

.btn-delete {
    background-color: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-delete:hover {
    background-color: var(--danger);
    color: #fff;
    box-shadow: 0 4px 15px rgba(207, 102, 121, 0.3);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-outline:hover {
    background-color: var(--surface-light);
    color: var(--text);
}

.btn-small {
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 6px;
}

/* Form Inputs */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input,
input,
select,
textarea {
    width: 100%;
    padding: 14px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.1);
    background: var(--surface);
}

.form-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: #555;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

/* Login/Cadastrar Container */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(245, 197, 24, 0.05), transparent 40%),
        radial-gradient(circle at bottom left, rgba(3, 218, 198, 0.05), transparent 40%),
        var(--bg-dark);
}

.auth-container {
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow);
}

.auth-title {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #fff;
    letter-spacing: -1px;
    font-weight: 900;
}

.auth-title span {
    color: var(--primary);
}

.toggle-link {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    font-weight: 500;
}

.toggle-link:hover {
    color: var(--primary);
}

/* Dashboard Header */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: baseline;
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: -1px;
}

.logo-reel {
    color: var(--primary);
}

.logo-sub {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-left: 8px;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Filters */
.filter-container {
    padding: 20px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

/* Main Content */
.main-content {
    padding: 30px 40px;
    padding-bottom: 80px;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.carousel-wrapper {
    position: relative;
    margin-bottom: 40px;
}

.carousel-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px 10px;
    margin: -20px -10px;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for carousel */
.carousel-track {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 26, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    font-size: 1.2rem;
}

.carousel-wrapper:hover .nav-btn {
    opacity: 1;
}

.nav-btn:hover {
    background: var(--primary);
    color: #000;
    transform: translateY(-50%) scale(1.1);
}

.nav-btn.prev {
    left: -20px;
}

.nav-btn.next {
    right: -20px;
}

/* Movie Cards */
.card {
    min-width: 240px;
    max-width: 240px;
    background-color: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    position: relative;
}

.card:hover {
    transform: translateY(-12px);
    border-color: rgba(245, 197, 24, 0.4);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.card img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover img {
    transform: scale(1.05);
}

.card-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    background: var(--surface);
}

.card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.card-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card-actions {
    padding: 12px 16px;
    background-color: var(--surface-light);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    z-index: 2;
}

.card-actions button {
    flex: 1;
}

.card-no-img {
    width: 100%;
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-light);
    font-size: 3rem;
}

.sessao-badge-top {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeInModal 0.3s forwards;
}

@keyframes fadeInModal {
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--surface);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 16px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    animation: scaleInModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleInModal {
    to {
        transform: scale(1);
    }
}

.modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(20, 20, 26, 0.98);
    z-index: 10;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    padding: 0;
    margin-top: -5px;
}

.modal-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

/* Tabs */
.date-tabs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
}

.date-tabs::-webkit-scrollbar {
    height: 4px;
}

.date-tab {
    background: var(--surface-light);
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-weight: 500;
}

.date-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.date-tab.active {
    background: rgba(245, 197, 24, 0.1);
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

/* Sessions Config */
.cinema-group {
    margin-bottom: 30px;
}

.cinema-group-title {
    color: #fff;
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-family: 'Montserrat', sans-serif;
}

.session-btn {
    margin-right: 10px;
    margin-bottom: 10px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.session-btn:hover {
    background: var(--secondary);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(3, 218, 198, 0.3);
}

/* Admin Panels */
.admin-sessao-panel {
    display: none;
    margin-top: 30px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    animation: fadeIn 0.4s;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin-bottom: 10px;
    background: var(--surface-light);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
}

.list-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
        background: var(--surface);
    }

    .actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .filter-container {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    #filtroNome {
        width: 100% !important;
    }

    .modal-body {
        padding: 20px;
    }

    #detalhePoster {
        width: 120px !important;
        margin-bottom: 15px;
    }

    .modal-body>div:first-child {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
}