/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-dark: #1a1a2e;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-card: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #14a800 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #f093fb 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gradient-primary);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: fadeIn 0.5s ease;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

/* Session Type */
.session-type {
    text-align: center;
    margin-bottom: 20px;
}

.session-label {
    display: inline-block;
    padding: 10px 25px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.session-type.break .session-label {
    background: var(--gradient-success);
}

.session-type.long-break .session-label {
    background: var(--gradient-warning);
}

/* Timer Container */
.timer-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto 30px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease;
    stroke-linecap: round;
}

.timer-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.time {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-dark);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-bottom: 10px;
}

.session-count {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-large {
    padding: 15px 35px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-icon-only {
    padding: 12px;
    border-radius: 50%;
}

.settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-light);
    font-size: 1.5rem;
}

.settings-btn:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--bg-light);
}

.modal-header h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--bg-light);
    display: flex;
    justify-content: flex-end;
}

/* Settings Sections */
.settings-section {
    margin-bottom: 30px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 15px;
}

/* Setting Items */
.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group input[type="number"] {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--bg-light);
    border-radius: 10px;
    font-size: 1.1rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-dark);
    width: 80px;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-adjust {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-adjust:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.btn-adjust:active {
    transform: scale(0.95);
}

/* Toggle Switch */
.setting-item-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--bg-light);
}

.setting-item-toggle:last-child {
    border-bottom: none;
}

.setting-item-toggle label {
    font-weight: 600;
    color: var(--text-dark);
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--gradient-primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Info Box */
.info-box {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.info-box p {
    font-size: 0.9rem;
    color: #1e40af;
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.pulse {
    animation: pulse 1s ease-in-out infinite;
}

/* Posture Timer */
.posture-timer-container {
    margin-bottom: 30px;
}

.posture-timer {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.5s ease;
}

.posture-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.posture-icon {
    font-size: 2rem;
}

.posture-status {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}

.posture-time {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    font-variant-numeric: tabular-nums;
    margin-bottom: 15px;
}

.posture-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.posture-progress-bar {
    height: 100%;
    background: white;
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

#switchPostureBtn {
    background: white;
    color: #f5576c;
    font-weight: 600;
}

#switchPostureBtn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.posture-timer.standing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.posture-timer.standing #switchPostureBtn {
    color: #667eea;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .timer-container {
        width: 280px;
        height: 280px;
    }

    .time {
        font-size: 3rem;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
    }

    .modal-body {
        padding: 20px;
    }
}

/* Remove spinner from number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

