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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #8b4513 0%, #ff7b00 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: white;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.timer-section {
    flex: 0 0 auto;
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.timer-display {
    font-size: 35vw;
    font-weight: bold;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1;
    width: calc(100vw - 2rem);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .timer-display {
        font-size: 30vw;
        width: calc(100vw - 2rem);
    }
}

@media (max-width: 480px) {
    .timer-display {
        font-size: 25vw;
        width: calc(100vw - 2rem);
    }
}

.controls {
    max-width: 800px;
    margin: 0 auto;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease;
    opacity: 1;
}

.controls.collapsed {
    max-height: 0;
    opacity: 0;
}

.preset-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 1rem 2rem;
    background: #ff7b00;
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.preset-btn:hover {
    background: #e66a00;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.preset-btn.active {
    background: #8b4513;
    transform: scale(1.05);
}

.custom-time {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.custom-time input {
    padding: 0.8rem;
    border: 2px solid #ff7b00;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    text-align: center;
    width: 80px;
}

.custom-time input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#set-custom {
    padding: 0.8rem 1.5rem;
    background: #8b4513;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#set-custom:hover {
    background: #6d3410;
    transform: translateY(-1px);
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease;
    opacity: 1;
}

.timer-controls.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.timer-controls button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#start-btn {
    background: #28a745;
    color: white;
}

#start-btn:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

#pause-btn {
    background: #ffc107;
    color: #333;
}

#pause-btn:hover:not(:disabled) {
    background: #e0a800;
    transform: translateY(-2px);
}

#reset-btn {
    background: #dc3545;
    color: white;
}

#reset-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.content {
    flex: 1;
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.youtube-section {
    max-width: 800px;
    width: 100%;
}

.youtube-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

#youtube-url {
    flex: 1;
    padding: 1rem;
    border: 2px solid #ff7b00;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    min-width: 300px;
}

#youtube-url::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#load-playlist {
    padding: 1rem 2rem;
    background: #ff7b00;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#load-playlist:hover {
    background: #e66a00;
    transform: translateY(-1px);
}

#youtube-player {
    width: 100%;
    height: 450px;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
}

#youtube-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.footer p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    transform: scale(1.2);
    opacity: 0.7;
}

.footer a {
    color: #ff7b00;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #ffaa44;
    text-decoration: underline;
}

.timer-finished {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.timer-warning {
    animation: blink 1s infinite;
    color: #ff4444 !important;
}

.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ff7b00;
    color: white;
    padding: 2rem 3rem;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@media (max-width: 768px) {
    .timer-section {
        padding: 1rem;
    }
    
    .preset-buttons {
        gap: 0.5rem;
    }
    
    .preset-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .custom-time {
        gap: 0.5rem;
    }
    
    .timer-controls {
        gap: 0.5rem;
    }
    
    .timer-controls button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .youtube-controls {
        flex-direction: column;
    }
    
    #youtube-url {
        min-width: auto;
    }
    
    #youtube-player {
        height: 250px;
    }
}