:root {
    --bg-main: #0f171e; /* Prime Video Dark Background */
    --bg-secondary: #1a242f;
    --text-main: #ffffff;
    --text-muted: #8197a4;
    --primary-color: #00a8e1; /* Prime Video Blue */
    --hover-color: #252e39;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    transition: width var(--transition-speed);
    z-index: 10;
}

.logo {
    padding: 0 20px 30px;
    display: flex;
    align-items: center;
}

.logo img {
    height: 30px;
    object-fit: contain;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-links li {
    padding: 10px 20px;
    transition: background-color var(--transition-speed);
}

.nav-links li:hover {
    background-color: var(--hover-color);
}

.nav-links li.active {
    border-left: 4px solid var(--primary-color);
    background-color: var(--hover-color);
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    transition: color var(--transition-speed);
}

.nav-links li.active a, .nav-links li:hover a {
    color: var(--text-main);
}

.nav-links li i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.divider {
    height: 1px;
    background-color: #334351;
    margin: 20px 20px;
}

.nav-header {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px 20px;
    letter-spacing: 1px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    position: sticky;
    top: 0;
    background: linear-gradient(to bottom, rgba(15, 23, 30, 0.9) 0%, rgba(15, 23, 30, 0) 100%);
    z-index: 5;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: var(--hover-color);
    border-radius: 4px;
    padding: 8px 15px;
    width: 400px;
    border: 1px solid transparent;
    transition: border-color var(--transition-speed);
}

.search-container:focus-within {
    border-color: var(--text-main);
    background-color: #2a3441;
}

.search-container i {
    color: var(--text-muted);
    margin-right: 10px;
}

.search-container input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 16px;
    width: 100%;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

/* Hero Section */
.hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    background-image: url('https://images.unsplash.com/photo-1536440136628-849c177e76a1?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 40px;
    margin-top: -80px; /* Overlap header */
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(15,23,30,1) 0%, rgba(15,23,30,0.4) 50%, rgba(15,23,30,0) 100%),
                linear-gradient(to top, rgba(15,23,30,1) 0%, rgba(15,23,30,0) 50%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 15px;
    font-weight: 700;
}

.hero-content p {
    font-size: 18px;
    color: #d1d5db;
    margin-bottom: 25px;
    line-height: 1.5;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.btn-primary {
    background-color: var(--text-main);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color var(--transition-speed), transform 0.1s;
}

.btn-primary:hover {
    background-color: #e5e5e5;
}

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

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Video Rows */
.video-row {
    padding: 20px 40px;
    z-index: 2;
}

.video-row h2 {
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #fff;
}

.row-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: none; /* Firefox */
}

.row-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.video-card {
    min-width: 280px;
    height: 157px; /* 16:9 aspect ratio */
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.video-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.video-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
    transition: background var(--transition-speed);
}

.video-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 5;
}

.video-card:hover img {
    transform: scale(1.1);
}

.video-card:hover .card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
}

.card-title {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition-speed), transform var(--transition-speed);
}

.card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    opacity: 0;
    transition: opacity var(--transition-speed), transform var(--transition-speed);
}

.card-play i {
    margin-left: 3px;
}

.video-card:hover .card-title {
    opacity: 1;
    transform: translateY(0);
}

.video-card:hover .card-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 1000px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.close-modal:hover {
    color: var(--primary-color);
}

#modal-title {
    margin-bottom: 15px;
    padding-right: 30px;
}

.iframe-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 4px;
    background-color: #000;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
