/* ============================================
   E-SAĞLIK - MAIN STYLES
   Modern, Clean & Dark Mode Ready
   ============================================ */

/* ============================================
   CSS VARIABLES - LIGHT THEME (Default)
   ============================================ */
:root,
[data-bs-theme="light"] {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --primary-rgb: 13, 110, 253;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    
    --border-color: #dee2e6;
    --border-light: #f1f3f5;
    
    --card-bg: #ffffff;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --card-shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-text: #212529;
    
    --bottom-nav-bg: #ffffff;
    --bottom-nav-border: #dee2e6;
    
    --fab-bg: linear-gradient(135deg, #198754, #146c43);
    --fab-shadow: rgba(25, 135, 84, 0.4);
    
    --link-color: #0d6efd;
    --link-hover: #0b5ed7;
    
    --success-bg: rgba(25, 135, 84, 0.1);
    --info-bg: rgba(13, 202, 240, 0.1);
    --warning-bg: rgba(255, 193, 7, 0.1);
    --danger-bg: rgba(220, 53, 69, 0.1);
    
    --table-striped: rgba(0, 0, 0, 0.02);
    --table-hover: rgba(0, 0, 0, 0.04);
    
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #c1c1c1;
}

/* ============================================
   CSS VARIABLES - DARK THEME
   ============================================ */
[data-bs-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    --border-color: #30363d;
    --border-light: #21262d;
    
    --card-bg: #161b22;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
    
    --nav-bg: rgba(22, 27, 34, 0.95);
    --nav-text: #e6edf3;
    
    --bottom-nav-bg: #161b22;
    --bottom-nav-border: #30363d;
    
    --fab-bg: linear-gradient(135deg, #238636, #1a7f37);
    --fab-shadow: rgba(35, 134, 54, 0.4);
    
    --link-color: #58a6ff;
    --link-hover: #79b8ff;
    
    --success-bg: rgba(35, 134, 54, 0.2);
    --info-bg: rgba(56, 139, 253, 0.2);
    --warning-bg: rgba(227, 179, 65, 0.2);
    --danger-bg: rgba(218, 54, 51, 0.2);
    
    --table-striped: rgba(255, 255, 255, 0.03);
    --table-hover: rgba(255, 255, 255, 0.06);
    
    --scrollbar-track: #21262d;
    --scrollbar-thumb: #484f58;
}

/* Dark mode compatibility helper for bg-light (useful for dynamic AI contents) */
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Force light font colors in AI-interpreted containers under dark theme */
[data-bs-theme="dark"] .analiz-content,
[data-bs-theme="dark"] .analiz-container,
[data-bs-theme="dark"] #ai-content,
[data-bs-theme="dark"] .list-group-item {
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .analiz-content *,
[data-bs-theme="dark"] .analiz-container *,
[data-bs-theme="dark"] #ai-content *,
[data-bs-theme="dark"] .list-group-item * {
    color: inherit;
}

/* Force light color for elements with inline color styles */
[data-bs-theme="dark"] .analiz-content [style*="color"],
[data-bs-theme="dark"] .analiz-container [style*="color"],
[data-bs-theme="dark"] #ai-content [style*="color"],
[data-bs-theme="dark"] .list-group-item [style*="color"] {
    color: var(--text-primary) !important;
}

/* Override Bootstrap dark text utility classes */
[data-bs-theme="dark"] .analiz-content .text-dark,
[data-bs-theme="dark"] .analiz-content .text-black,
[data-bs-theme="dark"] .analiz-content .text-body,
[data-bs-theme="dark"] .analiz-container .text-dark,
[data-bs-theme="dark"] .analiz-container .text-black,
[data-bs-theme="dark"] #ai-content .text-dark,
[data-bs-theme="dark"] #ai-content .text-black,
[data-bs-theme="dark"] .list-group-item .text-dark,
[data-bs-theme="dark"] .list-group-item .text-black {
    color: var(--text-primary) !important;
}

/* Ensure all headings in AI containers have high-contrast text */
[data-bs-theme="dark"] .analiz-content h1,
[data-bs-theme="dark"] .analiz-content h2,
[data-bs-theme="dark"] .analiz-content h3,
[data-bs-theme="dark"] .analiz-content h4,
[data-bs-theme="dark"] .analiz-content h5,
[data-bs-theme="dark"] .analiz-content h6,
[data-bs-theme="dark"] .analiz-container h1,
[data-bs-theme="dark"] .analiz-container h2,
[data-bs-theme="dark"] .analiz-container h3,
[data-bs-theme="dark"] .analiz-container h4,
[data-bs-theme="dark"] .analiz-container h5,
[data-bs-theme="dark"] .analiz-container h6,
[data-bs-theme="dark"] #ai-content h1,
[data-bs-theme="dark"] #ai-content h2,
[data-bs-theme="dark"] #ai-content h3,
[data-bs-theme="dark"] #ai-content h4,
[data-bs-theme="dark"] #ai-content h5,
[data-bs-theme="dark"] #ai-content h6,
[data-bs-theme="dark"] .list-group-item h1,
[data-bs-theme="dark"] .list-group-item h2,
[data-bs-theme="dark"] .list-group-item h3,
[data-bs-theme="dark"] .list-group-item h4,
[data-bs-theme="dark"] .list-group-item h5,
[data-bs-theme="dark"] .list-group-item h6 {
    color: var(--text-primary) !important;
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background-color: var(--nav-bg) !important;
    transition: all 0.3s ease;
}

.navbar-brand {
    color: var(--nav-text) !important;
    font-weight: 700;
}

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

.nav-link {
    color: var(--nav-text) !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

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

.nav-link.active {
    background-color: var(--bg-tertiary);
    color: var(--primary-color) !important;
    font-weight: 600;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--card-bg);
        padding: 1rem;
        border-radius: 1rem;
        margin-top: 0.75rem;
        box-shadow: var(--card-shadow-hover);
    }
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a4fd4 100%) !important;
    border-top: none;
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] .bottom-nav {
    background: linear-gradient(135deg, #0d6efd 0%, #084298 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-nav .nav {
    justify-content: space-around;
}

.bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.5rem !important;
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.7) !important;
    transition: all 0.3s ease;
}

.bottom-nav .nav-link i {
    font-size: 1.3rem;
    margin-bottom: 0.125rem;
}

.bottom-nav .nav-link small {
    font-size: 0.6rem;
    font-weight: 500;
}

.bottom-nav .nav-link:hover,
.bottom-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

.bottom-nav .nav-link.active {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body {
    padding-bottom: 5.5rem;
}

@media (min-width: 992px) {
    body {
        padding-bottom: 0;
    }
    
    .bottom-nav {
        display: none !important;
    }
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay:not(.active) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
.btn-floating {
    position: fixed;
    bottom: 5.5rem;
    left: 1.25rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s ease;
    z-index: 1035;
}

.btn-floating.show {
    opacity: 1;
    transform: translateY(0);
}

.btn-floating:hover {
    transform: translateY(-0.25rem);
}

@media (min-width: 992px) {
    .btn-floating {
        bottom: 2rem;
        left: 2rem;
    }
}

/* FAB Modal Styles */
#fabModal .modal-content {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

#fabModal .modal-sm {
    max-width: 320px;
}

#fabModal .modal-body .btn {
    justify-content: flex-start;
    padding: 1rem 1.5rem;
}

#fabModal .modal-body .btn i {
    width: 2rem;
}

/* ============================================
   FAB BUTTON - DESKTOP
   ============================================ */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1040;
}

.fab {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

.fab-menu {
    position: absolute;
    bottom: 4.5rem;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.fab-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fab-sub {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
    text-decoration: none;
}

.fab-sub:hover {
    transform: scale(1.15) translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.fab-sub.psi { background: #a5d6a7; color: #2e7d32; }
.fab-sub.doc { background: #90caf9; color: #1565c0; }
.fab-sub.upload { background: #fff3cd; color: #856404; }

/* ============================================
   FAB BUTTON - MOBILE
   ============================================ */
.fab-container-mobile {
    position: fixed;
    bottom: 5.5rem;
    right: 1.25rem;
    z-index: 1040;
}

.fab-container-mobile .fab {
    width: 3.5rem;
    height: 3.5rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-0.125rem);
}

.card-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.card-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.card-img-top {
    object-fit: cover;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    color: var(--text-primary);
}

.table-light {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary);
}

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

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

/* Mobile Table Card View */
@media (max-width: 767.98px) {
    .table-responsive-card {
        display: none;
    }
    
    .table-card-view {
        display: block !important;
    }
    
    .table-card {
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 0.75rem;
        padding: 1rem;
        margin-bottom: 1rem;
        border-left: 4px solid var(--primary-color);
    }
    
    .table-card-header {
        font-weight: 600;
        color: var(--primary-color);
        margin-bottom: 0.75rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .table-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .table-card-item {
        display: flex;
        flex-direction: column;
    }
    
    .table-card-label {
        font-size: 0.75rem;
        color: var(--text-secondary);
    }
    
    .table-card-value {
        font-weight: 500;
    }
    
    .table-card-value.high { color: #dc3545; }
    .table-card-value.low { color: #ffc107; }
    .table-card-value.normal { color: #198754; }
}

@media (min-width: 768px) {
    .table-responsive-card {
        display: block;
    }
    
    .table-card-view {
        display: none !important;
    }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    border-radius: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-0.0625rem);
}

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

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

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

.btn-success {
    background-color: #198754;
    border-color: #198754;
}

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

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

/* Touch Optimization */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
    }
    
    .btn-lg {
        min-height: 52px;
    }
}

/* ============================================
   FORMS
   ============================================ */
.form-control,
.form-select {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.form-check-input {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.input-group-text {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: 0.75rem;
    border: none;
}

.alert-info {
    background-color: var(--info-bg);
    color: var(--primary-color);
}

.alert-success {
    background-color: var(--success-bg);
    color: #198754;
}

.alert-warning {
    background-color: var(--warning-bg);
    color: #b38600;
}

.alert-danger {
    background-color: var(--danger-bg);
    color: #dc3545;
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    border-radius: 1rem 1rem 0 0;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    border-radius: 0 0 1rem 1rem;
}

.modal-backdrop.show {
    background-color: rgba(0, 0, 0, 0.6);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

footer .text-body-secondary {
    color: var(--text-secondary) !important;
}

/* ============================================
   LINKS & TEXT
   ============================================ */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

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

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

/* ============================================
   BADGES
   ============================================ */
.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

.badge.bg-secondary {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* ============================================
   BORDERS
   ============================================ */
.border,
.border-top,
.border-bottom,
.border-start,
.border-end {
    border-color: var(--border-color) !important;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 0.5rem;
    height: 0.5rem;
}

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

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 0.25rem;
}

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

/* ============================================
   BLOG STYLES
   ============================================ */
.blog-container {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.section-title {
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3rem;
    height: 0.25rem;
    background-color: var(--primary-color);
    border-radius: 0.125rem;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.tag-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
}

.tag-item.active {
    background-color: var(--primary-color);
    color: white;
}

.author-box {
    background-color: var(--bg-secondary);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 1rem;
}

.search-header,
.category-header,
.tag-header,
.author-header {
    background-color: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.hero-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
}

/* ============================================
   CONTRACTS
   ============================================ */
.contract-text h6 {
    color: var(--text-primary);
}

.contract-text p,
.contract-text li {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 575.98px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(0.5rem); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .glass {
    background: rgba(0, 0, 0, 0.2);
}

.rounded-4 {
    border-radius: 1rem !important;
}

.rounded-5 {
    border-radius: 1.25rem !important;
}

/* ============================================
   GRADIENT BUTTONS
   ============================================ */
.btn-gradient-teal,
.btn-gradient-blue {
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-gradient-teal {
    background: linear-gradient(135deg, #20c997, #0dcaf0);
}

.btn-gradient-teal:hover {
    background: linear-gradient(135deg, #0dcaf0, #20c997);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(32, 201, 151, 0.3);
}

.btn-gradient-blue {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
}

.btn-gradient-blue:hover {
    background: linear-gradient(135deg, #0a58ca, #0d6efd);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(13, 110, 253, 0.3);
}

/* ============================================
   HOVER ELEVATE
   ============================================ */
.hover-elevate {
    transition: all 0.3s ease;
}

.hover-elevate:hover {
    transform: translateY(-4px);
}

/* ============================================
   ANIMATE CSS COMPATIBILITY
   ============================================ */
.animate__animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animate__pulse {
    animation-name: pulse;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* ============================================
   OPACITY HELPERS
   ============================================ */
.opacity-75 {
    opacity: 0.75;
}

/* ============================================
   ICON SIZES
   ============================================ */
.fa-2x {
    font-size: 2em;
}

/* ============================================
   SPECIAL MODAL STYLES
   ============================================ */
.modal-header.bg-primary {
    background: linear-gradient(135deg, #0d6efd, #0a58ca) !important;
}

.modal-header.bg-success {
    background: linear-gradient(135deg, #198754, #146c43) !important;
}

/* ============================================
   TEXT LIGHT EMPHASIS
   ============================================ */
.text-light-emphasis {
    color: rgba(255, 255, 255, 0.75);
}

/* Dropdown */
.dropdown-menu {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: var(--card-shadow-hover);
}

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

.dropdown-item:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

/* Pagination */
.page-link {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--primary-color);
}

.page-link:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.page-item.disabled .page-link {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* Tooltip */
.tooltip-inner {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* List Group */
.list-group-item {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.list-group-item:hover {
    background-color: var(--bg-secondary);
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Progress */
.progress {
    background-color: var(--bg-secondary);
}

/* Blockquote */
.blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    color: var(--text-secondary);
}

/* Code */
code {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

/* ============================================
   AUTH PAGES (Login & Signup)
   Mobile-first responsive design
   ============================================ */

/* Auth Page Background */
.auth-page {
    position: relative;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    overflow: hidden;
    background: linear-gradient(135deg, #0d6efd 0%, #198754 50%, #0a58ca 100%);
}

[data-bs-theme="dark"] .auth-page {
    background: linear-gradient(135deg, #0a4fd4 0%, #146c43 50%, #084298 100%);
}

/* Background Shapes */
.auth-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: authFloat 20s ease-in-out infinite;
}

.auth-shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #ffffff, rgba(255, 255, 255, 0.5));
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.auth-shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #20c997, rgba(32, 201, 151, 0.5));
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}

.auth-shape-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #0dcaf0, rgba(13, 202, 240, 0.5));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes authFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* Auth Container */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

/* Auth Card */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2), 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-bs-theme="dark"] .auth-card {
    background: rgba(22, 27, 34, 0.95);
    border-color: rgba(48, 54, 61, 0.5);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.4), 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

/* Auth Logo */
.auth-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    background: linear-gradient(135deg, #0d6efd, #198754);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.5rem 1.5rem rgba(13, 110, 253, 0.4);
}

.auth-logo i {
    font-size: 2rem;
    color: #ffffff;
}

/* Auth Title */
.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Auth Input Groups */
.auth-input-group .input-group-text {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-right: none;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem 0 0 0.75rem;
    transition: all 0.2s ease;
}

.auth-input-group .form-control {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: none;
    padding: 0.75rem 1rem;
    border-radius: 0 0.75rem 0.75rem 0;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.auth-input-group > .form-control:not(:last-child) {
    border-right: none;
    border-radius: 0 !important;
}

.auth-input-group .form-control:focus {
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
    box-shadow: none;
}

.auth-input-group:focus-within .input-group-text {
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

/* Password Toggle */
.auth-password-toggle {
    background-color: var(--bg-tertiary);
    border-left: none;
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-input-group > .auth-password-toggle.input-group-text {
    border-radius: 0 0.75rem 0.75rem 0 !important;
}

.auth-input-group:focus-within .auth-password-toggle {
    border-color: var(--primary-color);
}

.auth-password-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

/* Auth Links */
.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Social Buttons */
.auth-social-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    min-height: 48px;
}

.btn-social:hover {
    background-color: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

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

.btn-social-google:hover {
    border-color: #4285f4;
    color: #4285f4;
}

.btn-social-apple:hover {
    border-color: #000000;
    color: #000000;
}

[data-bs-theme="dark"] .btn-social-apple:hover {
    color: #ffffff;
}

/* Gradient Primary Button */
.btn-gradient-primary {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border: none;
    color: #ffffff;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-height: 52px;
}

.btn-gradient-primary:hover {
    background: linear-gradient(135deg, #0a58ca, #0d6efd);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(13, 110, 253, 0.3);
}

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

/* Auth Large Button */
.btn-auth-lg {
    width: 100%;
}

/* Auth Alerts */
.auth-alert {
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
}

/* Tablet Styles */
@media (min-width: 576px) {
    .auth-card {
        padding: 2.5rem 2rem;
    }

    .auth-title {
        font-size: 2rem;
    }

    .auth-logo {
        width: 80px;
        height: 80px;
    }

    .auth-logo i {
        font-size: 2.25rem;
    }
}

/* Desktop Styles - Split Screen Layout */
@media (min-width: 992px) {
    .auth-page {
        min-height: calc(100vh - 100px);
        padding: 0;
        display: grid;
        grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
        background: var(--bg-primary);
        align-items: stretch;
        overflow-x: hidden;
        overflow-y: visible;
    }

    /* Left Sidebar */
    .auth-sidebar {
        background: linear-gradient(135deg, #0d6efd 0%, #198754 50%, #0a58ca 100%);
        position: relative;
        overflow: hidden;
        padding: 4rem;
    }

    .auth-sidebar-content {
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
        max-width: 500px;
    }

    .auth-sidebar-logo {
        width: 80px;
        height: 80px;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    .auth-sidebar-logo i {
        font-size: 2.5rem;
        color: #ffffff;
    }

    .auth-sidebar-title {
        font-size: 2.5rem;
        font-weight: 800;
        color: #ffffff;
        letter-spacing: -0.02em;
    }

    .auth-sidebar-text {
        font-size: 1.25rem;
        color: rgba(255, 255, 255, 0.85);
        font-weight: 400;
    }

    /* Features */
    .auth-features {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .auth-feature {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
    }

    .auth-feature-icon {
        width: 50px;
        height: 50px;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .auth-feature-icon i {
        font-size: 1.5rem;
        color: #ffffff;
    }

    .auth-feature-text h5 {
        font-size: 1.1rem;
        font-weight: 600;
        color: #ffffff;
        margin-bottom: 0.25rem;
    }

    .auth-feature-text p {
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.75);
        margin-bottom: 0;
    }

    /* Sidebar Shapes */
    .auth-sidebar-shapes {
        position: absolute;
        inset: 0;
        overflow: hidden;
        pointer-events: none;
    }

    .auth-sidebar-shape {
        position: absolute;
        border-radius: 50%;
        opacity: 0.1;
        animation: authFloat 20s ease-in-out infinite;
    }

    .shape-1 {
        width: 400px;
        height: 400px;
        background: #ffffff;
        top: -150px;
        right: -100px;
        animation-delay: 0s;
    }

    .shape-2 {
        width: 300px;
        height: 300px;
        background: #ffffff;
        bottom: -100px;
        left: -50px;
        animation-delay: -7s;
    }

    .shape-3 {
        width: 200px;
        height: 200px;
        background: #ffffff;
        top: 50%;
        right: 20%;
        animation-delay: -14s;
    }

    /* Right Side Container */
    .auth-container {
        grid-column: 2;
        width: 100%;
        max-width: none;
        min-width: 0;
        padding: 2rem clamp(1.5rem, 5vw, 4rem);
        background: var(--bg-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        justify-self: stretch;
    }

    .auth-card {
        width: 100%;
    }

    .auth-card-desktop {
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 1.5rem;
        padding: 2.5rem 2rem;
        box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.08);
        max-width: 520px;
    }

    [data-bs-theme="dark"] .auth-card-desktop {
        box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3);
    }

    .auth-card-desktop .auth-header {
        margin-bottom: 2rem;
    }

    .auth-card-desktop .auth-title {
        font-size: 1.875rem;
        font-weight: 700;
    }

    .auth-card-desktop .auth-subtitle {
        font-size: 1rem;
    }

    .auth-shape-1 {
        width: 400px;
        height: 400px;
    }

    .auth-shape-2 {
        width: 300px;
        height: 300px;
    }

    .auth-shape-3 {
        width: 200px;
        height: 200px;
    }
}

@media (min-width: 1200px) {
    .auth-sidebar {
        padding: 5rem;
    }

    .auth-container {
        padding: 3rem clamp(2rem, 5vw, 5rem);
    }

    .auth-card-desktop {
        padding: 3rem 2.5rem;
        max-width: 540px;
    }
}

@media (min-width: 1400px) {
    .auth-container {
        padding: 3rem clamp(2.5rem, 6vw, 6rem);
    }

    .auth-card-desktop {
        padding: 3rem;
        max-width: 560px;
    }
}

/* Touch Device Optimizations */
@media (pointer: coarse) {
    .auth-input-group .form-control {
        font-size: 16px;
    }

    .btn-social,
    .btn-gradient-primary {
        min-height: 52px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .auth-shape {
        animation: none;
    }

    .auth-card,
    .btn-social,
    .btn-gradient-primary {
        transition: none;
    }
}

/* Social Login Modal */
.social-modal-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0d6efd, #198754);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-modal-icon i {
    font-size: 2.5rem;
    color: #ffffff;
}

#socialLoginModal .modal-content {
    border: none;
    border-radius: 1.5rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
}

#socialLoginModal .modal-footer {
    padding-top: 0;
    padding-bottom: 1.5rem;
}
