/* Font Definitions */
@font-face {
    font-family: 'Sanchez';
    src: url('../fonts/Sanchez.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Base Styles */
:root {
    --primary-color: #B12A2A;
    --text-color: #FFFFFF;
    --background-color: #000000;
    --overlay-color: rgba(0, 0, 0, 0.3);
    --transition-speed: 0.3s;
    --font-family: 'Sanchez', serif;
}

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

body {
    font-family: var(--font-family);
    color: var(--text-color);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    user-select: none;
    transition: opacity 1s ease;
}

.fade-out {
    opacity: 0 !important;
}

/* Background Styles */
#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#background-video, #background-image, #youtube-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

/* Ensure video and image are always fullscreen without borders */
#background-video, #background-image {
    object-fit: cover; /* Cover the entire container */
    min-width: 100%;
    min-height: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the media */
}

#youtube-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#youtube-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: transparent;
    pointer-events: none;
}

#youtube-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10;
    pointer-events: none;
}

#youtube-container iframe {
    width: 100%;
    height: 100%;
    pointer-events: none;
}


#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-color);
    z-index: 9999;
}

/* Content Styles */
#content-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

#logo-container {
    margin-bottom: 40px;
    text-align: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#logo {
    max-width: 300px;
    height: 100%;
}

#welcome-container {
    text-align: center;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#welcome-text {
    font-size: 2.0rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 900;
    text-transform: uppercase;
}

/* Tips container in the bottom left corner */
#tips-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    text-align: left;
    z-index: 5;
    max-width: 800px;
    width: 60%;
}

#tip-text {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0 auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: 0.02em;
}

/* Loading Bars and Status */
#loading-container {
    width: 100%;
    max-width: 600px;
    margin-top: 40px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#progress-container {
    width: 100%;
    margin-bottom: 15px;
}

#progress-bar-container {
    width: 100%;
    height: 10px;
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

#progress-bar-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
}

#progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Status display */
#loading-status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

#loading-text {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

#loading-status {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}



#loading-action {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Completion message */
#finishing-container {
    opacity: 0;
    transition: opacity 0.5s ease;
}

#finishing-message {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 600;
}

#finished-line {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Music Control Styles */
#music-control-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 300px;
    height: 70px;
    display: flex;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

#music-toggle {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: all var(--transition-speed) ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    position: absolute;
    bottom: 10px;
}

#music-toggle:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Hover effect for the entire container element */
#music-control-container:hover #music-toggle {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#music-control-container:hover #music-controls,
#music-control-container:focus-within #music-controls {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#music-controls {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    width: 300px;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    backdrop-filter: blur(5px);
    position: absolute;
    bottom: 10px;
}

#music-info {
    margin-bottom: 10px;
    text-align: center;
}

#music-title {
    font-size: 1rem;
    opacity: 0.9;
}

#music-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
}

#music-buttons button {
    background-color: transparent;
    color: var(--text-color);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-speed) ease;
}

#music-buttons button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#music-play-pause {
    background-color: var(--primary-color) !important;
    width: 45px !important;
    height: 45px !important;
}

#volume-container {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

#volume-icon {
    margin-right: 10px;
    font-size: 1rem;
}

#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

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

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

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

#logo-container, #welcome-container, #loading-container {
    animation: slideUp 1s ease forwards;
}

#tips-container {
    animation: slideIn 1s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
    animation-fill-mode: forwards;
}

#logo-container {
    animation-delay: 0.2s;
    height: 15vh;
}

#welcome-container {
    animation-delay: 0.4s;
}

#loading-container {
    animation-delay: 0.6s;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #logo {
        max-width: 200px;
    }
    
    #welcome-text {
        font-size: 2rem;
    }
    
    #tip-text {
        font-size: 1rem;
    }
    
    #music-controls {
        width: 300px;
    }
}
