:root {
    --bg-pomodoro: #ba4949;
    --bg-short-break: #38858a;
    --bg-long-break: #397097;
    --card-bg: rgba(255, 255, 255, 0.1);
    --btn-active-bg: rgba(0, 0, 0, 0.15);
    --text-color: #ffffff;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    transition: background-color var(--transition-speed) ease;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding-top: 50px;
}

.pomodoro-theme { background-color: var(--bg-pomodoro); }
.short-break-theme { background-color: var(--bg-short-break); }
.long-break-theme { background-color: var(--bg-long-break); }

.container {
    width: 100%;
    max-width: 480px;
    padding: 0 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    opacity: 0.9;
}

.icon-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    color: #333;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.2rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section h3 {
    font-size: 1rem;
    color: #555;
    margin-bottom: 15px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: #999;
    font-weight: 600;
    margin-bottom: 5px;
}

.input-group input {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #efefef;
    font-family: inherit;
    font-weight: 600;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item label {
    font-weight: 600;
    color: #666;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.modal-footer {
    padding: 15px 20px;
    background-color: #efefef;
    text-align: right;
}

.modal-footer .main-btn {
    padding: 8px 30px;
    font-size: 1rem;
    box-shadow: none;
    background-color: #222;
    color: white;
}

.timer-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.mode-selector button {
    background: none;
    border: none;
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.mode-selector button.active {
    background-color: var(--btn-active-bg);
}

.timer-display {
    font-size: 7.5rem;
    font-weight: 800;
    margin: 20px 0 0 0;
    transition: color 0.3s ease;
}

.timer-display.overtime {
    color: #ffeb3b;
    text-shadow: 0 0 20px rgba(255, 235, 59, 0.5);
}

.session-counter {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 25px;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.main-btn {
    background-color: #ffffff;
    color: #000000;
    border: none;
    padding: 15px 60px;
    font-size: 1.4rem;
    font-weight: 800;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 6px 0 #ebebeb;
    transition: all 0.1s;
    letter-spacing: 2px;
}

.main-btn:active {
    transform: translateY(6px);
    box-shadow: none;
}

.secondary-btn {
    background: none;
    border: none;
    color: white;
    text-decoration: underline;
    opacity: 0.7;
    cursor: pointer;
    font-size: 0.9rem;
}

.secondary-btn:hover {
    opacity: 1;
}

/* Tasks Section */
.tasks-section {
    margin-top: 20px;
}

.tasks-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.6);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.tasks-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.task-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#task-input {
    flex-grow: 1;
    padding: 12px;
    border-radius: 4px;
    border: none;
    font-family: inherit;
    font-size: 1rem;
}

#add-task-btn {
    padding: 0 20px;
    border-radius: 4px;
    border: none;
    background-color: rgba(0, 0, 0, 0.2);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

#task-list {
    list-style: none;
}

.task-item {
    background-color: #ffffff;
    color: #333333;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.task-item span {
    font-weight: 600;
}

.task-item.completed span {
    text-decoration: line-through;
    opacity: 0.6;
}

.task-item button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
}

@media (max-width: 480px) {
    .timer-display {
        font-size: 5.5rem;
    }
}
