:root {
    --bg-primary: #E6E9EF;
    --bg-secondary: #15244b;
    --accent-primary: #4A90E2;
    --accent-secondary: #BDC3C7;
    --text-primary: #2C3E50;
    --text-secondary: #BDC3C7;
    --text-light: #E6E9EF;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #D4D8DF 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px 10px;
}

.pomodoro-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

/* Header */
h1 {
    color: var(--bg-secondary);
    font-weight: 700;
    font-size: 2rem;
}

.lead {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Logo */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-icon {
    font-size: 4rem;
    color: var(--accent-primary);
    animation: rotateClock 20s linear infinite;
    filter: drop-shadow(0 4px 8px rgba(74, 144, 226, 0.3));
}

@keyframes rotateClock {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Status Card */
.status-card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(44, 62, 80, 0.1);
    position: relative;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--bg-secondary);
    font-weight: 600;
}

.status-indicator i {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

#statusText {
    font-size: 1rem;
}

/* Arrow Down */
.arrow-down {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    cursor: pointer;
    color: var(--accent-primary);
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}

.arrow-down:hover {
    transform: translateY(3px);
    color: var(--bg-secondary);
}

.arrow-down i {
    font-size: 1.2rem;
}

.arrow-down.hidden {
    display: none;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(5px);
    }
}

/* Timer Card */
.timer-card {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.timer-circle {
    position: relative;
    width: 280px;
    height: 280px;
}

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

.progress-ring-circle {
    transition: stroke-dashoffset 0.3s ease;
}

.progress {
    stroke-dasharray: 816.814;
    stroke-dashoffset: 816.814;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s linear;
}

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

.timer-display {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--bg-secondary);
    line-height: 1;
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}

.timer-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Controls */
.controls-card {
    padding: 0 10px;
}

.btn-group-custom {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-action {
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

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

.btn-primary:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

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

.btn-secondary:hover {
    background: #a8b1b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(189, 195, 199, 0.3);
}

.btn-outline {
    background: white;
    color: var(--bg-secondary);
    border: 2px solid var(--accent-secondary);
}

.btn-outline:hover {
    background: var(--bg-primary);
    border-color: var(--bg-secondary);
    transform: translateY(-2px);
}

/* Counter Card */
.counter-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(44, 62, 80, 0.1);
}

.counter-item {
    padding: 10px;
}

.counter-icon {
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 10px;
}

.counter-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--bg-secondary);
    line-height: 1;
    margin-bottom: 5px;
}

.counter-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Instructions Accordion */
.instructions-accordion {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(44, 62, 80, 0.1);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out;
    padding: 0 20px;
}

.instructions-accordion.expanded {
    max-height: 1000px;
    padding: 20px;
    transition: max-height 0.5s ease-in, padding 0.5s ease-in;
}

.instructions-content {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.instructions-accordion.expanded .instructions-content {
    opacity: 1;
    transition: opacity 0.5s ease-in 0.2s;
}

.instructions-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--bg-secondary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions-title i {
    color: var(--accent-primary);
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-number {
    background: var(--accent-primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    color: var(--bg-secondary);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.step-content p {
    color: var(--bg-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.step-content strong {
    color: var(--bg-secondary);
    font-weight: 700;
}

/* Settings Card */
.settings-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(44, 62, 80, 0.1);
}

.settings-header {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--bg-secondary);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.settings-card.expanded .settings-header {
    margin-bottom: 15px;
}

.settings-header:hover {
    opacity: 0.8;
}

.settings-header i {
    color: var(--accent-primary);
}

.settings-arrow {
    color: var(--accent-primary);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-arrow i {
    font-size: 1rem;
}

.settings-card:not(.expanded) .settings-arrow {
    transform: rotate(0deg);
}

.settings-card.expanded .settings-arrow {
    transform: rotate(180deg);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.3s ease-out, margin 0.5s ease-out;
    opacity: 1;
    margin-bottom: 0;
}

.settings-card.collapsed .settings-content {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in, margin 0.5s ease-in;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-weight: 600;
    color: var(--bg-secondary);
    font-size: 0.9rem;
}

.setting-item .form-control {
    border: 2px solid var(--accent-secondary);
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 1rem;
    color: var(--bg-secondary);
    transition: border-color 0.3s ease;
}

.setting-item .form-control:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.setting-item small {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
}

/* Preferences Group */
.preferences-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.preference-item {
    display: flex;
    align-items: center;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.switch-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.switch-label span {
    user-select: none;
}

/* Progress Card */
.progress-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(44, 62, 80, 0.1);
}

.progress-header {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--bg-secondary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-header i {
    color: var(--accent-primary);
}

.progress-content {
    padding: 10px 0;
}

.daily-progress-text {
    font-size: 1rem;
    color: var(--bg-secondary);
    font-weight: 500;
    line-height: 1.6;
}

/* Dark Theme */
body.dark-theme {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --accent-primary: #4A90E2;
    --accent-secondary: #4a5568;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-light: #f7fafc;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-theme .status-card,
body.dark-theme .counter-card,
body.dark-theme .settings-card,
body.dark-theme .progress-card,
body.dark-theme .instructions-accordion {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body.dark-theme .setting-item label,
body.dark-theme .progress-header,
body.dark-theme .instructions-title,
body.dark-theme .step-content h4,
body.dark-theme .step-content p {
    color: var(--text-primary);
}

body.dark-theme .form-control {
    background: #1a1a2e;
    border-color: var(--accent-secondary);
    color: var(--text-primary);
}

body.dark-theme .form-control:focus {
    background: #1a1a2e;
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

body.dark-theme .switch-label {
    color: var(--text-primary);
}

body.dark-theme .settings-header {
    color: var(--text-primary);
}

/* Corrigir cores de texto que usam --bg-secondary no tema escuro */
body.dark-theme h1,
body.dark-theme .status-indicator,
body.dark-theme .timer-display,
body.dark-theme .timer-label,
body.dark-theme .counter-value,
body.dark-theme .counter-label,
body.dark-theme .settings-header,
body.dark-theme .setting-item label,
body.dark-theme .progress-header,
body.dark-theme .daily-progress-text {
    color: var(--text-primary);
}

body.dark-theme .arrow-down:hover {
    color: var(--accent-primary);
}

body.dark-theme .step-content strong {
    color: var(--text-primary);
}

/* Corrigir textos com Bootstrap text-muted no tema escuro */
body.dark-theme .text-muted,
body.dark-theme .lead.text-muted,
body.dark-theme small.text-muted {
    color: var(--text-secondary) !important;
}

body.dark-theme .lead {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 480px) {
    .timer-circle {
        width: 240px;
        height: 240px;
    }

    .progress-ring {
        width: 240px;
        height: 240px;
    }

    .progress-ring-circle {
        r: 110;
        cx: 120;
        cy: 120;
    }

    .progress {
        stroke-dasharray: 691.15;
        stroke-dashoffset: 691.15;
    }

    .timer-display {
        font-size: 3rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .logo-icon {
        font-size: 3rem;
    }

    .btn-action {
        min-width: 100px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .instructions-title {
        font-size: 1.1rem;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .step-content h4 {
        font-size: 1rem;
    }

    .step-content p {
        font-size: 0.9rem;
    }
}

/* Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.timer-active .timer-display {
    animation: pulse 2s ease-in-out infinite;
}

/* Status colors */
.status-working {
    color: var(--accent-primary);
}

.status-break {
    color: #27AE60;
}

.status-paused {
    color: var(--text-secondary);
}

