/* 
 * Scientific Theme - Modern Academic UI (Enhanced)
 * Palette: Black, White, Yellow (#eab308), Green (#22c55e)
 * Design: High Contrast, Dynamic, Professional
 */

:root {
    /* Brand */
    --primary: #eab308;
    --primary-hover: #ca8a04;
    --primary-light: #fef3c7;
    --success: #22c55e;
    --success-hover: #16a34a;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #38bdf8;

    /* Neutrals */
    --dark: #0b0f17;
    --dark-surface: #121826;
    --dark-hover: #1c2434;
    --white: #ffffff;
    --light: #f4f1ea;

    /* Surfaces */
    --surface-page: #f4f1ea;
    --surface-card: #ffffff;
    --surface-card-alt: #f8fafc;
    --surface-card-soft: #e9eef5;
    --surface-hero: #0f131b;
    --surface-hero-alt: #192131;
    --surface-footer: #0f141d;
    --surface-footer-alt: #181f2c;
    --surface-overlay: rgba(255, 255, 255, 0.92);
    --input-bg: #ffffff;

    /* Typography */
    --text-primary: #111827;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    /* Borders */
    --border-light: #d8e1eb;
    --border-dark: #475569;
    --border-strong: #94a3b8;

    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(234, 179, 8, 0.3);
    --shadow-glow-success: 0 0 20px rgba(34, 197, 94, 0.3);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ================================
   Base Typography & Reset
   ================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--surface-page);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

/* ================================
   Utility Classes - High Contrast
   ================================ */
.text-primary-color {
    color: var(--primary) !important;
}

.text-success-color {
    color: var(--success) !important;
}

.text-dark {
    color: var(--text-primary) !important;
}

.text-light {
    color: var(--text-inverse) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.bg-dark-scientific {
    background-color: var(--dark) !important;
    color: var(--white) !important;
}

.bg-primary-subtle {
    background-color: var(--primary-light) !important;
    color: var(--dark) !important;
}

.bg-success-subtle {
    background-color: var(--success-light) !important;
    color: var(--dark) !important;
}

/* ================================
   Animated Background (Hero Sections)
   ================================ */
.hero-animated {
    position: relative;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-surface) 50%, var(--dark) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    overflow: hidden;
}

.hero-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(234, 179, 8, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(34, 197, 94, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Floating Particles Effect */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 20s infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.particle:nth-child(2) {
    left: 25%;
    animation-delay: 2s;
    animation-duration: 20s;
}

.particle:nth-child(3) {
    left: 40%;
    animation-delay: 4s;
    animation-duration: 28s;
}

.particle:nth-child(4) {
    left: 55%;
    animation-delay: 1s;
    animation-duration: 22s;
}

.particle:nth-child(5) {
    left: 70%;
    animation-delay: 3s;
    animation-duration: 24s;
}

.particle:nth-child(6) {
    left: 85%;
    animation-delay: 5s;
    animation-duration: 26s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.4;
    }

    90% {
        opacity: 0.4;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ================================
   Buttons - Enhanced
   ================================ */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #000000 !important;
}

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #000000 !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
    color: #ffffff !important;
}

.btn-success:hover {
    background-color: var(--success-hover) !important;
    border-color: var(--success-hover) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-success);
}

.btn-outline-primary {
    color: var(--primary) !important;
    border: 2px solid var(--primary) !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary) !important;
    color: #000000 !important;
    transform: translateY(-2px);
}

.btn-outline-dark {
    color: var(--text-primary) !important;
    border: 2px solid var(--border-strong) !important;
    background: transparent !important;
}

.btn-outline-dark:hover {
    background-color: var(--surface-hero) !important;
    color: var(--text-inverse) !important;
    border-color: var(--surface-hero) !important;
    transform: translateY(-2px);
}

.btn-outline-light {
    color: var(--white) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    background: transparent !important;
}

.btn-outline-light:hover {
    background-color: var(--white) !important;
    color: var(--surface-hero) !important;
    border-color: var(--white) !important;
    transform: translateY(-2px);
}

/* ================================
   Navbar - Enhanced
   ================================ */
.navbar {
    background: linear-gradient(135deg, var(--surface-card) 0%, var(--surface-card-alt) 100%) !important;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-weight: 800;
    color: var(--primary) !important;
    font-size: 1.5rem;
    transition: all var(--transition-fast);
}

.navbar-brand:hover {
    color: var(--primary-hover) !important;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary) !important;
    background-color: var(--surface-card-alt);
}

.nav-link.active {
    color: var(--primary-hover) !important;
    background-color: var(--primary-light);
}

.dropdown-menu {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    color: var(--text-primary);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--surface-card-alt);
    color: var(--text-primary);
}

/* ================================
   Forms - High Contrast Enforced
   ================================ */
.form-label,
label {
    color: var(--text-primary) !important;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control,
.form-select {
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary) !important;
    background-color: var(--input-bg) !important;
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.2);
    outline: none;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}

.form-text {
    color: var(--text-muted) !important;
}

/* ================================
   Cards - Enhanced with Hover Effects
   ================================ */
.card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--surface-card);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-xl);
}

.card-header {
    background-color: var(--surface-card);
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary) !important;
}

.card-body {
    color: var(--text-primary) !important;
}

/* Feature Cards with Glow Hover */
.feature-card {
    background: var(--surface-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--success) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.feature-card:hover::before {
    opacity: 0.05;
}

.feature-card .icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.5rem;
    transition: all var(--transition-normal);
}

.feature-card .icon.primary {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.feature-card .icon.success {
    background: var(--success-light);
    color: var(--success-hover);
}

.feature-card:hover .icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h5 {
    color: var(--text-primary) !important;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary) !important;
    margin-bottom: 0;
}

/* ================================
   Navigation Tabs - Enhanced
   ================================ */
.nav-tabs {
    border-bottom: 2px solid var(--border-light);
    background: var(--surface-card-alt);
    padding: 0.75rem 1rem 0;
    gap: 0.5rem;
    display: flex;
    flex-wrap: wrap;
}

.nav-tabs .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 1rem 1.5rem;
    background: transparent;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-tabs .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary);
    transition: all var(--transition-fast);
    transform: translateX(-50%);
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary) !important;
    background: var(--surface-card-soft);
}

.nav-tabs .nav-link:hover::after {
    width: 50%;
}

.nav-tabs .nav-link.active {
    color: var(--text-inverse) !important;
    background-color: var(--surface-hero) !important;
}

.nav-tabs .nav-link.active::after {
    width: 100%;
    background: var(--primary);
}

/* ================================
   Tables - High Contrast
   ================================ */
.table {
    color: var(--text-primary) !important;
}

.table thead th {
    background: var(--surface-card-alt);
    color: var(--text-primary) !important;
    font-weight: 700;
    border-bottom: 2px solid var(--border-light);
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: var(--primary-light) !important;
}

.table td {
    color: var(--text-primary) !important;
    vertical-align: middle;
}

/* ================================
   Badges - High Contrast
   ================================ */
.badge {
    font-weight: 600;
    padding: 0.5em 0.75em;
    border-radius: var(--radius-sm);
}

.badge.bg-primary,
.badge.bg-warning {
    color: #000000 !important;
    background-color: var(--primary) !important;
}

.badge.bg-success {
    color: #ffffff !important;
    background-color: var(--success) !important;
}

.badge.bg-dark {
    color: var(--text-inverse) !important;
    background-color: var(--surface-hero) !important;
}

.badge.bg-light {
    color: var(--text-primary) !important;
    background-color: var(--surface-card-alt) !important;
    border: 1px solid var(--border-light);
}

/* ================================
   Alerts - High Contrast
   ================================ */
.alert {
    border-radius: var(--radius-md);
    border: none;
    font-weight: 500;
}

.alert-success {
    background-color: var(--success-light) !important;
    color: #166534 !important;
}

.alert-warning {
    background-color: var(--primary-light) !important;
    color: #854d0e !important;
}

.alert-light {
    background-color: var(--surface-card-alt) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-light) !important;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.14) !important;
    color: var(--danger) !important;
}

.modal-content {
    background: var(--surface-card);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

/* ================================
   Footer - Enhanced
   ================================ */
footer {
    background: linear-gradient(180deg, var(--surface-card-alt) 0%, var(--surface-card) 100%);
    color: var(--text-secondary);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
    border-top: 1px solid var(--border-light);
}

footer h5 {
    color: var(--text-primary) !important;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

footer a {
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

footer a:hover {
    color: var(--primary) !important;
    padding-inline-start: 5px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-card-alt);
    color: var(--text-primary) !important;
    border: 1px solid var(--border-light);
    margin-inline-end: 0.5rem;
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--primary);
    color: #000 !important;
    transform: translateY(-3px);
}

.policy-note {
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.18);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.footer-status-badge {
    background: var(--primary-light);
    color: var(--text-primary);
    border: 1px solid rgba(234, 179, 8, 0.28);
    padding: 0.5rem 0.85rem;
    font-weight: 700;
}

/* ================================
   Progress Bars
   ================================ */
.progress {
    height: 8px;
    border-radius: var(--radius-sm);
    background-color: var(--surface-card-soft);
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

.progress-bar.bg-primary {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%) !important;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, var(--success) 0%, var(--success-hover) 100%) !important;
}

/* ================================
   Tooltips & Popovers
   ================================ */
.tooltip-inner {
    background-color: var(--dark);
    color: var(--white);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

/* ================================
   Loading Spinner
   ================================ */
.spinner-border {
    width: 1.25rem;
    height: 1.25rem;
}

/* ================================
   Scrollbar Styling
   ================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface-page);
}

::-webkit-scrollbar-thumb {
    background: #a3a3a3;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
        width: 100%;
    }

    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0.5rem;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    footer {
        text-align: center;
    }
}

/* ================================
   Animations
   ================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ================================
   Skeleton Loaders
   ================================ */
@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-loader {
    background: linear-gradient(90deg,
            var(--surface-card-soft) 25%,
            rgba(148, 163, 184, 0.4) 50%,
            var(--surface-card-soft) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
    border-radius: var(--radius-md);
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-text {
    height: 1rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

.skeleton-text-short {
    height: 1rem;
    width: 75%;
    margin-bottom: 0.5rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

/* Progress Steps */
.ai-progress-step {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    background: var(--surface-card-alt);
    border-right: 4px solid var(--border-light);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-progress-step.active {
    background: var(--primary-light);
    border-right-color: var(--primary);
}

.ai-progress-step.done {
    background: var(--success-light);
    border-right-color: var(--success);
}

.ai-progress-step .step-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

/* ================================
   Print Styles
   ================================ */
@media print {

    .btn,
    .navbar,
    .nav-tabs,
    footer {
        display: none !important;
    }

    .card {
        border: 1px solid #000;
        box-shadow: none;
    }

    body {
        background: white;
    }
}
