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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent: #e50914;
    /* Netflix Red */
    --accent-hover: #f40612;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #e50914 0%, #b81d24 100%);
    --card-hover: translateY(-5px);
    --transition: all 0.3s ease;
    --movie-item-bg: rgba(0, 0, 0, 0.02);
    --movie-item-border: rgba(0, 0, 0, 0.05);
    --movie-item-hover-bg: rgba(0, 0, 0, 0.04);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: #0f1115;
    --bg-secondary: #1a1d24;
    --text-primary: #ffffff;
    --text-secondary: #a0a5b1;
    --glass-bg: rgba(26, 29, 36, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --movie-item-bg: rgba(255, 255, 255, 0.03);
    --movie-item-border: rgba(255, 255, 255, 0.05);
    --movie-item-hover-bg: rgba(255, 255, 255, 0.07);
}

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-primary);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

/* Sticky Navbar */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    padding: 8px 0;
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent) !important;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .navbar {
        padding: 6px 0 !important;
    }
    .navbar-brand {
        font-size: 1.45rem !important;
    }
    .navbar-toggler {
        padding: 4px 8px !important;
        font-size: 0.9rem !important;
    }
}

.nav-link {
    font-weight: 500;
    margin: 0 10px;
    color: var(--text-primary) !important;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent) !important;
}

/* Buttons */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: 5px;
    padding: 10px 24px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.4);
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 80vh;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(15, 17, 21, 1) 0%, rgba(15, 17, 21, 0.4) 50%, rgba(15, 17, 21, 1) 100%),
        linear-gradient(to top, rgba(15, 17, 21, 1) 0%, transparent 40%);
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Movie Cards */
.movie-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    background: var(--bg-secondary);
}

.movie-card img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: var(--transition);
}

.movie-card:hover {
    transform: var(--card-hover);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

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

.movie-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 20px;
    opacity: 0;
    transition: var(--transition);
}

.movie-card:hover .movie-overlay {
    opacity: 1;
}

/* Badges */
.badge-quality {
    background: #f5c518;
    color: #000;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.badge-rating {
    background: transparent;
    border: 1px solid #f5c518;
    color: #f5c518;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Footer */
footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    padding: 50px 0 20px;
    margin-top: 50px;
}


/* Footer */
footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    padding: 50px 0 20px;
    margin-top: 50px;
}

.added-movie-list {
    display: grid;
    grid-template-columns: 1fr;
    /* 1 column by default (mobile/tablet) */
    gap: 16px;
}

@media (min-width: 992px) {
    .added-movie-list {
        grid-template-columns: repeat(3, 1fr);
        /* 3 columns side-by-side on PC */
    }
}

.added-movie-item {
    display: flex;
    align-items: flex-start;
    padding: 14px;
    border-radius: 12px;
    background-color: var(--movie-item-bg);
    border: 1px solid var(--movie-item-border);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    /* Establish relative layout boundary for full-card link overlay */
}

.added-movie-item:hover {
    transform: translateY(-2px);
    background-color: var(--movie-item-hover-bg);
    border-color: rgba(166, 124, 0, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.added-movie-poster {
    width: 65px;
    height: 92px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.added-movie-item:hover .added-movie-poster {
    transform: scale(1.03);
    border-color: rgba(255, 255, 255, 0.25);
}

.added-movie-details {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 1px;
    flex-grow: 1;
    min-width: 0;
}

.added-movie-title {
    color: #a67c00;
    /* Golden brown color matching screenshot */
    font-weight: 800;
    font-size: 1.12rem;
    line-height: 1.35;
    text-decoration: none;
    transition: var(--transition);
    margin: 0 0 6px 0;
    letter-spacing: -0.2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.70em;
    /* reserves exactly 2 lines: line-height 1.35 * 2 = 2.70em */
    word-break: break-word;
}

/* Stretches the link to cover the entire card */
.added-movie-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.added-movie-title:hover {
    color: #805300 !important;
    text-decoration: underline !important;
}

.added-movie-item:hover .added-movie-title {
    color: #805300 !important;
    text-decoration: underline !important;
}

[data-theme="dark"] .added-movie-title:hover,
[data-theme="dark"] .added-movie-item:hover .added-movie-title {
    color: #ffd073 !important;
}

/* Ensure buttons and other links remain active and clickable above the card cover link */
.added-movie-item a:not(.added-movie-title),
.added-movie-item button {
    position: relative;
    z-index: 2;
}

.added-movie-badge {
    background-color: #805300;
    /* Brown gold background matching screenshot */
    color: #ffffff !important;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-block;
    align-self: flex-start;
    text-transform: capitalize;
    line-height: 1.2;
}

.added-movie-rating {
    color: #ffc107;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    background-color: rgba(245, 197, 24, 0.1);
    border: 1px solid rgba(245, 197, 24, 0.25);
    padding: 3px 9px;
    border-radius: 6px;
}

.added-movie-rating i {
    font-size: 0.72rem;
    margin-right: 4px;
}

.added-movie-quality {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    line-height: 1.2;
    text-transform: uppercase;
}

/* Light mode adjustments for the quality badge */
:root:not([data-theme="dark"]) .added-movie-quality {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Advanced Premium Mobile Touch Sliders */
@media (max-width: 575.98px) {
    .added-movie-list {
        display: flex !important;
        flex-direction: column !important;
        overflow-x: visible !important;
        gap: 10px !important;
        padding-bottom: 8px;
        padding-left: 2px;
        padding-right: 2px;
    }
    .added-movie-item {
        flex: 0 0 auto !important;
        width: 100% !important;
        padding: 6px !important;
        border-radius: 8px !important;
    }
    .added-movie-poster {
        width: 48px !important;
        height: 68px !important;
        border-radius: 6px !important;
    }
    .added-movie-details {
        margin-left: 8px !important;
    }
    .added-movie-details > div {
        flex-wrap: nowrap !important;
    }
    .added-movie-title {
        font-weight: 700 !important;
        font-size: 0.76rem !important;
        margin-bottom: 4px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        height: auto !important;
    }
    .added-movie-badge,
    .added-movie-quality,
    .added-movie-rating {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.56rem !important;
        padding: 0 5px !important;
        border-radius: 4px !important;
        height: 16px !important;
        line-height: 1 !important;
    }
    .added-movie-rating i {
        font-size: 0.50rem !important;
        margin-right: 2px !important;
    }
}

/* Premium Comment Card Box Styling */
.comment-item {
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border) !important;
    border-radius: 8px;
    margin-bottom: 16px;
    transition: var(--transition);
}
.comment-item:hover {
    border-color: var(--accent) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .comment-item:hover {
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.15);
}

/* Capitalize the first letter of each comment automatically */
.comment-text p::first-letter {
    text-transform: uppercase;
}

/* Mobile adjustments for comment card details */
@media (max-width: 575.98px) {
    .comment-item {
        padding: 10px !important;
        margin-bottom: 12px;
    }
    .comment-item h6 {
        font-size: 0.8rem !important; /* Smaller username on mobile */
    }
    .comment-item small, 
    .comment-item span.text-muted {
        font-size: 0.7rem !important; /* Smaller date/bullet on mobile */
    }
    .comment-text p {
        font-size: 0.82rem !important; /* Smaller comment text on mobile */
        line-height: 1.4;
    }
    .comment-item .avatar {
        width: 24px !important;
        height: 24px !important;
    }
    .comment-item .avatar i {
        font-size: 0.65rem !important;
    }
}

/* Comment expansion & collapse animation */
.comment-text-wrapper {
    position: relative;
}
.comment-text {
    line-height: 1.4;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-right: 35px;
}
.comment-text.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.8em; /* Exactly 2 lines of text */
}
.comment-text.expanded {
    display: block;
    padding-bottom: 20px;
}
.comment-toggle-btn {
    position: absolute;
    bottom: 2px; /* Aligns arrow vertically with the second line */
    right: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    outline: none !important;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to left, var(--bg-secondary) 50%, transparent 100%);
    padding-left: 28px;
    padding-right: 2px;
    transition: var(--transition);
}
.comment-toggle-btn:hover {
    color: var(--accent);
}

/* Genre Badges Hover Effects */
.genre-badge-item {
    transition: all 0.25s ease-in-out;
}
.genre-badge-item:hover {
    background-color: var(--accent) !important;
    color: #ffffff !important;
    border-color: var(--accent) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.2);
}

/* Premium Hover Lift Utility */
.hover-translate-y {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-translate-y:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(229, 9, 20, 0.35) !important;
}