* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #0f0f1a 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #ffffff;
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 4px;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(79, 70, 229, 0.3); }
    50% { box-shadow: 0 0 20px rgba(79, 70, 229, 0.6); }
    100% { box-shadow: 0 0 5px rgba(79, 70, 229, 0.3); }
}

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

.page {
    display: none;
    animation: fadeUp 0.5s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.page.active {
    display: block;
}

.main-header {
    background: linear-gradient(to bottom, rgba(10, 10, 18, 0.98), rgba(10, 10, 18, 0.85), transparent);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.main-header .flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

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

.logo-preview {
    height: 48px;
    width: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: 2px solid rgba(79, 70, 229, 0.5);
    padding: 4px;
    transition: all 0.2s ease;
}

.logo-preview:hover {
    transform: scale(1.05);
    border-color: #7c3aed;
    box-shadow: 0 0 12px rgba(79, 70, 229, 0.5);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.avatar:hover {
    border-color: #4f46e5;
    transform: scale(1.05);
    animation: glow 1.5s infinite;
}

.user-info {
    text-align: right;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.user-status {
    font-size: 10px;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #10b981;
}

.search-genre-section {
    margin-bottom: 32px;
}

.search-wrapper {
    position: relative;
    max-width: 100%;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 16px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: rgba(30, 30, 45, 0.8);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 40px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
    font-size: 15px;
}

.search-input:focus {
    border-color: #4f46e5;
    background: rgba(20, 20, 35, 0.95);
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.2);
}

.genres-container {
    margin-bottom: 16px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    padding: 8px 0;
}

.genres-container::-webkit-scrollbar {
    height: 3px;
}

.genres-wrapper {
    display: inline-flex;
    gap: 10px;
    padding: 4px 0;
}

.genre-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(40, 40, 55, 0.6);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 40px;
    color: #b0b0b0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.genre-chip i {
    font-size: 12px;
}

.genre-chip:hover {
    background: rgba(79, 70, 229, 0.2);
    color: white;
    transform: translateY(-2px);
    border-color: #4f46e5;
}

.genre-chip.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.search-results {
    margin-top: 24px;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.search-results-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-results-title i {
    color: #4f46e5;
}

.clear-search-btn {
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
}

.clear-search-btn:hover {
    color: #4f46e5;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #ffffff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    background: none;
    color: #4f46e5;
    font-size: 20px;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.movie-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    animation: fadeUp 0.5s ease-out;
    animation-fill-mode: both;
    background: #14141f;
}

.movie-card:nth-child(1) { animation-delay: 0.01s; }
.movie-card:nth-child(2) { animation-delay: 0.02s; }
.movie-card:nth-child(3) { animation-delay: 0.03s; }
.movie-card:nth-child(4) { animation-delay: 0.04s; }
.movie-card:nth-child(5) { animation-delay: 0.05s; }
.movie-card:nth-child(6) { animation-delay: 0.06s; }
.movie-card:nth-child(7) { animation-delay: 0.07s; }
.movie-card:nth-child(8) { animation-delay: 0.08s; }
.movie-card:nth-child(9) { animation-delay: 0.09s; }
.movie-card:nth-child(10) { animation-delay: 0.1s; }
.movie-card:nth-child(11) { animation-delay: 0.11s; }
.movie-card:nth-child(12) { animation-delay: 0.12s; }
.movie-card:nth-child(13) { animation-delay: 0.13s; }
.movie-card:nth-child(14) { animation-delay: 0.14s; }
.movie-card:nth-child(15) { animation-delay: 0.15s; }
.movie-card:nth-child(16) { animation-delay: 0.16s; }
.movie-card:nth-child(17) { animation-delay: 0.17s; }
.movie-card:nth-child(18) { animation-delay: 0.18s; }
.movie-card:nth-child(19) { animation-delay: 0.19s; }
.movie-card:nth-child(20) { animation-delay: 0.2s; }

.movie-card:hover {
    transform: scale(1.05) translateY(-8px);
    z-index: 10;
    box-shadow: 0 25px 40px -15px rgba(79, 70, 229, 0.3);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.movie-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 12px 12px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.7), transparent);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.35s ease;
}

.movie-card:hover .movie-info {
    opacity: 1;
    transform: translateY(0);
}

.movie-title-card {
    font-weight: 600;
    font-size: 14px;
    color: white;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-year-card {
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.movie-year {
    color: #a5b4fc;
}

.movie-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(79, 70, 229, 0.3);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    color: #c7d2fe;
}

.movie-rating i {
    font-size: 10px;
    color: #4f46e5;
}

.watch-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    padding: 12px 28px;
    border-radius: 40px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.watch-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
}

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

.btn-outline {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(79, 70, 229, 0.3);
    padding: 12px 24px;
    border-radius: 40px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-outline:hover {
    background: rgba(79, 70, 229, 0.2);
    border-color: #4f46e5;
    transform: translateY(-2px);
}

.hero-section {
    position: relative;
    min-height: 75vh;
    background-size: cover;
    background-position: center 20%;
    margin-bottom: 40px;
    isolation: isolate;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 40%, transparent 70%);
    z-index: 0;
}

.hero-overlay {
    position: relative;
    z-index: 1;
    padding: 100px 32px 50px;
    max-width: 600px;
}

.hero-title {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.badge {
    background: rgba(79, 70, 229, 0.85);
    backdrop-filter: blur(8px);
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.hero-desc {
    color: #d0d0d0;
    line-height: 1.6;
    margin-bottom: 24px;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
    color: #c7d2fe;
}

.stat i {
    color: #4f46e5;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.back-btn {
    position: fixed;
    top: 85px;
    left: 20px;
    z-index: 200;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(79, 70, 229, 0.3);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: #4f46e5;
    transform: translateX(-3px);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}

.modal-container {
    max-width: 1000px;
    width: 95%;
    background: #0f0f1a;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(79, 70, 229, 0.3);
    animation: scaleIn 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.modal-close {
    position: absolute;
    top: -45px;
    right: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.modal-close:hover {
    background: #4f46e5;
    transform: scale(1.1);
}

.embed-iframe {
    width: 100%;
    height: 500px;
    border: none;
}

.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.profile-modal-content {
    background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
    border-radius: 28px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(79, 70, 229, 0.3);
    text-align: center;
    animation: scaleIn 0.3s ease;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #4f46e5;
    cursor: pointer;
}

.avatar-preview:hover {
    transform: scale(1.03);
    border-color: #7c3aed;
}

.glass-card {
    background: rgba(20, 20, 35, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid rgba(79, 70, 229, 0.1);
    padding: 20px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 18, 0.96);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(79, 70, 229, 0.2);
    display: flex;
    justify-content: space-around;
    padding: 10px 20px 22px;
    z-index: 50;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 6px 20px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    color: #777;
}

.nav-item i {
    font-size: 20px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.nav-item.active {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.12);
    transform: translateY(-5px);
}

.toast-notif {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(20px);
    color: white;
    padding: 10px 22px;
    border-radius: 40px;
    font-size: 13px;
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    border: 1px solid rgba(79, 70, 229, 0.3);
}

.toast-notif.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.loading-spinner {
    width: 45px;
    height: 45px;
    border: 4px solid #333;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 30px auto;
}

@media (max-width: 768px) {
    .main-header { padding: 12px 16px; }
    .logo-preview { height: 40px; width: 40px; }
    .logo-text { font-size: 16px; }
    .avatar { width: 38px; height: 38px; }
    .user-info { display: none; }
    
    .hero-title { font-size: 28px; }
    .hero-overlay { padding: 80px 20px 40px; }
    
    .watch-btn, .btn-outline { padding: 10px 20px; font-size: 13px; }
    .movie-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
    
    .embed-iframe { height: 250px; }
    .back-btn { top: 75px; left: 12px; width: 36px; height: 36px; font-size: 16px; }
    
    .section-title { font-size: 18px; }
    .genre-chip { padding: 6px 14px; font-size: 12px; }
    
    .bottom-nav { padding: 8px 16px 20px; }
    .nav-item { padding: 5px 14px; }
    .nav-item i { font-size: 18px; }
}

@media (max-width: 480px) {
    .movie-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
    .hero-title { font-size: 22px; }
    .hero-desc { font-size: 12px; }
    .stat { font-size: 10px; padding: 4px 10px; }
    .badge { font-size: 10px; padding: 4px 10px; }
}