/* ==========================================
   Mindful Suite Common Styles
   ========================================== */

/* Local Fonts - GDPR Compliance */
@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-300.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-500.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-600.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit-300.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit-400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit-700.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

:root {
    --bg: #050508;
    --accent-r: 180;
    --accent-g: 200;
    --accent-b: 255;
    --panel: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    --text: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.45);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-head: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    /* Default for apps, overridden in index.css */
}

/* ==========================================
   Utility Typography
   ========================================== */
.font-head {
    font-family: var(--font-head);
}

.font-body {
    font-family: var(--font-main);
}

/* ==========================================
   Common Brands & Modals
   ========================================== */
#app-brand {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 8;
    font-family: var(--font-head);
    font-size: 13px;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.24);
    pointer-events: none;
    text-align: center;
}

#app-brand small {
    display: block;
    margin-top: 6px;
    font-family: var(--font-main);
    letter-spacing: 0.4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.18);
    text-transform: none;
}

/* Start Overlay */
#start-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #10101a 0%, #050508 100%);
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.2s;
}

#start-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#start-button {
    padding: 24px 48px;
    font-size: 20px;
    font-family: var(--font-head);
    font-weight: 500;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.03);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 60px;
    cursor: pointer;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#start-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
}

#info-btn {
    margin-top: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    transition: color .25s;
}

#info-btn:hover {
    color: rgba(255, 255, 255, 0.75);
}

/* Unified Overlays */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    opacity: 0;
    visibility: hidden;
    transition: all .6s cubic-bezier(.4, 0, .2, 1);
    padding: 18px;
}

.overlay.visible {
    opacity: 1;
    visibility: visible;
}

.overlay-card {
    max-width: 680px;
    width: min(680px, 100%);
    padding: 34px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    transform: translateY(20px);
    transition: transform .6s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.overlay.visible .overlay-card {
    transform: translateY(0);
}

.overlay-card-body {
    overflow-y: auto;
    padding-right: 15px;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.overlay-card-body::-webkit-scrollbar {
    width: 6px;
}

.overlay-card-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.overlay-card h2,
.overlay-card-body h1,
.overlay-card-body h2,
.overlay-card-body h3 {
    font-family: var(--font-head);
    font-weight: 300;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 14px;
}

.overlay-card h2 {
    font-size: 32px;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, .45) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.overlay-card-body h2 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    font-size: 20px;
    margin-top: 30px;
}

.overlay-card-body h3 {
    font-size: 16px;
    margin-top: 20px;
}

.overlay-card p,
.overlay-card li {
    color: rgba(255, 255, 255, .68);
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 14px;
}

.overlay-card ul {
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.overlay-close {
    align-self: center;
    margin-top: 14px;
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all .25s;
    font-family: var(--font-main);
}

.overlay-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Step List (Info modals) */
.step-list {
    text-align: left;
    margin: 22px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.step-num {
    font-family: var(--font-head);
    font-size: 22px;
    min-width: 38px;
    color: rgba(255, 255, 255, 0.22);
    font-weight: 700;
}

/* ==========================================
   End Session Overlay
   ========================================== */
#end-overlay {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(5, 5, 10, 0.85);
    backdrop-filter: blur(30px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s ease, visibility 1.2s;
    padding: 18px;
}

#end-overlay.visible {
    opacity: 1;
    visibility: visible;
}

#end-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    transform: translateY(20px);
    transition: transform 1.2s cubic-bezier(.4, 0, .2, 1);
}

#end-overlay.visible #end-content {
    transform: translateY(0);
}

#end-icon {
    font-size: 68px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

#end-content h2 {
    font-family: var(--font-head);
    font-size: 34px;
    font-weight: 300;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, .92);
}

#end-stats-text {
    color: rgba(255, 255, 255, .45);
    font-size: 14px;
    letter-spacing: .8px;
    max-width: 88vw;
    text-align: center;
}

#end-close {
    margin-top: 4px;
    padding: 14px 36px;
    font-family: var(--font-head);
    font-size: 15px;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, .92);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    cursor: pointer;
}

#end-close:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* ==========================================
   Status Pills & Streaks
   ========================================== */
#status-pill {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    pointer-events: none;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.008)),
        rgba(10, 12, 18, 0.42);
    color: rgba(255, 255, 255, 0.52);
    font-size: 12px;
    letter-spacing: .55px;
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    top: calc(23% - 50px);
    /* Adjust via JS or local CSS if needed */
}

.streak-info {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    font-family: var(--font-head);
    font-size: 13px;
    letter-spacing: .35px;
    color: rgba(255, 255, 255, 0.62);
    padding: 8px 14px;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.005)),
        linear-gradient(180deg, rgba(12, 14, 18, 0.58), rgba(8, 10, 14, 0.72));
    border: 1px solid rgba(255, 255, 255, 0.055);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.015);
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, transform .6s ease, visibility 1s ease;
    transform: translateY(2px);
}

.streak-info.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================
   Footer Links
   ========================================== */
#footer-links {
    position: fixed;
    bottom: 14px;
    right: 24px;
    z-index: 20;
    display: flex;
    gap: 16px;
    font-size: 11px;
    letter-spacing: .4px;
}

#footer-links a {
    color: rgba(255, 255, 255, 0.22);
    text-decoration: none;
    transition: color .3s;
}

#footer-links a:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive basics */
@media (max-width: 640px) {
    .overlay-card {
        padding: 22px;
        border-radius: 20px;
    }

    .overlay-card h2 {
        font-size: 24px;
    }

    #footer-links {
        left: 0;
        right: 0;
        justify-content: center;
        gap: 12px;
    }

    #status-pill {
        top: 62px;
    }
}

/* ==========================================
   Unified Floating App Controls
   ========================================== */
#controls {
    position: fixed;
    bottom: 38px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: fit-content;
    max-width: 92vw;
    padding: 12px;
    border-radius: 24px;
    background:
        radial-gradient(120% 140% at 50% -20%, rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.07), transparent 55%),
        linear-gradient(180deg, rgba(14, 16, 22, 0.72), rgba(9, 11, 16, 0.78));
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(22px) saturate(120%);
    -webkit-backdrop-filter: blur(22px) saturate(120%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s, transform .8s cubic-bezier(.4, 0, .2, 1), box-shadow .3s ease;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.025);
    overflow: hidden;
}

#controls::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 35%, rgba(255, 255, 255, 0.015));
    opacity: .9;
}

#controls::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    opacity: .45;
    pointer-events: none;
}

#controls.visible {
    opacity: 1;
    visibility: visible;
}

.controls-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.controls-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding-top: 2px;
    width: auto;
}

#controls button,
#controls select {
    padding: 10px 13px;
    font-size: 13px;
    font-family: var(--font-main);
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.83);
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
    outline: none;
}

#controls select option {
    background: #1a1a24;
    color: white;
}

#controls button:hover,
#controls select:hover {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.97);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

#controls button:active {
    transform: translateY(0);
}

#controls button.active {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.035));
    border-color: rgba(255, 255, 255, 0.13);
    color: #fff;
}

.controls-row-actions button,
.controls-row button,
.controls-row select {
    min-height: 42px;
    border-radius: 14px;
    flex: 0 0 auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.008));
    border-color: rgba(255, 255, 255, 0.05);
}

/* Primary actions */
#session-start,
#startBtn {
    background:
        linear-gradient(180deg, rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.15), rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.07)),
        rgba(255, 255, 255, 0.03);
    border-color: rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.24);
    color: rgba(255, 255, 255, 0.98);
    font-weight: 600;
    min-width: 150px;
}

#pauseBtn,
#stopBtn {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012));
    border-color: rgba(255, 255, 255, 0.07);
    min-width: 100px;
}

#resetBtn,
#fullscreenBtn {
    color: rgba(255, 255, 255, 0.7);
}

/* ==========================================
   Theme Selector (Top Left)
   ========================================== */
#theme-selector {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 10;
    display: flex;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 1s ease;
}

#theme-selector.visible {
    opacity: 1;
    visibility: visible;
}

#themeSelect {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 20px;
    font-family: var(--font-main);
    font-size: 13px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

#themeSelect:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.theme-label {
    display: none;
    /* sheeps.css had it floating inside, let's keep it simple or hide it */
}

/* Controls Responsive */
@media (max-width: 768px) {
    #controls {
        width: 90%;
        gap: 10px;
        padding: 10px;
        bottom: 30px;
    }

    #controls button,
    #controls select {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    #theme-selector {
        top: 15px;
        left: 15px;
    }

    #controls {
        width: 100%;
        border-radius: 20px 20px 0 0;
        bottom: 0px;
        padding: 10px;
    }

    .controls-row-actions button {
        padding: 10px;
        font-size: 12px;
    }
}