/* Project: Movie Explorer
   Developed by: Eng. Khalil
*/

:root {
    --primary-color: #ffffff;
    --secondary-color: #f1c40f;
    --bg-dark: #111111;
    --overlay-color: rgba(0, 0, 0, 0.75);
    --font-main: 'Poppins', sans-serif;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--primary-color);
    background-color: var(--bg-dark);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Image Updates */
.background-poster {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -2;
    transition: background-image var(--transition-speed) ease-in-out;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,1) 10%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.8) 100%);
    z-index: -1;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header & Search */
header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    font-weight: 300;
    opacity: 0.8;
}

#search-input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 25px;
    border: none;
    outline: none;
    font-family: var(--font-main);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* UI States */
.ui-state {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Movie Details */
.movie-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease-in-out;
}

.movie-title {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.7);
    font-size: 0.8rem;
    padding: 5px;
    text-align: center;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.movie-meta span {
    background: rgba(255,255,255,0.1);
    padding: 5px 10px;
    border-radius: 5px;
}

#movie-rating {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Carousel Section */
.carousel-section {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.carousel-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 50%;
    z-index: 10;
    transition: var(--transition-speed);
}

.carousel-btn:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
}

.movies-list {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 15px;
    padding: 20px 10px;
    flex-grow: 1;
    /* إخفاء شريط التمرير الافتراضي */
    scrollbar-width: none; 
}
.movies-list::-webkit-scrollbar {
    display: none;
}

.movie-card {
    min-width: 150px;
    height: 225px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: var(--transition-speed);
    border: 2px solid transparent;
}

.movie-card:hover {
    transform: scale(1.1);
    z-index: 5;
    border-color: var(--primary-color);
}

.movie-card.active {
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

/* التجاوب - Responsive Design */
@media (min-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    #search-input {
        width: 300px;
    }
    #movie-title {
        font-size: 3.5rem;
    }
    .movie-card {
        min-width: 160px;
        height: 240px;
    }
}

@media (min-width: 1024px) {
    .movie-card {
        min-width: 180px;
        height: 270px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}