﻿/* ASP.NET MVC Site Styles */

:root,
:root[data-theme="atlas"] {
    --site-bg: #ffffff;
    --site-surface: #ffffff;
    --site-surface-soft: #f8f9fa;
    --site-border: #e5e7eb;
    --site-header: #5b4bc4;
    --site-header-dark: #4535a4;
    --site-primary: #0d6efd;
    --site-primary-hover: #0b5ed7;
    --site-primary-soft: rgba(13, 110, 253, 0.15);
    --site-link: #4f46e5;
    --site-text: #1f2937;
}

:root[data-theme="morning"] {
    --site-bg: #f0fdfa;
    --site-surface: #ffffff;
    --site-surface-soft: #ccfbf1;
    --site-border: #99f6e4;
    --site-header: #0f766e;
    --site-header-dark: #115e59;
    --site-primary: #0284c7;
    --site-primary-hover: #0369a1;
    --site-primary-soft: rgba(2, 132, 199, 0.16);
    --site-link: #0f766e;
    --site-text: #134e4a;
}

:root[data-theme="midnight"] {
    --site-bg: #f5f3ff;
    --site-surface: #ffffff;
    --site-surface-soft: #ede9fe;
    --site-border: #ddd6fe;
    --site-header: #312e81;
    --site-header-dark: #1e1b4b;
    --site-primary: #7c3aed;
    --site-primary-hover: #6d28d9;
    --site-primary-soft: rgba(124, 58, 237, 0.16);
    --site-link: #6d28d9;
    --site-text: #2e1065;
}

:root[data-theme="high-contrast"] {
    --site-bg: #000000;
    --site-surface: #ffffff;
    --site-surface-soft: #f2f2f2;
    --site-border: #000000;
    --site-header: #000000;
    --site-header-dark: #000000;
    --site-primary: #005fcc;
    --site-primary-hover: #003f88;
    --site-primary-soft: rgba(255, 214, 10, 0.35);
    --site-link: #ffd60a;
    --site-text: #ffffff;
}

:root[data-theme="clear-day"] {
    --site-bg: #f8fafc;
    --site-surface: #ffffff;
    --site-surface-soft: #e0f2fe;
    --site-border: #bae6fd;
    --site-header: #075985;
    --site-header-dark: #0c4a6e;
    --site-primary: #0369a1;
    --site-primary-hover: #075985;
    --site-primary-soft: rgba(3, 105, 161, 0.18);
    --site-link: #075985;
    --site-text: #0f172a;
}

:root[data-theme="quiet-slate"] {
    --site-bg: #f8fafc;
    --site-surface: #ffffff;
    --site-surface-soft: #f1f5f9;
    --site-border: #cbd5e1;
    --site-header: #334155;
    --site-header-dark: #1e293b;
    --site-primary: #475569;
    --site-primary-hover: #334155;
    --site-primary-soft: rgba(71, 85, 105, 0.18);
    --site-link: #334155;
    --site-text: #0f172a;
}

body {
    background: var(--site-bg);
    color: var(--site-text);
}

a {
    color: var(--site-link);
}

a:hover {
    color: var(--site-primary-hover);
}

.site-navbar {
    background: linear-gradient(90deg, var(--site-header), var(--site-header-dark));
}

.card {
    background-color: var(--site-surface);
    border-color: var(--site-border);
}

.card-header {
    background-color: var(--site-surface-soft);
    border-bottom-color: var(--site-border);
}

:root[data-theme="high-contrast"] body {
    font-size: 1.0625rem;
}

:root[data-theme="high-contrast"] .card,
:root[data-theme="high-contrast"] .modal-content,
:root[data-theme="high-contrast"] .dropdown-menu,
:root[data-theme="high-contrast"] .bg-light {
    color: #000000;
}

:root[data-theme="high-contrast"] .card a,
:root[data-theme="high-contrast"] .modal-content a,
:root[data-theme="high-contrast"] .dropdown-menu a,
:root[data-theme="high-contrast"] .bg-light a {
    color: #003f88;
}

:root[data-theme="high-contrast"] .text-muted {
    color: #ffffff !important;
}

:root[data-theme="high-contrast"] .card .text-muted,
:root[data-theme="high-contrast"] .modal-content .text-muted,
:root[data-theme="high-contrast"] .dropdown-menu .text-muted,
:root[data-theme="high-contrast"] .bg-light .text-muted {
    color: #1a1a1a !important;
}

:root[data-theme="high-contrast"] .text-dark {
    color: #000000 !important;
}

:root[data-theme="high-contrast"] .site-navbar {
    border-bottom: 4px solid #ffd60a;
}

:root[data-theme="high-contrast"] .card,
:root[data-theme="high-contrast"] .form-control,
:root[data-theme="high-contrast"] .input-group-text {
    border-width: 2px;
}

:root[data-theme="high-contrast"] .nav-link,
:root[data-theme="high-contrast"] .navbar-brand,
:root[data-theme="high-contrast"] .navbar-brand:hover {
    color: #ffffff !important;
}

:root[data-theme="high-contrast"] .btn-primary,
:root[data-theme="high-contrast"] .btn-outline-primary:hover {
    color: #ffffff;
}

:root[data-theme="high-contrast"] a:focus,
:root[data-theme="high-contrast"] button:focus,
:root[data-theme="high-contrast"] .form-control:focus {
    outline: 3px solid #ffd60a;
    outline-offset: 2px;
}

.bg-light {
    background-color: var(--site-surface-soft) !important;
}

/* logo animation */
.logo-pulse {
    width: 1rem;
    height: 1rem;
    background-color: #0d6efd;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

/* Cycle indicators */
.cycle-indicator {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.legend-color {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.critical-indicator {
    width: 0.5rem;
    height: 0.5rem;
    background-color: #dc3545;
    border-radius: 50%;
    margin-right: 0.75rem;
}



/* Moon Phase Visuals */
.moon-indicator {
    font-size: 1.5rem;
}

.moon-event-indicator {
    font-size: 1.2rem;
}

.moon-phase-visual {
    padding: 20px;
}

.moon-circle {
    width: 80px;
    height: 80px;
    border: 3px solid #34495e;
    border-radius: 50%;
    position: relative;
    background: #2c3e50;
    margin: 0 auto;
    overflow: hidden;
}

.moon-illumination {
    height: 100%;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 50%;
    transition: width 0.3s ease;
}


/* Card hover effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

/* Navigation active state */
.nav-link.active {
    font-weight: 600;
    color: var(--site-primary) !important;
}

/* Chart container */
.biorhythm-chart-container {
    height: 520px;
}

.biorhythm-chart-container-advanced {
    height: 580px;
}

.advanced-search-settings {
    width: 100%;
    margin-left: auto;
}

.advanced-search-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.advanced-search-row label {
    width: 165px;
    flex: 0 0 165px;
}

.advanced-threshold-control {
    width: 232px !important;
    flex: 0 0 232px;
}

.advanced-threshold-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    max-width: 100%;
    margin-left: auto;
    margin-top: 20px;
    margin-bottom: 20px;
    margin-right: -75px;
}

.advanced-search-summary-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.advanced-search-summary {
    width: max-content;
    max-width: 100%;
    margin-bottom: 24px;
}

.advanced-day-control {
    width: 140px !important;
    flex: 0 0 140px;
}

@media (max-width: 430px) {
    .advanced-search-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .advanced-search-row label {
        width: auto;
        flex-basis: auto;
        text-align: left !important;
    }

    .advanced-threshold-control,
    .advanced-day-control {
        width: 100% !important;
        flex-basis: auto;
    }

    .advanced-threshold-container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        width: 100%;
        margin-right: 0;
    }

    .advanced-threshold-container label {
        text-align: left !important;
    }
}

#biorhythmChart {
    height: 100% !important;
    max-height: none;
}

/* Form validation styles (classic MVC) */
.field-validation-error {
    color: #dc3545;
    font-size: 0.875rem;
}

.field-validation-valid {
    display: none;
}

.input-validation-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.validation-summary-errors {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 0.375rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.validation-summary-valid {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-5 {
        font-size: 2rem;
    }

    .cycle-indicator,
    .legend-color {
        width: 0.6rem;
        height: 0.6rem;
    }
}

/* Bootstrap utility additions */
.text-decoration-none:hover {
    text-decoration: none !important;
}

/* Custom button styles */
.btn-primary {
    background-color: var(--site-primary);
    border-color: var(--site-primary);
}

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

.btn-outline-primary {
    color: var(--site-primary);
    border-color: var(--site-primary);
}

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

/* Form control focus */
.form-control:focus {
    border-color: var(--site-primary);
    box-shadow: 0 0 0 0.25rem var(--site-primary-soft);
}

/* Alert styles for warnings */
.border-warning {
    border-color: #ffc107 !important;
}

.bg-warning.bg-opacity-10 {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

.bg-warning.bg-opacity-25 {
    background-color: rgba(255, 193, 7, 0.25) !important;
}

/* Classic MVC form styling */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* Navbar brand link styling */
/*.navbar-brand {
    text-decoration: none;
    color: inherit;
}*/

.navbar-brand:hover {
    text-decoration: none;
    color: inherit;
}

/* Header shadow */
header.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: 0.015em;
    color: #0d6efd;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /*gap: 0.6rem;*/
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    /*width: 100%;*/ /* Ensures full-width for centering */
    width: 75%;
    padding: 1rem 0; /* Optional: adds vertical breathing room */
}

.brand-logo-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    flex: 0 0 auto;
}

.logo-pulse {
    width: 32px; /* Slightly larger to match the bigger text */
    height: 32px;
    /*background: radial-gradient(circle, #0d6efd 40%, transparent 41%);*/
    background: radial-gradient(circle, white 40%, transparent 41%);
    border-radius: 50%;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}


/* Logo animation */
.logo-wave {
    width: 1.5rem;
    height: 0.8rem;
    position: relative;
    overflow: hidden;
}

    .logo-wave::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, #0d6efd, transparent);
        border-radius: 0.4rem;
        animation: wave 2s infinite;
    }

@keyframes wave {
    0% {
        left: -100%;
    }

    50% {
        left: 100%;
    }

    100% {
        left: -100%;
    }
}

.theme-option {
    border: 1px solid var(--site-border);
    border-radius: 8px;
    background: var(--site-surface);
    color: var(--site-text);
    padding: 1rem;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

    .theme-option:hover,
    .theme-option.active {
        border-color: var(--site-primary);
        box-shadow: 0 0 0 0.25rem var(--site-primary-soft);
        transform: translateY(-1px);
    }

.theme-swatch-row {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.theme-swatch {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-name {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.theme-description {
    display: block;
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.35;
}
