body {
    margin: 0;
    padding: 0;
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}

.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    padding: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header h1 {
    margin: 0;
    font-size: 2.5em;
    color: #fff;
    text-shadow: 
        2px 2px 4px rgba(255, 165, 0, 0.3), /* Light orange shadow */
        0 0 10px rgba(255, 255, 255, 0.5), /* Light white glow */
        0 0 20px rgba(255, 140, 0, 0.4), /* Deeper orange glow */
        0 0 30px rgba(255, 69, 0, 0.2); /* Dark orange metallic effect */
    background: linear-gradient(45deg, #8B4513, #FF4500, #FFA500, #D2691E); /* Metallic dark orange gradient */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    font-weight: bold;
    letter-spacing: 2px;
}

.header h1::before {
    content: 'BASTIFLIX';
    position: absolute;
    top: 2px;
    left: 2px;
    color: rgba(255, 255, 255, 0.1);
    text-shadow: 
        1px 1px 2px rgba(255, 165, 0, 0.2),
        0 0 5px rgba(255, 255, 255, 0.3);
    z-index: -1;
}

.header h1::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 69, 0, 0.1), transparent);
    pointer-events: none;
    border-radius: 5px;
}

.search-container {
    background: linear-gradient(45deg, #1a1a1a, #000000, #1a1a1a);
    border: 2px solid #8b4513; /* Dark orange */
    border-radius: 10px;
    padding: 5px 10px;
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.5);
    margin-top: 10px;
}

.search-container input {
    background: transparent;
    border: none;
    color: #ff4500; /* Dark orange text */
    font-size: 16px;
    outline: none;
    width: 200px;
}

.search-container input::placeholder {
    color: #ff4500;
    opacity: 0.7;
}

.main-content {
    padding-top: 120px; /* Adjusted for header height */
}

.row {
    margin-bottom: 40px;
    padding: 0 20px;
}

.row-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #ff4500; /* Dark orange */
}

.row-content {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 10px;
    padding-bottom: 10px;
}

.poster {
    flex-shrink: 0;
    width: 200px;
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    outline: none; /* Remove default outline */
}

.poster:focus {
    transform: scale(1.05);
    box-shadow: 0 0 20px #ff4500; /* Dark orange focus */
}

.poster:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255,69,0,0.5);
}

.poster:hover .play-overlay,
.poster:focus .play-overlay {
    opacity: 1;
}

.poster:hover .title-overlay,
.poster:focus .title-overlay {
    opacity: 1;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.play-overlay::before {
    content: '▶';
    font-size: 24px;
    color: #ff4500; /* Dark orange */
}

.title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    text-align: center;
    font-size: 14px;
}

.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.modal-content {
    width: 90%;
    max-width: 1200px;
    display: flex;
    gap: 20px;
}

.video-player {
    flex: 1;
}

.video-info {
    flex-shrink: 0;
    width: 300px;
    text-align: center;
}

.video-info img {
    width: 100%;
    border-radius: 10px;
}

.custom-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: linear-gradient(45deg, #1a1a1a, #000000, #1a1a1a);
    border: 2px solid #8b4513; /* Dark orange border */
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(139, 69, 19, 0.5);
    margin-top: 10px;
}

.custom-controls button {
    background: linear-gradient(45deg, #2a2a2a, #000000, #2a2a2a);
    border: 1px solid #ff4500; /* Dark orange border */
    color: white; /* White text */
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
}

.custom-controls button:hover {
    background: linear-gradient(45deg, #3a3a3a, #1a1a1a, #3a3a3a);
    border-color: #ff6600; /* Lighter orange on hover */
    color: white; /* Keep white on hover for consistency */
    box-shadow: 0 4px 10px rgba(139, 69, 19, 0.7);
    transform: translateY(-2px);
}

.custom-controls button:focus {
    outline: none;
    border-color: #ff6600;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.8);
    color: white; /* Keep white on focus */
}

.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 5;
    outline: none;
}

.scroll-button:focus {
    background: #ff4500;
}

.scroll-left {
    left: 0;
}

.scroll-right {
    right: 0;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(45deg, #FF4500, #FFA500, #FF6347);
    padding: 15px;
    text-align: center;
    box-shadow: 0 -4px 8px rgba(255, 69, 0, 0.5);
    border-top: 2px solid #FFD700;
    z-index: 1000;
}

.footer a {
    color: #fff;
    text-decoration: none;
    margin: 0 20px;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.footer a:hover {
    color: #FFD700;
    transform: scale(1.1);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.footer a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    transition: width 0.3s ease;
}

.footer a:hover::after {
    width: 100%;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.loading-circle {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top: 4px solid #ff4500;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Selection styling: Makes selected text white with a dark background */
::selection {
    color: white;
    background: #333; /* Dark gray background for contrast; adjust as needed */
}

/* Optional: Scoped to just custom-controls if you want it limited */
.custom-controls ::selection {
    color: white;
    background: #000; /* Black background for stronger contrast */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .header {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2em;
        letter-spacing: 1px;
    }
    
    .search-container input {
        width: 150px;
        font-size: 14px;
    }
    
    .main-content {
        padding-top: 100px;
    }
    
    .row {
        padding: 0 10px;
        margin-bottom: 20px;
    }
    
    .row-title {
        font-size: 1.2em;
    }
    
    .poster {
        width: 150px;
        height: 225px;
    }
    
    .play-overlay {
        width: 40px;
        height: 40px;
    }
    
    .play-overlay::before {
        font-size: 18px;
    }
    
    .title-overlay {
        font-size: 12px;
        padding: 5px;
    }
    
    .modal-content {
        flex-direction: column;
        width: 95%;
        gap: 10px;
    }
    
    .video-info {
        width: 100%;
        order: -1; /* Move info above video on mobile */
    }
    
    .custom-controls {
        flex-wrap: wrap;
        gap: 5px;
        padding: 5px;
    }
    
    .custom-controls button {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .scroll-button {
        padding: 5px;
        font-size: 12px;
    }
    
    .footer {
        padding: 10px;
        position: static; /* Remove fixed on mobile to avoid overlap */
        margin-top: 20px;
    }
    
    .footer a {
        margin: 0 10px;
        font-size: 1em;
        display: inline-block;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }
    
    .search-container input {
        width: 120px;
        font-size: 12px;
    }
    
    .poster {
        width: 120px;
        height: 180px;
    }
    
    .row-title {
        font-size: 1em;
    }
    
    .footer a {
        margin: 0 5px;
        font-size: 0.9em;
    }
}
