/**
 * ============================================================
 * MovieApp — Main Application Stylesheet
 * ============================================================
 * Netflix-inspired dark theme with custom components.
 * This file contains all global styles used by layouts/app.blade.php.
 * ============================================================
 */

/* ===== RESET & BASE ===== */

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

body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #141414;
    color: #e5e5e5;
    min-height: 100vh;
}

a {
    color: #e5e5e5;
    text-decoration: none;
}

a:hover {
    color: #fff;
    text-decoration: none;
}

/* ===== LOADING OVERLAY ===== */

.search-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.search-loading-overlay.active {
    display: flex;
}

.search-loading-overlay .loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #e50914;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.search-loading-overlay p {
    color: #aaa;
    margin-top: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== NAVBAR ===== */

.nf-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 64px;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.6) 60%,
            transparent 100%);
    transition: background 0.3s ease;
}

.nf-navbar.scrolled {
    background: rgba(20, 20, 20, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.nf-navbar .nav-left {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nf-navbar .brand {
    font-size: 1.7rem;
    font-weight: 800;
    color: #e50914;
    letter-spacing: -1px;
}

.nf-navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.nf-navbar .nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: #b3b3b3;
    transition: color 0.2s;
}

.nf-navbar .nav-links a:hover {
    color: #fff;
}

.nf-navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== LANGUAGE BUTTONS (Navbar) ===== */

.nf-navbar .lang-btn {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.nf-navbar .lang-btn.active {
    background: #e50914;
    color: #fff;
}

.nf-navbar .lang-btn:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.nf-navbar .lang-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ===== LOGOUT / LOGIN BUTTONS (Navbar) ===== */

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #e5e5e5;
    padding: 5px 16px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

.btn-logout:hover {
    background: #e50914;
    border-color: #e50914;
    color: #fff;
}

.btn-login-nav {
    background: #e50914;
    color: #fff;
    padding: 6px 18px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
    margin-left: 8px;
}

.btn-login-nav:hover {
    background: #f6121d;
    color: #fff;
}

/* ===== HAMBURGER BUTTON (Mobile) ===== */

.nf-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1100;
}

.nf-hamburger span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: #e5e5e5;
    margin: 5px 0;
    border-radius: 2px;
    transition: 0.3s ease;
}

.nf-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nf-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nf-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== MOBILE DRAWER ===== */

.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1050;
}

.mobile-drawer-overlay.active {
    display: block;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: #1a1a1a;
    z-index: 1060;
    transition: right 0.3s ease;
    padding: 80px 24px 30px;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-drawer.active {
    right: 0;
}

.mobile-drawer .drawer-section {
    margin-bottom: 28px;
}

.mobile-drawer .drawer-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a2a2a;
}

.mobile-drawer .drawer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: #b3b3b3;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.mobile-drawer .drawer-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.mobile-drawer .drawer-link .icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.mobile-drawer .drawer-lang {
    display: flex;
    gap: 8px;
    padding: 4px 14px;
}

.mobile-drawer .drawer-lang-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    flex: 1;
    transition: all 0.2s;
}

.mobile-drawer .drawer-lang-btn.active {
    background: #e50914;
    color: #fff;
}

.mobile-drawer .drawer-lang-btn:not(.active) {
    background: #2a2a2a;
    color: #777;
}

.mobile-drawer .drawer-lang-btn:not(.active):hover {
    background: #333;
    color: #fff;
}

.mobile-drawer .drawer-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(229, 9, 20, 0.4);
    color: #e50914;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-drawer .drawer-logout-btn:hover {
    background: #e50914;
    color: #fff;
}

.mobile-drawer .drawer-login-btn {
    background: #e50914;
    color: #fff;
    justify-content: center;
    border-radius: 6px;
}

/* ===== MAIN CONTENT ===== */

.nf-main {
    min-height: calc(100vh - 64px - 60px);
    padding: 30px 40px;
}

/* ===== CONTAINERS ===== */

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

/* ===== ALERT (hidden — SweetAlert2 handles alerts) ===== */

.nf-alert {
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: none;
}

/* ===== SEARCH BAR ===== */

.nf-search-bar {
    display: flex;
    gap: 0;
    margin-bottom: 36px;
    max-width: 700px;
}

.nf-search-bar input {
    flex: 1;
    padding: 14px 20px;
    background: #333;
    border: 2px solid #444;
    border-right: none;
    border-radius: 6px 0 0 6px;
    color: #fff;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.nf-search-bar input::placeholder {
    color: #777;
}

.nf-search-bar input:focus {
    border-color: #e50914;
}

.nf-search-bar button {
    padding: 14px 28px;
    background: #e50914;
    color: #fff;
    border: 2px solid #e50914;
    border-radius: 0 6px 6px 0;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.2s;
}

.nf-search-bar button:hover {
    background: #f6121d;
}

/* ===== SECTION TITLES ===== */

.nf-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
}

/* ===== MOVIE GRID ===== */

.nf-movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* ===== MOVIE CARD ===== */

.nf-card {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.nf-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.nf-card .poster {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.nf-card .card-body {
    padding: 14px 14px 16px;
}

.nf-card .card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.nf-card .card-year {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 12px;
}

.nf-card .card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ===== BUTTONS ===== */

.btn-nf {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
    width: 100%;
    text-decoration: none;
}

.btn-nf-white {
    background: #fff;
    color: #141414;
}

.btn-nf-white:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #141414;
}

.btn-nf-red {
    background: #e50914;
    color: #fff;
}

.btn-nf-red:hover {
    background: #f6121d;
    color: #fff;
}

.btn-nf-outline {
    background: transparent;
    color: #e5e5e5;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-nf-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    color: #fff;
}

.btn-nf-danger-outline {
    background: transparent;
    color: #e50914;
    border: 1px solid rgba(229, 9, 20, 0.4);
}

.btn-nf-danger-outline:hover {
    background: #e50914;
    color: #fff;
}

.btn-nf-danger {
    background: rgba(229, 9, 20, 0.15);
    color: #ff3b47;
    border: 1px solid rgba(229, 9, 20, 0.3);
}

.btn-nf-danger:hover {
    background: #e50914;
    color: #fff;
}

/* ===== BUTTON MODIFIERS ===== */

.btn-nf--auto {
    width: auto;
    display: inline-flex;
}

.btn-nf--back {
    padding: 8px 20px;
    margin-bottom: 24px;
}

.btn-nf--favorite {
    padding: 12px 36px;
    font-size: 1rem;
}

/* ===== EMPTY STATE ===== */

.nf-empty {
    text-align: center;
    padding: 80px 20px;
}

.nf-empty h3 {
    color: #777;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.nf-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.nf-empty .btn-nf {
    width: auto;
    display: inline-flex;
    padding: 12px 32px;
}

/* ===== LOADING SPINNER (Infinite Scroll) ===== */

.nf-loader {
    text-align: center;
    padding: 30px;
    display: none;
}

.nf-loader .loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #e50914;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* ===== FOOTER ===== */

.nf-footer {
    text-align: center;
    padding: 24px 40px;
    color: #555;
    font-size: 0.8rem;
    border-top: 1px solid #222;
}

/* ===== FORM HELPERS ===== */

.inline-form {
    display: inline;
}

/* ===== RESPONSIVE (Mobile ≤ 768px) ===== */

@media (max-width: 768px) {
    .nf-navbar {
        padding: 0 16px;
    }

    .nf-main {
        padding: 20px 16px;
    }

    .nf-navbar .nav-links {
        display: none;
    }

    .nf-navbar .nav-right {
        display: none;
    }

    .nf-hamburger {
        display: block;
    }

    .nf-movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .nf-card .poster {
        height: 210px;
    }

    .nf-search-bar {
        max-width: 100%;
    }

    .nf-section-title {
        font-size: 1.2rem;
    }

    .nf-footer {
        padding: 20px 16px;
    }
}
