* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

.screen {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: none;
}

.screen.active {
    display: block !important;
}

/* Main Screen Styles */
#mainScreen {
    display: flex;
    flex-direction: column;
}

#mainScreen.active {
    display: flex !important;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #2a2a2a;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 2.5rem;
    color: #ff6b6b;
}

h1 {
    font-size: 2rem;
    margin: 0;
}

.subtitle {
    font-size: 0.9rem;
    color: #888;
    margin-left: -10px;
}

.help-icon {
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    transition: color 0.3s;
}

.help-icon:hover {
    color: #ff6b6b;
}

.form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

form {
    background: #2a2a2a;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 500px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #ddd;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px;
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #ff6b6b;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}

.play-button {
    width: 100%;
    padding: 15px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.play-button:hover {
    background: #ff5252;
}

/* Player Screen Styles */
#playerScreen {
    display: none;
}

#playerScreen.active {
    display: block !important;
}

.player-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#youtubePlayer {
    width: 100%;
    height: 100%;
}

.overlay-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2.5rem;
    color: #ff6b6b;
    cursor: pointer;
    background: rgba(0,0,0,0.7);
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s;
    z-index: 1000;
}

.overlay-logo:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

/* Sleep Timer Overlay */
.sleep-timer-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    padding: 12px 20px;
    border-radius: 10px;
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 500;
}

.sleep-timer-overlay.active {
    display: flex;
}

.sleep-timer-overlay i {
    color: #ff6b6b;
}

#sleepTimerDisplay {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.sleep-timer-overlay.warning {
    background: rgba(255, 107, 107, 0.3);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background-color: #2a2a2a;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #444;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #ff6b6b;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #ff6b6b;
}

.modal-content p {
    margin: 10px 0;
}

.modal-content a {
    color: #ff6b6b;
    text-decoration: none;
}

.modal-content a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    header {
        padding: 15px;
    }

    .logo-title {
        gap: 10px;
    }

    .logo {
        font-size: 2rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        display: none;
    }

    form {
        padding: 30px 20px;
    }

    .sleep-timer-overlay {
        top: 80px;
        right: 15px;
        font-size: 1rem;
        padding: 10px 15px;
    }

    #sleepTimerDisplay {
        font-size: 1.1rem;
    }
}
