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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #111827;
    color: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Container */
.container {
    text-align: center;
    max-width: 42rem;
    width: 100%;
}

/* Typography */
h1 {
    font-size: 3.75rem;
    font-weight: bold;
    margin-bottom: 2rem;
}

/* Links Section (Homepage) */
.links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

a {
    display: block;
    background-color: #1f2937;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 1.125rem;
    transition: background-color 0.2s;
}

a:hover {
    background-color: #374151;
}

/* Footer */
.footer {
    margin-top: 3rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Pomodoro Timer Specific Styles */
.container.pomodoro {
    max-width: 32rem;
}

.header-with-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
    margin-bottom: 3rem;
}

.container.pomodoro h1 {
    font-size: 2.5rem;
    margin-bottom: 0;
}

.settings-btn {
    padding: 0.5rem 0.75rem;
    font-size: 1.5rem;
    background-color: #1f2937;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    position: absolute;
    right: 0;
}

.settings-btn:hover {
    background-color: #374151;
    transform: rotate(45deg);
}

.timer-display {
    font-size: 6rem;
    font-weight: bold;
    margin-bottom: 2rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1em;
}

.timer-label {
    font-size: 1.5rem;
    color: #9ca3af;
    margin-bottom: 3rem;
}

.task-highlight {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.6rem;
}

/* Controls */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

button {
    background-color: #1f2937;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
}

button:hover {
    background-color: #374151;
}

button:active {
    background-color: #4b5563;
}

button.primary {
    background-color: #3b82f6;
}

button.primary:hover {
    background-color: #2563eb;
}

button.primary:active {
    background-color: #1d4ed8;
}

button.end-early-btn {
    background-color: #f59e0b;
}

button.end-early-btn:hover {
    background-color: #d97706;
}

button.end-early-btn:active {
    background-color: #b45309;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.mode-btn.active {
    background-color: #3b82f6;
}

/* Tasks Section */
.tasks-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #374151;
}

.tasks-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #9ca3af;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: move;
}

.task-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.drag-handle {
    color: #6b7280;
    font-size: 1.2rem;
    cursor: grab;
    user-select: none;
    padding: 0 0.25rem;
    line-height: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

.task-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #3b82f6;
}

.task-item.task-highlight {
    background-color: #1e3a5f;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.task-item.checked .task-input {
    text-decoration: line-through;
    opacity: 0.5;
}

.task-input {
    background-color: #1f2937;
    color: white;
    padding: 0.75rem 1rem;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    flex: 1;
}

.task-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.task-input::placeholder {
    color: #6b7280;
}

/* Secondary tasks - greyed out for less emphasis */
.task-item-secondary {
    opacity: 0.6;
}

.task-item-secondary:focus-within {
    opacity: 1;
}

.task-item-secondary.task-highlight {
    opacity: 1;
}

.task-input-secondary {
    background-color: #1a1f2e;
    border-color: #2d3748;
}

.task-input-secondary:focus {
    border-color: #3b82f6;
}

.task-input-secondary::placeholder {
    color: #4b5563;
}

/* Stats */
.stats {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.stats-item {
    display: inline-block;
    margin: 0 1.5rem;
    color: #9ca3af;
}

.stats-value {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    display: block;
}

.reset-stats-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background-color: #dc2626;
    margin-top: 0.5rem;
}

.reset-stats-btn:hover {
    background-color: #b91c1c;
}

.reset-stats-btn:active {
    background-color: #991b1b;
}

/* Back Link */
.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: white;
}

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

.modal-content {
    background-color: #1f2937;
    border-radius: 0.75rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

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

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-btn:hover {
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

.setting-item input[type="number"] {
    width: 100%;
    background-color: #111827;
    color: white;
    padding: 0.75rem;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
}

.setting-item input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #374151;
    justify-content: flex-end;
}

.modal-footer button {
    padding: 0.75rem 1.5rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .timer-display {
        font-size: 4rem;
    }

    h1 {
        font-size: 2rem;
    }

    .controls {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}