:root {
    --bg: #f8f9fa;
    --card: #ffffff;
    --accent: #3498db;
    --stop: #e74c3c;
    --long-color: #5b5f97;
    --pulse-color: #e67e22;
    --gap-color: #bdc3c7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background: var(--bg);
    color: #333;
}

/* --- HERO SECTION (Used in index.html) --- */
#hero {
    position: sticky;
    top: 0;
    background: var(--card);
    padding: 25px 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    text-align: center;
    border-bottom: 5px solid #eee;
    transition: border-color 0.3s;
}

#hero.active {
    border-color: var(--stop);
}

#hero-status {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

#hero-timer {
    font-family: monospace;
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 10px;
}

#hero-note {
    width: 80%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

/* --- ACTION GRID (Used in index.html) --- */
.controls {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px 0;
}

#grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
}

.tile {
    background: var(--card);
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tile:active {
    transform: scale(0.92);
    transition: 0.1s;
}

.tile i {
    font-size: 28px;
    margin-bottom: 10px;
    pointer-events: none;
}

.tile span {
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
}

/* --- TIMELINE SECTION (Used in timeline.html) --- */
header {
    background: var(--card);
    padding: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    margin: 0;
    font-size: 1.2rem;
    flex-grow: 1;
    text-align: center;
}

.back-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--accent);
}

#timeline {
    max-width: 600px;
    margin: 20px auto;
    position: relative;
    padding: 0 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

#timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ddd;
    transform: translateX(-50%);
}

.log-entry {
    position: relative;
    margin-bottom: 20px;
    width: 90%;
    cursor: pointer;
}

.log-long {
    grid-column: 1;
    justify-self: end;
    margin-right: 15px;
    text-align: right;
}

.log-long .content {
    background: var(--card);
    padding: 12px;
    border-radius: 12px;
    border-right: 4px solid var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.log-pulse {
    grid-column: 2;
    justify-self: start;
    margin-left: 15px;
}

.log-pulse .content {
    background: var(--card);
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--pulse-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.log-time {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
}

.log-name {
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- MODAL STYLES (Used in timeline.html) --- */
#edit-modal {
    display: none;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
}

.modal-content h2 {
    margin-top: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
}

.btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

.btn-save {
    background: var(--accent);
    color: white;
}

.btn-cancel {
    background: #eee;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

/* --- TOGGLE SWITCH --- */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--pulse-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--long-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* --- SHARED ELEMENTS --- */
#add-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.bounce {
    animation: bounce 0.3s ease;
}