/* General Body Styles */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
}

/* Header and Navigation */
header {
    background-color: #1c1c1c;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ff5722;
    gap: 1.5rem; /* Add gap for spacing */
}

header .logo {
    font-size: 2rem;
    font-weight: bold;
    color: #ff5722;
    text-decoration: none;
    white-space: nowrap; /* Prevents logo text from wrapping */
}

header .search-form {
    display: flex;
    width: 100%; /* Allow it to grow */
    max-width: 400px; /* But not get too large on desktop */
}

header input[type="search"] {
    padding: 0.5rem;
    border: 1px solid #333;
    border-radius: 5px 0 0 5px;
    background-color: #222;
    color: #fff;
    width: 100%; /* Take up available space in the form */
    box-sizing: border-box; /* Include padding in the width calculation */
}

header button {
    padding: 0.5rem 1rem;
    border: none;
    background-color: #ff5722;
    color: #fff;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
}

/* Telegram Header Button */
.telegram-button {
    background-color: #0088cc;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap; /* Prevents text from wrapping */
    transition: background-color 0.2s;
}
.telegram-button:hover {
    background-color: #0099e0;
}
.telegram-button::before {
    content: '✈️'; 
    margin-right: 8px;
}

/* Main Content Wrapper */
.container {
    padding: 2rem;
}

h1, h2 {
    color: #fff;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

/* Movie Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.movie-card {
    background-color: #1c1c1c;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: #e0e0e0;
    transition: transform 0.2s ease-in-out;
}

.movie-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 87, 34, 0.5);
}

.movie-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.movie-card .title {
    padding: 1rem;
    font-weight: bold;
    text-align: center;
}

/* Watch Page (Video Player) */
.watch-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.video-player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.video-player iframe, .video-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.movie-details h1 {
    margin-top: 0;
}

.movie-details p {
    line-height: 1.6;
    color: #b0b0b0;
}

.movie-info {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}
.info-item {
    background-color: #1c1c1c;
    padding: 1rem;
    border-radius: 8px;
    flex-grow: 1; /* Allow items to grow and fill space */
}
.info-item h3 {
    margin-top: 0;
    color: #ff5722;
    font-size: 1rem;
}

/* ======================================== */
/* ==   MOBILE RESPONSIVE STYLES BELOW   == */
/* ======================================== */

/* For all screens smaller than 768px */
@media (max-width: 768px) {
    header {
        flex-direction: column; /* Stack logo, search, and button vertically */
        align-items: stretch;   /* Make all items stretch to full width */
        gap: 1rem;
        padding: 1rem;
    }

    header .search-form {
        max-width: 100%; /* Search bar takes full width */
    }

    .telegram-button {
        width: 100%;
        text-align: center;
        box-sizing: border-box; /* Include padding in width */
    }
    
    .container, .watch-container {
        padding: 1rem; /* Reduce padding on small screens */
    }

    h1 {
        font-size: 1.5rem; /* Make main headings smaller */
    }
    
    /* Make movie grid have 2 columns on mobile */
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .movie-card img {
        height: 225px; /* Adjust poster height for smaller cards */
    }
    
    .movie-card .title {
        font-size: 0.9rem; /* Smaller font for movie titles */
        padding: 0.75rem;
    }

    .movie-info {
        flex-direction: column; /* Stack info items vertically */
    }
}