/* Accessibility & Global Defaults */
:root {
    --primary-color: #0f4c81;
    --primary-hover: #0a3356;
    --success-color: #27ae60;
    --urgent-color: #c0392b;
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --border-color: #d2d7df;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1.1rem;
    transition: all 0.2s ease-in-out;
}

/* ELDER MODE OVERRIDES (HIGH CONTRAST & ENHANCED DENSITY) */
body.elder-mode {
    font-size: 1.5rem !important;
    background-color: #ffffff !important;
    color: #000000 !important;
}
body.elder-mode .form-section, 
body.elder-mode .board-section, 
body.elder-mode .profile-widget,
body.elder-mode .task-card {
    border: 3px solid #000000 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #000000 !important;
}
body.elder-mode input, 
body.elder-mode textarea, 
body.elder-mode select {
    font-size: 1.4rem !important;
    border: 3px solid #000000 !important;
    color: #000000 !important;
    background: #ffffff !important;
    padding: 15px !important;
}
body.elder-mode h1, body.elder-mode h2, body.elder-mode h3 {
    color: #000000 !important;
    font-size: 1.9rem !important;
    font-weight: 900 !important;
}
body.elder-mode .btn {
    font-size: 1.3rem !important;
    padding: 16px !important;
    border: 2px solid #000000 !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-elder-toggle {
    background-color: #ffc107;
    color: #000;
    font-weight: bold;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.1s;
}
.btn-elder-toggle:hover {
    transform: scale(1.03);
}

.logout-link {
    color: #8da9c4;
    text-decoration: none;
    font-weight: bold;
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 4px;
}
.logout-link:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Header styling */
.main-header {
    background-color: #0b2545;
    color: white;
    padding: 30px 0;
    margin-bottom: 30px;
}

.subtitle {
    font-size: 1.1rem;
    color: #8da9c4;
}

/* Structural Dashboard Grid Mapping */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 850px) {
    .main-content {
        grid-template-columns: 1fr 1.3fr;
    }
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Cards & Widgets */
.form-section, .board-section, .profile-widget {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.helper-wallet {
    background: #e3f2fd;
    border: 2px solid #90caf9;
    text-align: center;
}

.karma-container {
    font-size: 2rem;
    font-weight: bold;
    color: #1565c0;
    margin: 5px 0;
}

.karma-badge {
    display: inline-block;
    background-color: #1565c0;
    color: white;
    font-weight: bold;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Leaderboards styling */
.leaderboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f7;
}
.leaderboard-row:last-child { border-bottom: none; }

/* Gamification Reward Lists styles */
.milestone-list {
    list-style: none;
}
.milestone-list li {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: #f8f9fa;
    border-left: 4px solid #cbd5e0;
}
.milestone-list li.unlocked {
    background: #e8f5e9;
    border-left-color: var(--success-color);
    color: #1b5e20;
}

h2, h3 {
    margin-bottom: 15px;
    color: #0b2545;
}

.form-group { margin-bottom: 18px; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}
input:focus, textarea:focus, select:focus {
    outline: 3px solid #ffc107;
    border-color: var(--primary-color);
}

.checkbox-group { display: flex; align-items: center; gap: 10px; }
.checkbox-group input { width: 22px; height: 22px; }
.urgent-label { margin-bottom: 0; color: var(--urgent-color); }

.controls-wrapper {
    display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap;
}
.controls-wrapper input { flex: 2; min-width: 180px; }
.controls-wrapper select { flex: 1; min-width: 150px; }

/* Action Buttons styles */
.btn {
    display: inline-block; width: 100%; padding: 12px; font-size: 1.05rem;
    font-weight: bold; text-align: center; border: none; border-radius: 6px;
    cursor: pointer; transition: background 0.2s;
}
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-success { background-color: var(--success-color); color: white; }
.btn-claimed { background-color: #a0aec0; color: white; cursor: not-allowed; }
.btn-voice { background-color: #6b46c1; color: white; padding: 12px; font-size: 1rem; margin-top: 8px; }

/* Dynamic Content Feed Components layout */
.task-board { display: flex; flex-direction: column; gap: 15px; }
.task-card {
    border: 2px solid #e2e8f0; border-left: 6px solid var(--primary-color);
    padding: 20px; border-radius: 6px; background-color: #fff; position: relative;
}
.task-card.claimed { border-left-color: #718096; background-color: #edf2f7; opacity: 0.65; }
.task-card.urgent-card { border-left-color: var(--urgent-color); background-color: #fff5f5; animation: pulse 2s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(192, 57, 43, 0); }
    100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

.urgent-badge { position: absolute; top: 15px; right: 15px; background: var(--urgent-color); color: white; font-size: 0.75rem; font-weight: bold; padding: 2px 6px; border-radius: 4px; }
.task-meta { display: flex; gap: 12px; margin: 8px 0 12px 0; font-size: 0.85rem; }
.badge { padding: 3px 6px; border-radius: 4px; font-weight: bold; background: #ebf8ff; color: #2b6cb0; }

/* Login Page Theme Layout Rules */
.login-body {
    background: linear-gradient(135deg, #0b2545 0%, #134074 100%);
    display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px;
}
.login-container { max-width: 550px; width: 100%; }
.login-header { text-align: center; color: white; margin-bottom: 25px; }
.login-header h1 { font-size: 2.2rem; }
.login-header p { color: #8da9c4; }
.login-card { background: white; padding: 35px; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3); }
.role-selector-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 5px; }
.role-option { cursor: pointer; }
.role-option input { display: none; }
.role-card-inner {
    border: 2px solid var(--border-color); padding: 15px; border-radius: 8px; text-align: center; height: 100%; transition: all 0.2s;
}
.role-icon { font-size: 2rem; display: block; margin-bottom: 5px; }
.role-card-inner h3 { font-size: 1.1rem; margin-bottom: 5px; }
.role-card-inner p { font-size: 0.8rem; color: #718096; line-height: 1.3; }
.role-option input:checked + .role-card-inner {
    border-color: var(--primary-color); background: #ebf8ff; box-shadow: 0 0 0 1px var(--primary-color);
}

/* Accessible Overlay structures */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); display: none; justify-content: center; align-items: center; z-index: 1000;
}
.modal-content { background: #fff; padding: 35px; max-width: 480px; width: 90%; border-radius: 8px; position: relative; text-align: center; }
.modal-close-btn { position: absolute; top: 10px; right: 20px; font-size: 1.8rem; background: none; border: none; cursor: pointer; color: #a0aec0; }
#modal-body-text { margin: 15px 0; background: #f0fff4; padding: 12px; border-radius: 6px; border: 1px dashed var(--success-color); font-size: 1.05rem; }

@keyframes blink {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}