/**
 * HEALTHY BONES APPLICATION CORE PRESENTATION STYLESHEET
 * Architectural Role: User Dashboard & Layout Interface Skin
 */

:root {
    --bg: #f7fbff;
    --panel: #ffffff;
    --text: #17233f;
    --muted: #5e6680;
    --accent: #3340ff;
    --accent-2: #e9fbff;
    --border: #ccd7ff;
    --danger: #d91f88;
    --success: #22c55e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top right, rgba(51, 255, 242, 0.15) 0%, transparent 40%),
                radial-gradient(circle at bottom left, rgba(242, 51, 255, 0.12) 0%, transparent 40%), var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 🌐 CORE APPLICATION HEADER SECTION */
.app-header {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 12px 4%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.header-container {
    max-width: 920px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-container h1 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    background: var(--accent-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1.2rem;
    padding: 8px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.icon-btn:active {
    transform: scale(0.95);
}

.logout-btn {
    background: var(--danger);
    color: #ffffff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* 📊 DASHBOARD RUNTIME VIEWPORTS */
.app-content {
    flex: 1;
    width: min(920px, 94vw);
    margin: 30px auto;
}

.panel-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Real-Time Metrics Strip */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.metric-box {
    background: var(--accent-2);
    border: 1px solid #99d7ff;
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}

.metric-label {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.metric-number {
    display: block;
    color: var(--accent);
    font-size: 1.8rem;
    font-weight: bold;
}

/* Dynamic Routine Display Viewport */
.daily-task-container {
    border: 1px solid #99d7ff;
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(to bottom, #ffffff, var(--bg));
    margin-bottom: 20px;
}

.action-label {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 6px 0;
}

.action-headline {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: var(--text);
}

.action-body-text {
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Embedded Media Viewports */
.task-media-viewport {
    width: 100%;
    margin: 16px 0;
    border-radius: 10px;
    overflow: hidden;
}

.video-panel {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; 
    height: 0;
    background: #000000;
}

.video-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 🛠️ TRANSACTION CONTROLS TRAY */
.interaction-tray {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    flex: 1;
    min-width: 200px;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3340ff, #8c33ff);
    color: #ffffff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(51, 64, 255, 0.2);
}

.btn-primary:disabled, .btn-success-disabled {
    background: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

.btn-secondary {
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
}

/* 🗓️ MULTI-PAGE COMPLIANCE OVERLAY SHELLS (MODALS) */
.modal-shell, .modal-shell-container {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: min(540px, 92vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    overflow: hidden;
    padding: 24px;
}

.modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
}

.modal-header h3 { margin: 0; font-size: 1.1rem; }

.close-x {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--muted);
}

/* Calendar Day Layout Matrices */
.calendar-days-grid, .calendar-grid-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 16px;
    background: var(--panel);
}
/* 🌟 FIXED: Calendar day cell base styling parameters */
.calendar-day-cell {
    padding: 10px;
    background-color: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    transition: all 0.15s ease;
}

/* 🌟 FIXED: Paints the completed tracking blocks in solid accessible color fields */
.calendar-day-cell.day-completed {
    background-image: linear-gradient(135deg, #3340ff, #8c33ff) !important; /* Fixed keyword unlocks the gradient */
    background-color: var(--accent) !important; 
    color: #ffffff !important;                   
    border-color: transparent !important;
    box-shadow: 0 2px 6px rgba(51, 64, 255, 0.2);
}

/* Style empty baseline offset blocks elegantly */
.calendar-day-cell.empty-pad {
    background-color: transparent !important;
    border: none !important;
    pointer-events: none;
}


/* 🔔 NOTIFICATION SYSTEM FEEDBACK BANNERS */
.alert {
    padding: 12px;
    border-radius: 10px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 16px;
}
.alert-success { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.alert-danger { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }

/* 👤 SYSTEM FOOTER NAVIGATION LINKS */
.site-footer {
    padding: 20px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.88rem;
}
.site-footer a {
    color: var(--muted);
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--accent);
}

.hidden { display: none !important; }

/* 🌟 FIXED: Absolute structural alignment centered overlay framework elements */
dialog#calendarModal, dialog.modal-backdrop, .modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background-color: rgba(23, 35, 63, 0.4) !important;
    backdrop-filter: blur(4px) !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: none;
    align-items: center !important;     
    justify-content: center !important;  
    z-index: 9999 !important;
    box-sizing: border-box !important;
}

dialog#calendarModal[open], dialog.modal-backdrop[open], .modal-backdrop[open] {
    display: flex !important;
}
