:root {
    --bg-color: #121212;
    --text-color: #EAEAEA;
    --primary-color: #BB86FC;
    --glass-border: rgba(255, 255, 255, 0.2);
    --card-bg-color: rgba(44, 44, 44, 0.7);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    transition: background-image 0.5s ease-in-out;
}
.main-header { position: fixed; top: 20px; left: 30px; z-index: 100; }
.site-title {
    font-family: 'DM Serif Display', serif;
    font-size: 2.9rem;
    font-weight: 500;
    color: var(--text-color);
    text-shadow: 0px 2px 10px rgba(0,0,0,0.4);
}

/* --- UI Principal --- */
.info-btn {
    position: fixed; top: 25px; right: 30px; width: 40px; height: 40px;
    background: rgba(255, 255, 255, 0.12); border: 1px solid var(--glass-border);
    border-radius: 50%; color: var(--text-color); font-family: 'DM Serif Display', serif;
    font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(10px); z-index: 100; transition: all 0.3s ease;
}
.info-btn:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.1); }

.stats-card {
    position: fixed; bottom: 30px; left: 30px; background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--glass-border); border-radius: 12px; padding: 15px;
    backdrop-filter: blur(10px); z-index: 100;
    /* MUDANÇA: Layout vertical */
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
    transition: opacity 0.3s, transform 0.3s;
}
.stat-item { text-align: left; }
.stat-item span { font-size: 1.4rem; font-weight: 500; }
.stat-item label { font-size: 0.8rem; opacity: 0.7; display: block; }
.countdown-stat { position: relative; width: 100%; }
.icon-btn { background: none; border: none; color: var(--text-color); opacity: 0.6; cursor: pointer; position: absolute; top: 50%; right: 0; transform: translateY(-50%); }
.icon-btn:hover { opacity: 1; }
.feather-sm { width: 16px; height: 16px; }

/* NOVO: Estilos do Pomodoro */
.pomodoro-widget {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translate(-50%, 0);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px 30px;
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 30px;
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0;
    transform: translate(-50%, 0) translateY(20px);
    pointer-events: none;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    width: auto;
    min-width: 300px;
    justify-content: center;
    text-align: center;
}

.pomodoro-widget.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.settings-btn {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
    background: rgba(255, 255, 255, 0.12); border: 1px solid var(--glass-border);
    border-radius: 50%; color: var(--text-color); cursor: pointer; display: flex;
    align-items: center; justify-content: center; backdrop-filter: blur(10px); z-index: 100;
    transition: background 0.3s ease;
}
.settings-btn:hover { background: rgba(255, 255, 255, 0.2); }
.hidden { opacity: 0; transform: scale(0.9); pointer-events: none; }

/* --- POPUPS --- */
.popup-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.popup-overlay.show { opacity: 1; visibility: visible; }
.popup-window {
    width: 90%; max-width: 700px; background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--glass-border); border-radius: 15px; backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); position: relative;
    display: flex; flex-direction: column; overflow: hidden;
}
.close-popup-btn {
    position: absolute; top: 15px; right: 15px; background: none; border: none;
    color: var(--text-color); cursor: pointer; padding: 5px; z-index: 10;
    font-size: 1.2rem; line-height: 1;
}

/* Configurações */
.popup-content { display: flex; height: 100%; }
.popup-sidebar { width: 200px; padding: 60px 20px 20px 20px; border-right: 1px solid var(--glass-border); }
.popup-sidebar ul { list-style: none; }
.popup-sidebar a { text-decoration: none; color: var(--text-color); display: block; padding: 10px 15px; border-radius: 8px; margin-bottom: 5px; transition: background 0.3s; }
.popup-sidebar a.active, .popup-sidebar a:hover { background: rgba(255, 255, 255, 0.15); }
.popup-main { flex: 1; padding: 60px 40px 20px 40px; overflow-y: auto; }
.settings-section { display: none; }
.settings-section.active { display: block; }
.form-group { margin-bottom: 24px; }

.form-group:last-child {
    margin-bottom: 0;
}
.form-group label { display: block; margin-bottom: 8px; font-weight: 300; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 16px; background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--glass-border); border-radius: 10px; color: var(--text-color);
    font-family: 'Poppins', sans-serif; font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.25);
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.1);
}

.form-group input::placeholder, .form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}
.form-group input[type="range"] { padding: 0; }
.form-group input[type="color"] { padding: 2px; height: 40px; cursor: pointer; }

/* Estilos específicos para o select de dificuldade */
.difficulty-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    cursor: pointer;
    font-weight: 500;
    height: 100%;
}

.difficulty-select option {
    background: rgba(0, 0, 0, 0.9);
    color: var(--text-color);
    padding: 8px;
}

.difficulty-select option[value="baixa"] {
    color: #27ae60;
}

.difficulty-select option[value="media"] {
    color: #f39c12;
}

.difficulty-select option[value="alta"] {
    color: #e74c3c;
}

/* Container do campo de tempo */
.time-input-container {
    position: relative;
    display: flex;
    align-items: center;
    height: 70%;
}

.time-input-container input {
    padding-right: 50px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    height: 100%;
}

.time-unit {
    position: absolute;
    right: 16px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    font-weight: 400;
    pointer-events: none;
}
.button-group { margin-top: 10px; display: flex; gap: 10px; }
.button-group button { padding: 10px 15px; border: none; border-radius: 8px; cursor: pointer; font-weight: 500; transition: background 0.3s; }
.button-group button { background: var(--primary-color); color: #000; }
.button-group button.secondary { background: #555; color: white; }

/* Tarefa */
.task-popup { max-width: 650px; height: auto; padding: 30px 40px; }

.task-popup-header { 
    margin-bottom: 25px; 
    text-align: center;
}

.task-popup-header h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}
.form-row { 
    display: flex; 
    gap: 16px; 
    align-items: stretch; 
    margin-bottom: 8px;
}
.form-row .form-group { flex: 1; }
.task-popup-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--glass-border); }
.task-popup-footer { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    margin-top: 30px; 
    padding-top: 20px; 
    border-top: 1px solid var(--glass-border); 
    gap: 12px;
}

.task-popup-footer button { 
    padding: 10px 18px; 
    border-radius: 8px; 
    font-weight: 500; 
    border: none; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    font-size: 0.9rem;
    min-width: 100px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
}

.task-popup-footer button:hover { 
    background: rgba(255, 255, 255, 0.15); 
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

#save-task-btn { 
    background: rgba(187, 134, 252, 0.2); 
    color: var(--primary-color); 
    border-color: rgba(187, 134, 252, 0.4);
}

#save-task-btn:hover {
    background: rgba(187, 134, 252, 0.3);
    border-color: rgba(187, 134, 252, 0.6);
}

#complete-task-btn { 
    background: rgba(39, 174, 96, 0.2); 
    color: #27ae60; 
    border-color: rgba(39, 174, 96, 0.4);
}

#complete-task-btn:hover {
    background: rgba(39, 174, 96, 0.3);
    border-color: rgba(39, 174, 96, 0.6);
}

#complete-task-btn.reopen { 
    background: rgba(243, 156, 18, 0.2); 
    color: #f39c12; 
    border-color: rgba(243, 156, 18, 0.4);
}

#complete-task-btn.reopen:hover {
    background: rgba(243, 156, 18, 0.3);
    border-color: rgba(243, 156, 18, 0.6);
}

#delete-task-btn { 
    background: rgba(231, 76, 60, 0.2); 
    color: #e74c3c; 
    border-color: rgba(231, 76, 60, 0.4);
}

#delete-task-btn:hover { 
    background: rgba(231, 76, 60, 0.3); 
    border-color: rgba(231, 76, 60, 0.6);
}

/* Informações */
.info-popup { max-width: 500px; height: auto; padding: 40px; }
.info-popup h2 { font-family: 'DM Serif Display', serif; margin-bottom: 20px; }
.info-popup p { line-height: 1.6; opacity: 0.9; }
.info-footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; }
.info-footer a { color: var(--primary-color); text-decoration: none; }

/* Countdown Popup */
.countdown-popup { max-width: 350px; height: auto; padding: 30px; text-align: center; }
.countdown-popup h3 { font-family: 'DM Serif Display', serif; margin-bottom: 20px; }
.countdown-popup input[type="time"] { font-size: 1.5rem; text-align: center; }

/* Toggle Switch */
.toggle-group { display: flex; align-items: center; justify-content: space-between; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* --- TAREFAS E BARRAS DE PROGRESSO --- */
.task-card {
    position: absolute;
    background: var(--card-bg-color);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    min-width: 250px;
    backdrop-filter: blur(10px);
    cursor: grab;
    transition: all 0.3s ease;
    z-index: 10;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.task-card:active {
    cursor: grabbing;
}

.task-card.completed {
    opacity: 0.6;
    background: rgba(39, 174, 96, 0.2);
}

.task-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.task-description {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 15px;
    line-height: 1.4;
}

.task-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    min-width: 100px;
    max-width: 150px;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    z-index: 1;
}

.progress-bar-overflow {
    height: 100%;
    background: #27ae60;
    border-radius: 4px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    transition: width 0.3s ease;
}

.pomodoro-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-color);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0.7;
}

.pomodoro-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--glass-border);
    transform: scale(1.05);
    opacity: 1;
}

.task-time {
    font-size: 0.8rem;
    opacity: 0.7;
    white-space: nowrap;
}

.task-time-spent {
    font-size: 0.75rem;
    opacity: 0.7;
    color: #27ae60;
    white-space: nowrap;
    font-weight: 500;
}

/* --- WIDGET POMODORO --- */
.pomodoro-widget {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.pomodoro-widget.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.pomodoro-widget .pomodoro-time {
    font-family: 'DM Serif Display', serif;
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--text-color);
    text-shadow: 0px 2px 10px rgba(0,0,0,0.4);
    min-width: 120px;
    text-align: center;
}

.pomodoro-widget .pomodoro-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pomodoro-widget .pomodoro-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pomodoro-widget .pomodoro-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--glass-border);
    transform: scale(1.05);
}

/* Container do tempo da tarefa */
.task-time-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 70px;
    font-size: 0.75rem;
    justify-content: flex-end;
}

.task-time-divider {
    color: var(--glass-border);
    font-weight: 300;
    margin: 0 2px;
    opacity: 0.6;
}

.task-time-studied {
    color: #27ae60;
    font-weight: 500;
    opacity: 0.9;
}

.task-time-estimated {
    color: var(--text-color);
    opacity: 0.7;
}
