/* Vital Trajectory Brand System */

/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Brand Colors */
:root {
    --vt-primary: #007AFF;
    --vt-accent-teal: #00C2A8;
    --vt-action-green: #00B578;
    --vt-warning: #FFB300;
    --vt-danger: #E63946;
    --vt-gray-1: #EAEAEA;
    --vt-gray-2: #C9C9C9;
    --vt-dark-bg: #0D1117;
    --vt-dark-surface: #161B22;
    --vt-dark-text: #E6EDF3;
    
    /* Light Mode Colors */
    --vt-bg: #FFFFFF;
    --vt-surface: #FFFFFF;
    --vt-text: #1A1A1A;
    --vt-text-muted: #6C757D;
    --vt-border: #EAEAEA;
    --vt-shadow: rgba(0, 0, 0, 0.08);
}

/* Dark Mode Colors */
body.dark-mode {
    --vt-bg: var(--vt-dark-bg);
    --vt-surface: var(--vt-dark-surface);
    --vt-text: var(--vt-dark-text);
    --vt-text-muted: #8B949E;
    --vt-border: #30363D;
    --vt-shadow: rgba(0, 0, 0, 0.3);
}

/* Typography */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.55;
    color: #1A1A1A;
    background-color: var(--vt-bg);
}

body.dark-mode {
    color: #E6EDF3;
}

h1, h2 {
    font-weight: 600;
    margin-bottom: 1rem;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    color: var(--vt-text);
}

/* Section Titles */
.section-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    border-left: 4px solid var(--vt-primary);
    padding-left: 12px;
    margin-bottom: 1rem;
    color: var(--vt-text);
}

/* Cards */
.card {
    background-color: var(--vt-surface);
    border: 1px solid var(--vt-border);
    border-radius: 8px;
    color: var(--vt-text);
    padding: 0;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

body:not(.dark-mode) .card {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-mode .card {
    background: #161B22;
    color: #E6EDF3;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

/* Consistent card spacing */
.card + .card {
    margin-top: 1.5rem;
}

/* Card header consistency */
.card-header {
    min-height: 3.5rem;
    display: flex;
    align-items: center;
}

.card-header h5 {
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

body.dark-mode .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-body {
    padding: 1rem;
}

.card-header {
    background-color: var(--vt-surface);
    border-bottom: 1px solid var(--vt-border);
    border-radius: 8px 8px 0 0;
    padding: 1rem 1.25rem;
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--vt-primary), var(--vt-accent-teal));
    border-radius: 0 0 8px 8px;
}

/* Section Titles */
.section-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    border-left: 4px solid var(--vt-primary);
    padding-left: 12px;
    margin-bottom: 1rem;
    color: var(--vt-text);
}

/* Global Spacing */
.section {
    margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
    .section {
        margin-bottom: 1.5rem;
    }
}

/* Marketing Page Spacing */
.marketing-section {
    padding: 80px 0;
}

@media (max-width: 768px) {
    .marketing-section {
        padding: 40px 0;
    }
}

.marketing-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Fade-in Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* CTA Buttons */
.btn-primary {
    position: relative;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-primary i.bi-arrow-right {
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.btn-primary:hover i.bi-arrow-right {
    transform: translateX(4px);
}

/* Dashboard Metric Cards */
.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card .card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.metric-card .metric-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--vt-text);
    line-height: 1.2;
}

.metric-card .metric-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--vt-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Admin Panel */
.admin-sidebar .admin-nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.admin-accent {
    color: var(--vt-accent-teal);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--vt-text-muted);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--vt-primary);
    border-color: var(--vt-primary);
    border-radius: 6px;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: #0066CC;
    border-color: #0066CC;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-success {
    background-color: var(--vt-action-green);
    border-color: var(--vt-action-green);
    border-radius: 6px;
}

.btn-warning {
    background-color: var(--vt-warning);
    border-color: var(--vt-warning);
    border-radius: 6px;
    color: #1A1A1A;
}

.btn-danger {
    background-color: var(--vt-danger);
    border-color: var(--vt-danger);
    border-radius: 6px;
}

.btn-outline-primary {
    border-color: var(--vt-primary);
    color: var(--vt-primary);
    border-radius: 6px;
}

.btn-outline-primary:hover {
    background-color: var(--vt-primary);
    border-color: var(--vt-primary);
}

/* Forms */
.form-container {
    max-width: 960px;
    margin: 0 auto;
}

.form-control, .form-select {
    border-radius: 6px;
    border-color: var(--vt-border);
    background-color: var(--vt-surface);
    color: var(--vt-text);
    padding: 0.5rem 0.75rem;
    transition: all 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--vt-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 122, 255, 0.25);
    background-color: var(--vt-surface);
    color: var(--vt-text);
}

.form-label {
    font-weight: 500;
    color: var(--vt-text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label i {
    color: var(--vt-primary);
    font-size: 0.9rem;
}

.form-divider {
    height: 1px;
    background: var(--vt-border);
    margin: 1.5rem 0;
    border: none;
}

body.dark-mode .form-divider {
    background: rgba(255, 255, 255, 0.1);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: rgba(0, 181, 120, 0.1);
    color: var(--vt-action-green);
    border-left: 4px solid var(--vt-action-green);
}

.alert-warning {
    background-color: rgba(255, 179, 0, 0.1);
    color: var(--vt-warning);
    border-left: 4px solid var(--vt-warning);
}

.alert-danger {
    background-color: rgba(230, 57, 70, 0.1);
    color: var(--vt-danger);
    border-left: 4px solid var(--vt-danger);
}

.alert-info {
    background-color: rgba(0, 122, 255, 0.1);
    color: var(--vt-primary);
    border-left: 4px solid var(--vt-primary);
}

body.dark-mode .alert-success {
    background-color: rgba(0, 181, 120, 0.15);
}

body.dark-mode .alert-warning {
    background-color: rgba(255, 179, 0, 0.15);
}

body.dark-mode .alert-danger {
    background-color: rgba(230, 57, 70, 0.15);
}

body.dark-mode .alert-info {
    background-color: rgba(0, 122, 255, 0.15);
}

/* Navbar */
.navbar {
    background: linear-gradient(90deg, #007AFF, #00C2A8) !important;
    border-bottom: none;
    padding: 1rem 0;
}

.navbar-brand {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    color: white !important;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    transition: all 0.2s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
}

.navbar-nav .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background-color: white;
    border-radius: 2px;
}

.navbar-nav .nav-link i {
    margin-right: 0.5rem;
}

/* Tables */
.table {
    color: var(--vt-text);
}

.table > tbody > tr > td,
.table > thead > tr > th {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: var(--vt-bg);
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(255, 255, 255, 0.02);
}

.table-hover > tbody > tr {
    transition: background-color 0.15s ease;
}

.table-hover > tbody > tr:hover > td {
    background-color: rgba(0, 122, 255, 0.08);
    cursor: pointer;
}

body.dark-mode .table-hover > tbody > tr:hover > td {
    background-color: rgba(0, 122, 255, 0.15);
}

.table thead th {
    position: relative;
    user-select: none;
}

.table thead th.sortable {
    cursor: pointer;
}

.table thead th.sortable:hover {
    background-color: rgba(0, 122, 255, 0.05);
}

.table thead th .sort-icon {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.5;
}

/* Badges */
.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.bg-primary {
    background-color: var(--vt-primary) !important;
}

.bg-success {
    background-color: var(--vt-action-green) !important;
}

.bg-warning {
    background-color: var(--vt-warning) !important;
}

.bg-danger {
    background-color: var(--vt-danger) !important;
}

/* Links */
a {
    color: var(--vt-primary);
    text-decoration: none;
    transition: all 0.15s ease;
}

a:hover {
    color: #0066CC;
    text-decoration: underline;
    text-underline-offset: 2px;
}

a i {
    transition: all 0.15s ease;
}

a:hover i {
    transform: translateX(2px);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Spacing Utilities */
.section-spacing {
    padding: 4rem 0;
}

@media (max-width: 768px) {
    .section-spacing {
        padding: 2rem 0;
    }
}

/* Global Spacing */
.section {
    margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
    .section {
        margin-bottom: 1.5rem;
    }
}

/* Marketing Page Spacing */
.marketing-section {
    padding: 80px 0;
}

@media (max-width: 768px) {
    .marketing-section {
        padding: 40px 0;
    }
}

.marketing-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Fade-in Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* CTA Buttons */
.btn-primary {
    position: relative;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-primary i.bi-arrow-right {
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.btn-primary:hover i.bi-arrow-right {
    transform: translateX(4px);
}

/* Admin Panel */
.admin-sidebar .admin-nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.admin-accent {
    color: var(--vt-accent-teal);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--vt-text-muted);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state-message {
    font-size: 0.95rem;
    color: var(--vt-text-muted);
    font-style: italic;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--vt-primary) 0%, var(--vt-accent-teal) 100%);
    color: white;
    padding: 5rem 0;
}

/* Feature Icons */
.feature-icon {
    font-size: 3rem;
    color: var(--vt-primary);
    margin-bottom: 1rem;
}

/* Pricing Cards */
.pricing-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--vt-shadow);
}

/* Chart.js Defaults */
.chart-container {
    position: relative;
    height: 300px;
}

/* FAQ / Accordion */
.accordion-item {
    border: 1px solid var(--vt-border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.15s ease;
}

.accordion-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.accordion-button {
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.accordion-button i {
    font-size: 0.875rem;
    margin-right: 0.5rem;
    opacity: 0.7;
}

.accordion-button:not(.collapsed) i {
    opacity: 1;
}

.accordion-body {
    padding: 1rem 1.25rem;
    line-height: 1.6;
}

/* Daily Log Section Headers - Softer Colors */
.daily-log-section-header {
    border-left: 4px solid;
    padding-left: 1rem;
}

.daily-log-section-header.body-metrics {
    border-left-color: rgba(0, 122, 255, 0.3);
    background-color: rgba(0, 122, 255, 0.05);
}

.daily-log-section-header.fasting {
    border-left-color: rgba(0, 181, 120, 0.3);
    background-color: rgba(0, 181, 120, 0.05);
}

.daily-log-section-header.exercise {
    border-left-color: rgba(255, 179, 0, 0.3);
    background-color: rgba(255, 179, 0, 0.05);
}

.daily-log-section-header.food {
    border-left-color: rgba(230, 57, 70, 0.3);
    background-color: rgba(230, 57, 70, 0.05);
}

.daily-log-section-header.sleep {
    border-left-color: rgba(108, 117, 125, 0.3);
    background-color: rgba(108, 117, 125, 0.05);
}

.daily-log-section-header.stress {
    border-left-color: rgba(0, 194, 168, 0.3);
    background-color: rgba(0, 194, 168, 0.05);
}

.daily-log-section-header.blood-pressure {
    border-left-color: rgba(230, 57, 70, 0.4);
    background-color: rgba(230, 57, 70, 0.08);
}

.daily-log-section-header.bowel {
    border-left-color: rgba(0, 122, 255, 0.3);
    background-color: rgba(0, 122, 255, 0.05);
}

.daily-log-section-header.notes {
    border-left-color: rgba(108, 117, 125, 0.3);
    background-color: rgba(108, 117, 125, 0.05);
}

body.dark-mode .daily-log-section-header.body-metrics {
    background-color: rgba(0, 122, 255, 0.1);
}

body.dark-mode .daily-log-section-header.fasting {
    background-color: rgba(0, 181, 120, 0.1);
}

body.dark-mode .daily-log-section-header.exercise {
    background-color: rgba(255, 179, 0, 0.1);
}

body.dark-mode .daily-log-section-header.food {
    background-color: rgba(230, 57, 70, 0.1);
}

body.dark-mode .daily-log-section-header.sleep {
    background-color: rgba(108, 117, 125, 0.1);
}

body.dark-mode .daily-log-section-header.stress {
    background-color: rgba(0, 194, 168, 0.1);
}

body.dark-mode .daily-log-section-header.blood-pressure {
    background-color: rgba(230, 57, 70, 0.15);
}

body.dark-mode .daily-log-section-header.bowel {
    background-color: rgba(0, 122, 255, 0.1);
}

body.dark-mode .daily-log-section-header.notes {
    background-color: rgba(108, 117, 125, 0.1);
}

/* Daily Log Responsive Styles */
.daily-log-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Food Entry Spacing - Prevent label overlap */
.food-entry .row.g-2 > [class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.food-entry .form-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.375rem;
}

/* Blood Pressure DateTime Picker - Better spacing */
.daily-log-card .datetime-hour,
.daily-log-card .datetime-minute,
.daily-log-card .datetime-ampm {
    flex: 1 1 auto;
}

@media (max-width: 575.98px) {
    .daily-log-card .d-flex.gap-2.flex-wrap {
        gap: 0.5rem !important;
    }
    
    .daily-log-card .datetime-hour,
    .daily-log-card .datetime-minute,
    .daily-log-card .datetime-ampm {
        min-width: 60px;
        max-width: none;
    }
}

.daily-log-summary-item {
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 200px;
}

@media (max-width: 575.98px) {
    .daily-log-summary-item {
        flex: 1 1 50%;
        max-width: none;
        min-width: 0;
    }
}

@media (min-width: 1200px) {
    .daily-log-summary-item {
        flex: 0 1 auto;
    }
}

/* Daily Log Form Fields - Better Mobile Responsiveness */
.daily-log-card .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    word-wrap: break-word;
}

@media (max-width: 767.98px) {
    .daily-log-card .form-label {
        font-size: 0.8125rem;
    }
    
    .daily-log-card .form-control,
    .daily-log-card .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.625rem 0.75rem;
    }
    
    .daily-log-card .card-header h5 {
        font-size: 0.9375rem;
    }
    
    .daily-log-card .card-header h5 i {
        font-size: 0.875rem;
    }
}

/* Food Entry Responsive Improvements */
.food-entry .row > [class*="col-"] {
    margin-bottom: 0.75rem;
}

@media (max-width: 991.98px) {
    .food-entry .col-md-1 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .food-entry .col-md-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .food-entry .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .food-entry .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .food-entry .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Blood Pressure Responsive Improvements */
@media (max-width: 991.98px) {
    .daily-log-card .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 575.98px) {
    .daily-log-card .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Body Metrics Responsive Improvements */
@media (max-width: 991.98px) {
    .daily-log-card .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 575.98px) {
    .daily-log-card .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Main Content Grid - Better Tablet Support */
@media (max-width: 991.98px) {
    .daily-log-main-grid > .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Save Button - Better Mobile Visibility */
.daily-log-save-container {
    position: sticky;
    bottom: 0;
    background-color: var(--vt-bg);
    padding: 1rem 0;
    margin-top: 1.5rem;
    border-top: 1px solid var(--vt-border);
    z-index: 10;
}

@media (max-width: 767.98px) {
    .daily-log-save-container {
        padding: 0.75rem 0;
    }
    
    .daily-log-save-container .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

body.dark-mode .daily-log-save-container {
    background-color: var(--vt-dark-bg);
    border-top-color: var(--vt-border);
}

/* Prevent horizontal scroll on mobile */
.daily-log-form-container {
    overflow-x: hidden;
    max-width: 100%;
}

/* Better spacing for datetime pickers on mobile */
@media (max-width: 575.98px) {
    .datetime-hour,
    .datetime-minute,
    .datetime-ampm {
        font-size: 14px;
        padding: 0.5rem 0.375rem;
    }
}

/* Print Styles */
@media print {
    body.dark-mode {
        background-color: white !important;
        color: black !important;
    }
    body.dark-mode .card {
        background-color: white !important;
        border-color: #dee2e6 !important;
        color: black !important;
    }
    body.dark-mode .table {
        color: black !important;
    }
}

