/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #a29bfe;
    --success: #00b894;
    --danger: #ff7675;
    --warning: #fdcb6e;
    --break-color: #55efc4;
    --dark: #1a1a2e;
    --dark-lighter: #252540;
    --dark-card: rgba(30, 30, 50, 0.95);
    --text-light: #e0e7ff;
    --text-dim: #c7d2fe;
    --border: rgba(102, 126, 234, 0.3);
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding-bottom: 2rem;
    transition: background 0.3s ease, color 0.3s ease;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Navegação */
nav {
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDownNav 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideDownNav {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    60% {
        transform: translateY(10px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1.5rem 2rem;
    gap: 1.2rem;
    max-width: 1200px;
    margin: 0 auto;
}

nav li {
    animation: fadeInScale 0.5s ease-out backwards;
    animation-delay: calc(var(--nav-order) * 0.1s);
}

nav li:nth-child(1) { --nav-order: 1; }
nav li:nth-child(2) { --nav-order: 2; }
nav li:nth-child(3) { --nav-order: 3; }
nav li:nth-child(4) { --nav-order: 4; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

nav a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.9rem 2rem;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

nav a:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
}

/* Header */
header {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    margin: 2.5rem auto;
    max-width: 1400px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.8s ease-out;
    border: 2px solid var(--border-color);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    background: linear-gradient(135deg, #ffffff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.8rem;
    margin-bottom: 0.8rem;
    font-weight: 800;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

/* Força h1 preto no modo claro */
:root:not([data-theme="dark"]) h1 {
    background: none !important;
    -webkit-text-fill-color: #000000 !important;
    color: #000000 !important;
}

header p {
    color: var(--text-dim);
    font-size: 1.2rem;
}

/* Força parágrafos pretos no modo claro */
:root:not([data-theme="dark"]) p {
    color: #000000 !important;
}

/* Main */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

section {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    animation: fadeInUp 0.8s ease-out backwards;
}

.studies-section {
    animation-delay: 0.2s;
}

.timer-section {
    animation-delay: 0.4s;
}

h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* Força h2 preto no modo claro */
:root:not([data-theme="dark"]) h2 {
    color: #000000 !important;
}

h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
}

/* Força h3 preto no modo claro */
:root:not([data-theme="dark"]) h3 {
    color: #000000 !important;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.btn-primary {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-icon {
    font-size: 1.3rem;
    line-height: 1;
}

/* Studies List */
.studies-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.studies-list::-webkit-scrollbar {
    width: 6px;
}

.studies-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.studies-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.study-card {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border-left: 4px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.study-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.study-card.active {
    background: rgba(102, 126, 234, 0.2);
    border-left-width: 6px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.study-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.study-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-light);
}

.btn-delete-study {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 118, 117, 0.2);
    color: var(--danger);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-delete-study:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.study-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.study-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-dim);
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Timer Section */
.timer-header {
    text-align: center;
    margin-bottom: 2rem;
}

.timer-mode {
    margin-top: 1rem;
}

.mode-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.mode-badge.break {
    background: linear-gradient(135deg, var(--break-color), var(--success));
}

/* Timer Container */
.timer-container {
    margin: 2rem auto;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-radius: 30px;
    border: 3px solid var(--border-color);
    max-width: 500px;
}

.timer-display {
    text-align: center;
}

.timer-text {
    font-size: 5rem;
    font-weight: 800;
    color: var(--text-light);
    text-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    font-variant-numeric: tabular-nums;
    margin-bottom: 1rem;
}

.timer-session {
    font-size: 1.2rem;
    color: var(--text-dim);
    font-weight: 600;
}

/* Timer Controls */
.timer-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.btn-control {
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-play {
    background: linear-gradient(135deg, var(--success), #00d2a0);
    color: white;
}

.btn-play:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 184, 148, 0.5);
}

.btn-play:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-pause {
    background: linear-gradient(135deg, var(--warning), #ffeaa7);
    color: var(--dark);
}

.btn-pause:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(253, 203, 110, 0.5);
}

.btn-reset {
    background: linear-gradient(135deg, var(--danger), #ff6348);
    color: white;
}

.btn-reset:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(255, 118, 117, 0.5);
}

/* Timer Stats */
.timer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-light);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Timer Settings */
.timer-settings {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.settings-group {
    margin-bottom: 1.5rem;
}

.settings-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.95rem;
}

.settings-group input[type="number"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.settings-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label span {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--dark-card);
    border-radius: 25px;
    width: 90%;
    max-width: 500px;
    border: 2px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.btn-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-close:hover {
    background: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.color-picker {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.color-picker input[type="radio"] {
    display: none;
}

.color-picker label {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.color-picker input[type="radio"]:checked + label {
    border-color: white;
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.color-picker label:hover {
    transform: scale(1.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 2rem 2rem;
    border-top: 1px solid var(--border);
}

.btn-secondary {
    padding: 0.9rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-light);
}

/* Responsividade */
/* Mobile First Otimizado */

/* Garantir áreas de toque adequadas */
button,
.btn-control,
.btn-icon-only,
.study-card {
    -webkit-tap-highlight-color: transparent;
}

button {
    min-width: 44px;
    min-height: 44px;
}

.btn-control {
    min-width: 60px;
    min-height: 60px;
}

/* Prevenir zoom no iOS */
input,
textarea {
    font-size: 16px !important;
}

/* Smooth scroll */
* {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 1200px) {
    main {
        grid-template-columns: 1fr;
        max-width: 95%;
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 0.5rem;
    }

    nav ul {
        padding: 0.75rem 0.5rem;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    nav ul::-webkit-scrollbar {
        display: none;
    }
    
    nav a {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }
    
    header, section {
        padding: 1rem 0.75rem;
        margin: 0.75rem 0.5rem;
        border-radius: 16px;
    }
    
    .timer-container {
        padding: 1.5rem 1rem;
        margin: 1rem auto;
        max-width: 92%;
    }
    
    .timer-text {
        font-size: 3rem;
        letter-spacing: 0.03em;
    }
    
    .timer-session {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .btn-control {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .btn-control:active {
        transform: scale(0.95);
    }
    
    .timer-controls {
        margin-top: 1.25rem;
        gap: 0.75rem;
    }
    
    .timer-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem 0.75rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .study-card {
        padding: 1rem 0.75rem;
        margin-bottom: 0.75rem;
    }

    .study-name {
        font-size: 0.95rem;
    }

    .study-time {
        font-size: 0.8rem;
    }

    .study-actions {
        gap: 0.5rem;
        margin-top: 0.6rem;
    }

    .btn-icon-only {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 0.25rem;
    }

    nav ul {
        padding: 0.6rem 0.4rem;
        gap: 0.4rem;
    }

    nav a {
        font-size: 0.75rem;
        padding: 0.5rem 0.9rem;
        border-radius: 10px;
    }

    h1 {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 1.1rem;
    }
    
    header, section {
        padding: 0.75rem 0.6rem;
        margin: 0.5rem 0.3rem;
        border-radius: 14px;
    }
    
    .timer-container {
        padding: 1.25rem 0.75rem;
        margin: 0.75rem auto;
        max-width: 94%;
        border-radius: 18px;
    }
    
    .timer-text {
        font-size: 2.5rem;
        letter-spacing: 0.02em;
    }
    
    .timer-session {
        font-size: 0.85rem;
        margin-bottom: 0.6rem;
    }
    
    .btn-control {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        border-radius: 50%;
    }
    
    .timer-controls {
        margin-top: 1rem;
        gap: 0.6rem;
    }

    .timer-stats {
        gap: 0.6rem;
    }

    .stat-card {
        padding: 0.85rem 0.6rem;
        border-radius: 12px;
    }

    .stat-label {
        font-size: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }

    .btn-primary {
        padding: 0.7rem;
        font-size: 0.85rem;
        border-radius: 12px;
    }

    .btn-icon {
        font-size: 1.1rem;
    }
    
    .study-card {
        padding: 0.85rem 0.65rem;
        margin-bottom: 0.6rem;
        border-radius: 12px;
    }
    
    .study-name {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .study-time {
        font-size: 0.75rem;
    }

    .study-sessions {
        font-size: 0.75rem;
    }

    .study-actions {
        gap: 0.4rem;
        margin-top: 0.5rem;
    }

    .btn-icon-only {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .btn-small {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        border-radius: 9px;
    }

    .empty-state {
        padding: 1.75rem 1rem;
    }

    .empty-state-icon {
        font-size: 2.5rem;
    }

    .empty-state p {
        font-size: 0.85rem;
    }

    .modal-content {
        width: 96%;
        margin: 0.5rem;
        padding: 1rem;
        border-radius: 16px;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    .btn-close {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    .modal-form {
        gap: 0.7rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.7rem 0.8rem;
        font-size: 15px;
        border-radius: 10px;
    }

    .form-actions {
        gap: 0.5rem;
        margin-top: 0.85rem;
    }
}

/* iPhone SE e telas muito pequenas */
@media (max-width: 375px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.15rem;
    }

    header, section {
        padding: 1.1rem 0.85rem;
        margin: 0.65rem 0.25rem;
    }

    .timer-container {
        padding: 1.75rem 1.1rem;
    }

    .timer-text {
        font-size: 2.8rem;
    }

    .timer-session {
        font-size: 0.9rem;
    }

    .btn-control {
        width: 52px;
        height: 52px;
        font-size: 1.2rem;
    }

    .timer-controls {
        gap: 0.95rem;
    }

    .stat-card {
        padding: 1.1rem 0.9rem;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    .btn-primary {
        padding: 0.9rem;
        font-size: 0.9rem;
    }

    .study-card {
        padding: 1rem 0.85rem;
    }

    .btn-icon-only {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .modal-content {
        padding: 1.1rem;
    }
}

/* PWA Standalone */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Landscape para smartphones */
@media (max-height: 500px) and (orientation: landscape) {
    header, section {
        margin: 0.5rem 0.35rem;
        padding: 1rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .timer-container {
        padding: 1.5rem 1.25rem;
        margin: 0.75rem auto;
    }

    .timer-text {
        font-size: 2.5rem;
    }

    .timer-controls {
        margin-top: 1rem;
    }

    .timer-stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }
}

/* Ajustes adicionais para mobile - Evitar sobreposição */
@media (max-width: 768px) {
    /* Garantir espaço para botões flutuantes */
    body {
        padding-top: 0;
    }
    
    /* Ajustar timer para não ficar muito grande */
    .timer-container {
        min-height: auto;
    }
    
    /* Reduzir espaçamentos verticais */
    header {
        margin-top: 0.5rem !important;
    }
    
    /* Botões de controle menores e mais juntos */
    .timer-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Cards de estudo mais compactos */
    .study-card {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .study-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Stats em linha no mobile */
    .timer-stats {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .stat-card {
        flex: 1;
        min-width: calc(50% - 0.25rem);
    }
}
