:root {
    --bg-gradient-start: hsl(0, 0%, 96%);
    --bg-gradient-end: hsl(0, 0%, 90%);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.05);
    --primary-red: hsl(348, 100%, 55%);
    --primary-red-hover: hsl(348, 100%, 45%);
    --text-main: hsl(0, 0%, 15%);
    --text-muted: hsl(220, 10%, 40%);
    --btn-secondary: rgba(0, 0, 0, 0.05);
    --btn-secondary-hover: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(0, 0, 0, 0.03);
    --input-bg-focus: rgba(0, 0, 0, 0.08);
}

body.dark-theme {
    --bg-gradient-start: hsl(220, 20%, 8%);
    --bg-gradient-end: hsl(220, 15%, 12%);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary-red: hsl(348, 100%, 61%);
    --primary-red-hover: hsl(348, 100%, 55%);
    --text-main: hsl(0, 0%, 98%);
    --text-muted: hsl(220, 10%, 60%);
    --btn-secondary: rgba(255, 255, 255, 0.1);
    --btn-secondary-hover: rgba(255, 255, 255, 0.15);
    --input-bg: rgba(0, 0, 0, 0.2);
    --input-bg-focus: rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow: auto; /* Re-enabled scrolling */
}

.app-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.content-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap-reverse;
    gap: 40px;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.controls-container {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.timer-display-wrapper {
    flex: 2;
    width: 100%;
    min-width: 300px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

#fullscreen-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.is-fullscreen #fullscreen-wrapper {
    background: var(--bg-gradient-start);
    width: 100%;
    height: 100%;
}

#fullscreen-wrapper::backdrop {
    background: var(--bg-gradient-start);
}

#btn-exit-fullscreen {
    display: none;
}

body.is-fullscreen #btn-exit-fullscreen {
    display: block !important;
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body.is-fullscreen header,
body.is-fullscreen .controls-container,
body.is-fullscreen #time-display {
    display: none !important;
}

#timer-canvas {
    width: 100%;
    max-width: 100%;
    max-height: 75vh;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    filter: drop-shadow(0 0 20px rgba(255, 59, 92, 0.15));
}

body.is-fullscreen #timer-canvas {
    width: min(90vw, 90vh) !important;
    height: min(90vw, 90vh) !important;
    max-width: none;
    max-height: none;
}


.time-text {
    font-size: 48px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    z-index: 10;
    pointer-events: none;
    text-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: var(--text-main);
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    width: 100%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.inputs-group {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.input-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.input-col label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.input-col input {
    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 24px;
    font-family: inherit;
    font-weight: 600;
    text-align: center;
    width: 80%;
    padding: 12px 0;
    transition: all 0.2s ease;
    outline: none;
}

.input-col input:focus {
    border-color: var(--primary-red);
    background: var(--input-bg-focus);
}

.button-group {
    display: flex;
    gap: 12px;
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn:active {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn.primary {
    background: var(--primary-red);
    color: white;
    flex: 2;
    box-shadow: 0 8px 24px rgba(255, 59, 92, 0.25);
}

.btn.primary:hover:not(:disabled) {
    background: var(--primary-red-hover);
    box-shadow: 0 8px 32px rgba(255, 59, 92, 0.4);
}

.btn.secondary {
    background: var(--btn-secondary);
    color: white;
    flex: 1;
}

.btn.secondary:hover:not(:disabled) {
    background: var(--btn-secondary-hover);
}

.btn.outline {
    background: transparent;
    border: 1px solid var(--btn-secondary-hover);
    color: var(--text-main);
    flex: 0 0 52px;
}

.btn.outline:hover {
    background: var(--btn-secondary);
}

/* Custom Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

body.dark-theme [data-tooltip]::after {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    box-shadow: 0 4px 6px rgba(255,255,255,0.1);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

