:root {
    /* Allegiant-inspired high-contrast palette */
    --brand-navy: #003058;
    --brand-orange: #F05B28;
    --bg-color: #e9ecef;
    --card-bg: #ffffff;
    --text-main: #111111;
    --text-muted: #333333; /* Darkened for better outdoor readability */
    --border-radius: 16px; /* Modern, softer corners */
    --shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    --shadow-active: 0 2px 8px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    user-select: none; 
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Allow text selection only in inputs */
input {
    user-select: auto;
    -webkit-user-select: auto;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    padding-bottom: 50px;
    -webkit-font-smoothing: antialiased;
}

/* --- App Header --- */
.app-header {
    background-color: var(--brand-navy);
    color: white;
    padding: clamp(15px, 4vw, 25px) 15px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header h1 {
    /* Scales between 1.2rem and 1.8rem based on screen width */
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.back-btn {
    position: absolute;
    left: 15px;
    color: white;
    text-decoration: none;
    font-weight: 800;
    font-size: clamp(1rem, 4vw, 1.2rem);
    padding: 10px; /* Larger touch target */
}

/* --- Home Grid Layout --- */
.home-body { background-color: var(--bg-color); }
.home-main {
    padding: 20px;
    display: flex;
    justify-content: center;
}
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 800px;
}
.big-grid-btn {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--brand-navy);
    box-shadow: var(--shadow);
    aspect-ratio: 1 / 1; 
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid transparent;
}
.big-grid-btn:active {
    transform: scale(0.95);
    border-color: var(--brand-orange);
}
.big-grid-btn .icon {
    font-size: clamp(3rem, 10vw, 4.5rem);
    margin-bottom: 15px;
}
.big-grid-btn .text {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
}

/* --- Task Grid Layout --- */
main {
    padding: 20px 15px;
    max-width: 800px;
    margin: 0 auto;
}

.grid-container {
    display: grid;
    /* Forces elements to stretch to fill space evenly */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

/* --- Generic Card Styling --- */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s, background-color 0.2s;
    /* Massive touch targets */
    min-height: 120px; 
}

.task-label {
    font-weight: 700;
    /* Scales for legibility */
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.2;
}

/* --- Time Grab Button Specifics --- */
.time-grab {
    align-items: center;
    cursor: pointer;
    border: 3px solid transparent;
}
.time-grab:active {
    transform: scale(0.96);
    box-shadow: var(--shadow-active);
}
.time-grab.logged {
    background-color: var(--brand-navy);
    color: white;
}
.time-grab.logged .task-label { color: #e1e8f0; }
.time-grab.logged .task-time { color: white; }

.task-time {
    /* Massive chunky text for times */
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    font-weight: 900;
    color: var(--brand-navy);
    letter-spacing: 1px;
}

/* --- Input Fields Specifics --- */
.input-card {
    align-items: flex-start;
}
.input-card .task-label {
    text-align: left;
    margin-bottom: 8px;
}
.modern-input {
    width: 100%;
    border: none;
    border-bottom: 3px solid #cbd5e1;
    padding: 10px 0;
    /* Scales for massive numbers */
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    font-weight: 800;
    color: var(--brand-navy);
    background: transparent;
    outline: none;
    transition: border-color 0.2s;
    border-radius: 0;
}
.modern-input:focus { border-bottom-color: var(--brand-orange); }
.modern-input::placeholder { color: #a0aec0; font-weight: 600; }

/* --- Action Buttons --- */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}
.btn {
    padding: clamp(18px, 5vw, 22px);
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    font-weight: 800;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.1s;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background-color: var(--brand-orange); color: white; }
.btn-secondary { background-color: var(--brand-navy); color: white; }
.btn-danger { 
    background-color: transparent; 
    color: #e74c3c; 
    border: 3px solid #e74c3c; 
    box-shadow: none;
}

/* Progress Bar for holding */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 8px; /* Thicker progress bar */
    width: 0%;
    transition: width 0.1s linear;
}
.time-grab .progress-bar { background-color: var(--brand-orange); }
.btn-danger .progress-bar { background-color: #e74c3c; }

:root {
    /* Allegiant-inspired high-contrast palette */
    --brand-navy: #003058;
    --brand-orange: #F05B28;
    --bg-color: #e9ecef;
    --card-bg: #ffffff;
    --text-main: #111111;
    --text-muted: #333333; 
    --border-radius: 16px; 
    --shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    --shadow-active: 0 2px 8px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Target touch-protections only on elements you hold down, so inputs don't get locked */
.app-header, .btn, .time-grab, .task-label, .big-grid-btn {
    user-select: none; 
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    padding-bottom: 50px;
    -webkit-font-smoothing: antialiased;
}

/* --- App Header --- */
.app-header {
    background-color: var(--brand-navy);
    color: white;
    padding: clamp(15px, 4vw, 25px) 15px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header h1 {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.back-btn {
    position: absolute;
    left: 15px;
    color: white;
    text-decoration: none;
    font-weight: 800;
    font-size: clamp(1rem, 4vw, 1.2rem);
    padding: 10px; 
}

.header-icon-btn {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    font-size: clamp(1.2rem, 5vw, 1.5rem);
    cursor: pointer;
    padding: 10px;
    color: white;
}

/* --- Home Grid Layout --- */
.home-body { background-color: var(--brand-navy); }
.home-main {
    padding: 30px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    height: 100vh;
}
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 800px;
}
.big-grid-btn {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--brand-navy);
    box-shadow: var(--shadow);
    aspect-ratio: 1 / 1; 
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid transparent;
}
.big-grid-btn:active {
    transform: scale(0.95);
    border-color: var(--brand-orange);
}
.big-grid-btn .icon {
    font-size: clamp(3rem, 10vw, 4.5rem);
    margin-bottom: 15px;
}
.big-grid-btn .text {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
}

/* --- Task Grid Layout --- */
main {
    padding: 20px 15px;
    max-width: 800px;
    margin: 0 auto;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

/* --- Generic Card Styling --- */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s, background-color 0.2s;
    min-height: 120px; 
}

.task-label {
    font-weight: 700;
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.2;
}

/* --- Time Grab Button Specifics --- */
.time-grab {
    align-items: center;
    cursor: pointer;
    border: 3px solid transparent;
}
.time-grab:active {
    transform: scale(0.96);
    box-shadow: var(--shadow-active);
}
.time-grab.logged {
    background-color: var(--brand-navy);
    color: white;
}
.time-grab.logged .task-label { color: #e1e8f0; }
.time-grab.logged .task-time { color: white; }

.task-time {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    font-weight: 900;
    color: var(--brand-navy);
    letter-spacing: 1px;
}

/* --- Input Fields Specifics --- */
.input-card {
    align-items: flex-start;
}
.input-card .task-label {
    text-align: left;
    margin-bottom: 8px;
}
.modern-input {
    width: 100%;
    border: none;
    border-bottom: 3px solid #cbd5e1;
    padding: 10px 0;
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    font-weight: 800;
    color: var(--brand-navy);
    background: transparent;
    outline: none;
    transition: border-color 0.2s;
    border-radius: 0;
}
.modern-input:focus { border-bottom-color: var(--brand-orange); }
.modern-input::placeholder { color: #a0aec0; font-weight: 600; }

/* --- Action Buttons --- */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}
.btn {
    padding: clamp(18px, 5vw, 22px);
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    font-weight: 800;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.1s;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background-color: var(--brand-orange); color: white; }
.btn-secondary { background-color: var(--brand-navy); color: white; }
.btn-danger { 
    background-color: transparent; 
    color: #e74c3c; 
    border: 3px solid #e74c3c; 
    box-shadow: none;
}

/* Progress Bar for holding */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 8px; 
    width: 0%;
    transition: width 0.1s linear;
}
.time-grab .progress-bar { background-color: var(--brand-orange); }
.btn-danger .progress-bar { background-color: #e74c3c; }

/* --- Info Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.2s;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 400px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-header {
    background: var(--bg-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #cbd5e1;
}
.modal-header h2 { font-size: 1.2rem; color: var(--brand-navy); }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); padding: 5px; }
.modal-body { padding: 20px; }
.info-list { list-style: none; display: flex; flex-direction: column; gap: 15px; }
.info-list li { font-size: 1rem; color: var(--text-main); line-height: 1.4; }
.info-list strong { color: var(--brand-navy); display: inline-block; margin-bottom: 3px; }

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.2s;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 400px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.text-center { text-align: center; }
.modal-header {
    background: var(--bg-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #cbd5e1;
}
.modal-header h2 { font-size: 1.2rem; color: var(--brand-navy); }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); padding: 5px; }
.modal-body { padding: 20px; }
.info-list { list-style: none; display: flex; flex-direction: column; gap: 15px; text-align: left; }
.info-list li { font-size: 1rem; color: var(--text-main); line-height: 1.4; }
.info-list strong { color: var(--brand-navy); display: inline-block; margin-bottom: 3px; }

/* Modal Action Buttons (Side by Side) */
.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}
.modal-actions .btn {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
}