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

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #242A32;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
.header {
    padding: 56px 20px 0;
    background: #242A32;
}

.status-bar {
    height: 0;
}

h1 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 24px;
    line-height: 1.3;
    letter-spacing: 0.2px;
}

/* Search */
.search-container {
    position: relative;
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    background: #3A3F47;
    border: none;
    border-radius: 16px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: background 0.3s;
    font-family: 'Poppins', sans-serif;
}

.search-input:focus {
    background: #3A3F47;
}

.search-input::placeholder {
    color: #67686D;
    font-weight: 400;
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) scaleX(-1);
    color: #67686D;
    font-size: 18px;
    pointer-events: none;
}

/* Hero Section */
.hero-section {
    margin-bottom: 24px;
    padding: 0 20px;
}

.hero-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

.hero-grid::-webkit-scrollbar {
    display: none;
}

.hero-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    aspect-ratio: 3/4;
    width: 70%;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.hero-card:hover {
    transform: scale(1.03);
}

.hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    padding: 0 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color 0.3s;
    font-family: 'Poppins', sans-serif;
}

.tab:hover {
    color: rgba(255,255,255,0.7);
}

.tab.active {
    color: #fff;
    font-weight: 500;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 4px;
    background: #3A3F47;
    border-radius: 2px;
}

/* Movies Grid */
.movies-container {
    padding: 16px 20px 100px;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.movie-card {
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    background: rgba(255,255,255,0.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.movie-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

/* Detail Page */
.detail-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #242A32;
    z-index: 1000;
    overflow-y: auto;
}

.detail-page.active {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.detail-header {
    position: relative;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #242A32;
    position: sticky;
    top: 0;
    z-index: 10;
}

.detail-header .back-button {
    display: flex;
}

.back-button {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.back-button:hover {
    background: rgba(255,255,255,0.1);
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin: 0;
    letter-spacing: 0.3px;
}

.bookmark-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.bookmark-btn:hover {
    background: rgba(255,255,255,0.1);
}

.bookmark-btn.active {
    color: #0296E5;
}

.detail-hero {
    position: relative;
    height: 210px;
    margin-bottom: 20px;
    overflow: visible;
}

.detail-hero > img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.detail-poster {
    position: absolute;
    bottom: -50px;
    left: 29px;
    width: 95px;
    height: 142px;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #242A32;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 5;
}

.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-rating {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(37, 40, 54, 0.52);
    padding: 4px 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(2px);
}

.star-icon {
    color: #FF8700;
    font-size: 16px;
}

.rating-value {
    font-weight: 600;
    font-size: 12px;
    color: #FF8700;
}

.detail-content {
    padding: 64px 20px 100px;
}

.detail-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 12px;
    line-height: 1.3;
    letter-spacing: 0.15px;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    font-weight: 400;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item:not(:last-child)::after {
    content: '';
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,0.3);
    margin-left: 12px;
}

.meta-item i {
    font-size: 14px;
    opacity: 0.7;
}

.detail-tabs {
    display: flex;
    gap: 32px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.detail-tab {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 0;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
    font-family: 'Poppins', sans-serif;
}

.detail-tab:hover {
    color: rgba(255,255,255,0.7);
}

.detail-tab.active {
    color: #fff;
    font-weight: 500;
}

.detail-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 4px;
    background: #3A3F47;
    border-radius: 2px 2px 0 0;
}

.detail-description {
    line-height: 1.5;
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.1px;
}

/* Watch List Page */
.watchlist-page {
    display: none;
    padding: 80px 20px 100px;
}

.watchlist-page.active {
    display: block;
}

.watchlist-item {
    display: flex;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.watchlist-item:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(5px);
}

.watchlist-poster {
    width: 100px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.watchlist-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.watchlist-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.watchlist-title {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    line-height: 1.3;
}

.watchlist-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: rgba(255,255,255,0.8);
    font-size: 12px;
}

.watchlist-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.watchlist-meta-item i.fa-star {
    color: #FF8700;
    font-size: 14px;
}

.watchlist-meta-item i:not(.fa-star) {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    width: 14px;
}

/* Search Page */
.search-page {
    display: none;
    padding: 80px 20px 100px;
}

.search-page.active {
    display: block;
}

.search-content {
    max-width: 100%;
}

.search-history {
    margin-bottom: 30px;
}

.search-history-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: rgba(255,255,255,0.9);
}

.search-history-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-history-item {
    background: #3A3F47;
    border: none;
    border-radius: 16px;
    padding: 8px 16px;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.3s;
}

.search-history-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.search-recommendations {
    margin-top: 30px;
}

.search-recommendations-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: rgba(255,255,255,0.9);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #242A32;
    padding: 12px 0 8px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #0296E5;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1px;
    transition: color 0.3s;
    font-family: 'Poppins', sans-serif;
}

.nav-item:hover {
    color: rgba(255,255,255,0.7);
}

.nav-item.active {
    color: #0296E5;
}

.nav-icon {
    font-size: 24px;
}

.nav-icon i {
    font-size: 24px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.5);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-icon i {
    font-size: 64px;
}

.error {
    text-align: center;
    padding: 40px 20px;
    color: #ff4444;
}

/* Desktop Responsive */
@media (min-width: 768px) {
    body {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0;
    }

    .header {
        padding: 25px 30px 0;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 25px;
    }

    .hero-section {
        padding: 0 30px;
    }

    .hero-grid {
        gap: 20px;
        padding-bottom: 15px;
    }

    .hero-card {
        width: 30%;
        height: 280px;
    }

    .hero-card img {
        height: 280px;
    }

    .tabs {
        padding: 0 30px;
        gap: 30px;
    }

    .movies-container {
        padding: 0 30px 100px;
    }

    .movies-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }

    .watchlist-page {
        padding: 100px 30px 100px;
    }
    
    .watchlist-item {
        margin-bottom: 20px;
        padding: 20px;
    }
    
    .watchlist-poster {
        width: 100px;
        height: 150px;
    }

    .search-page {
        padding: 100px 30px 100px;
    }

    .search-history-items {
        gap: 12px;
    }

    .detail-hero {
        height: 300px;
    }
    
    .detail-hero > img {
        height: 300px;
    }

    .detail-poster {
        width: 120px;
        height: 180px;
        bottom: -70px;
        left: 30px;
    }

    .detail-content {
        padding: 90px 30px 100px;
    }
}

@media (min-width: 1024px) {
    .hero-card {
        width: 22%;
        height: 300px;
    }
    
    .hero-card img {
        height: 300px;
    }
    
    .movies-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}