:root {
    --bg-color: #000000;
    --text-primary: #f9fafb;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent: #9061F9;
    --accent-hover: #8048FF;
    --btn-icon-bg: #ffffff;
    --btn-icon-hover: #f3f4f6;
    --btn-icon-color: #111827;
}

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

html {
    height: 100%;
    /* Safari specific fix */
    height: -webkit-fill-available;
}

body {
    font-family: 'Bricolage Grotesque', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-color);
    /* The background image is set via JS */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    min-height: 100dvh;
    /* Safari specific fix */
    min-height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    /* Apply a slight dimming to background if needed */
}

/* Background overlay to ensure text readability */
body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.20);
    z-index: -1;
    pointer-events: none;
}

#background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.app-root {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Logo */
.logo {
    position: absolute;
    top: 29px;
    left: 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: #f9fafb;
}

.logo h1 {
    font-size: 45.25px;
    font-weight: 800;
    line-height: 1;
}

.logo p {
    font-size: 10.86px;
    font-weight: 400;
    width: 100%;
    text-align: right;
    margin-top: -2px;
}

/* Spotify Embed */
.spotify-embed {
    position: absolute;
    bottom: 29px;
    left: 32px;
    width: 400px;
    z-index: 5;
}

/* Timer Layout */
.timer-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 673px;
    z-index: 10;
}

.hero-title {
    font-size: 24px;
    font-weight: 600;
    color: white;
    margin-bottom: 20px;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.mode-btn {
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    color: #f9fafb;
    background: transparent;
    border: 3px solid white;
    border-radius: 9999px;
    padding: 8px 32px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mode-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fcf2f8;
    /* Very light pink text */
}

/* Timer Display */
.timer-display {
    font-size: 150px;
    font-weight: 600;
    color: #f9fafb;
    line-height: 1;
    margin: 10px 0;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Action Controls */
.action-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-btn {
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: none;
}

.action-btn.primary {
    background: var(--accent);
    border: 3px solid var(--accent);
    color: #fdf2f8;
    font-size: 24px;
    font-weight: 700;
    border-radius: 9999px;
    padding: 8px 32px;
}

.action-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.action-btn.primary:active {
    transform: translateY(1px);
}

.action-btn.secondary.icon {
    background: var(--btn-icon-bg);
    border: 3px solid var(--btn-icon-bg);
    color: var(--btn-icon-color);
    border-radius: 16px;
    padding: 8px 12px;
    height: 55px;
    /* Adjusting to match start button height approximately */
    width: 60px;
}

.action-btn.secondary.icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--btn-icon-color);
}

.action-btn.secondary.icon:hover {
    background: var(--btn-icon-hover);
    border-color: var(--btn-icon-hover);
    transform: translateY(-2px);
}

.action-btn.secondary.icon:active {
    transform: translateY(1px);
}

/* Ko-fi Widget Custom Positioning */
.kofi-embed {
    bottom: 29px !important;
    right: 32px !important;
    left: auto !important;
    position: fixed !important;
    z-index: 5 !important;
}

/* Picture-in-Picture mode overrides */
.in-pip .logo,
.in-pip .hero-title,
.in-pip .mode-selector,
.in-pip #expandBtn,
.in-pip #pipBtn,
.in-pip .spotify-embed,
.in-pip .kofi-embed {
    display: none !important;
}

.in-pip .timer-display {
    font-size: 80px;
    margin-bottom: 20px;
}

/* Media Query for mobile smaller screens */
@media (max-width: 768px) {
    .timer-display {
        font-size: 100px;
    }

    .logo {
        top: 15px;
        left: 20px;
    }

    .logo h1 {
        font-size: 32px;
    }

    .logo p {
        font-size: 8px;
    }

    .spotify-embed {
        bottom: 15px;
        left: 20px;
        width: 250px;
    }

    .kofi-embed {
        bottom: 15px !important;
        right: 20px !important;
        left: auto !important;
    }

    #expandBtn,
    #pipBtn {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .mode-selector {
        flex-direction: column;
        width: 100%;
        padding: 0 20px;
    }

    .mode-selector button {
        width: 100%;
    }

    .timer-display {
        font-size: 80px;
    }

    .spotify-embed {
        display: none;
        /* Hide on very small screens to avoid overlap */
    }
}