@import url('quill_overrides.css');

/* =========================================
   1. VARIABLES & THEME SETTINGS
   ========================================= */
:root {
    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --primary: #1e40af;
    /* Trably Blue Default */
}

/* Dark Mode Overrides */
.dark :root {
    --glass-bg: rgba(15, 23, 42, 0.8);
    /* Slate 900 with opacity */
    --glass-border: rgba(51, 65, 85, 0.5);
    /* Slate 700 with opacity */
    --primary: #60a5fa;
    /* Blue 400 */
}

/* =========================================
   2. ANIMATIONS & LOADERS
   ========================================= */
/* Animation spinner premium */
.loading-spinner {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

/* Spinner plus petit pour les sections */
.section-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 2px;
    border-style: solid;
    border-color: rgba(59, 130, 246, 0.1);
    border-top-color: #3b82f6;
    /* trably-blue-light */
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {

        transform: rotate(360deg);
    }
}

/* =========================================
   ACCOUNT PAGE / DASHBOARD STYLES
   ========================================= */

/* Glassmorphism Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.dark .glass-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Gradient Text */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(to right, #3B82F6, #8B5CF6);
}

.dark .text-gradient {
    background-image: linear-gradient(to right, #60A5FA, #A78BFA);
}

/* Avatar Glow */
.avatar-glow {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.dark .avatar-glow {
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.2);
}

/* Vertical Timeline Styling */
#log-list li {
    position: relative;
    padding-left: 4rem;
    padding-bottom: 2rem;
}

#log-list li:last-child {
    padding-bottom: 0;
}

/* Icon container for timeline */
#log-list li .icon-box {
    position: absolute;
    left: 0;
    top: 0;
    height: 3rem;
    width: 3rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background-color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
    font-size: 1.25rem;
}

.dark #log-list li .icon-box {
    border-color: #334155;
    background-color: #1e293b;
}

/* Floating Branding (Fixed Bottom Right) */
.fixed-bottom-branding {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 8px 16px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Stronger shadow */
    transition: all 0.3s ease;
    z-index: 9999;
    /* Ensure on top */
}

.dark .fixed-bottom-branding {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(51, 65, 85, 0.8);
}

.fixed-bottom-branding:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.branding-text {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
}

.branding-logo {
    height: 14px;
    width: auto;
}


.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   3. TABLE RESPONSIVENESS & UTILS
   ========================================= */
/* Styles pour le retour à la ligne dans les cellules */
.table-responsive-card td>div.value-container {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-all;
    /* Force break even for long words/paths */
    height: auto;
    min-width: 50%;
    max-width: 100%;
    text-align: right;
    vertical-align: middle;
    display: inline-block;
}

/* Spécifique pour description et prescriptions pour forcer l'alignement gauche */
.table-responsive-card td.td-description>div.value-container,
.table-responsive-card td.td-prescriptions>div.value-container {
    text-align: left !important;
    width: 100%;
    display: block;
}

/* Style pour les messages d'erreur API (dans le tableau) */
.api-error-message {
    color: #dc2626;
    font-size: 0.875rem;
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    text-align: left !important;
}

/* Style pour le sous-titre dans le tableau */
.table-row-subheader td {
    font-weight: 600;
    color: #374151;
    padding-top: 0.75rem !important;
}

.dark .table-row-subheader td {
    color: #94a3b8;
    /* Slate 400 */
}

/* Style pour le placeholder de chargement de section */
.section-loading-placeholder td {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 1rem;
}

.dark .section-loading-placeholder td {
    color: #9ca3af;
}

/* =========================================
   4. DOCUMENT EDITOR (PREMIUM STYLE)
   ========================================= */
.document-editor-container {
    background-color: #f8fafc;
    padding: 40px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.dark .document-editor-container {
    background-color: #0f172a;
    /* Slate 900 */
    border-color: #334155;
    /* Slate 700 */
}

.document-page {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.document-section-label {
    position: absolute;
    left: -120px;
    width: 100px;
    text-align: right;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    top: 20px;
    pointer-events: none;
}

@media (max-width: 1200px) {
    .document-section-label {
        display: none;
    }
}

/* Overrides Quill for seamless stack */
.document-page .ql-toolbar {
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 50;
}

.document-page .ql-container {
    border: none !important;
    font-family: 'Inter', sans-serif;
    min-height: 100px;
}

/* Fix Tablet overlapping */
@media (max-width: 1024px) {
    .document-editor-container {
        padding: 10px;
        overflow-x: hidden;
    }
}

/* =========================================
   5. MODALS & UI INTERACTION
   ========================================= */
/* Modal Backdrop */
.modal {
    transition: opacity 0.25s ease;
}

body.modal-active {
    overflow-x: hidden;
    overflow-y: visible !important;
}

/* Custom Scrollbar for Logs */
.log-container::-webkit-scrollbar {
    width: 6px;
}

.log-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark .log-container::-webkit-scrollbar-track {
    background: #1e293b;
}

.log-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark .log-container::-webkit-scrollbar-thumb {
    background: #475569;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Admin Nav Item Active State */
.nav-item.active {
    background-color: rgb(239 246 255);
    color: rgb(30 64 175);
    border-right: 3px solid rgb(30 64 175);
}

.dark .nav-item.active {
    background-color: rgba(30, 58, 138, 0.4);
    /* Blue 900/40 */
    color: rgb(147 197 253);
    /* Blue 300 */
    border-right-color: rgb(96 165 250);
    /* Blue 400 */
}

/* =========================================
   6. BRANDING & FOOTER
   ========================================= */
/* Floating Branding Refinement */
.fixed-bottom-branding {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.3s ease-in-out;

    /* Default State: Invisible Background */
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    backdrop-filter: none;
    opacity: 0.6;

    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.fixed-bottom-branding:hover {
    /* Hover State: Visible Glass Background */
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    opacity: 1;
    transform: translateY(-2px);
}

.dark .fixed-bottom-branding:hover {
    background: rgba(30, 41, 59, 0.8);
    /* Slate 800 */
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.branding-text {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    /* Slate-500 */
    transition: color 0.3s;
}

.dark .branding-text {
    color: #94a3b8;
    /* Slate-400 */
}

.fixed-bottom-branding:hover .branding-text {
    color: #1e3a8a;
    /* Trably Blue Dark */
}

.dark .fixed-bottom-branding:hover .branding-text {
    color: #e2e8f0;
    /* Slate-200 */
}

.branding-logo {
    height: 1.5rem;
    width: auto;
    transition: transform 0.3s;
}

.dark .branding-logo {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.fixed-bottom-branding:hover .branding-logo {
    transform: scale(1.1);
}

/* Footer Standard */
.footer-standard {
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 0;
    margin-top: auto;
    text-align: center;
}

.dark .footer-standard {
    background-color: #0f172a;
    border-top-color: #334155;
}

.footer-text {
    font-size: 0.875rem;
    color: #64748b;
}

.dark .footer-text {
    color: #94a3b8;
}