/* =========================================================
   RAMDADOCS - GLOBAL CSS
   Styles globaux uniquement : variables, reset, header, layout,
   barre latérale, footer, utilitaires.
   Les styles spécifiques aux menus sont dans /menus/<menu>/css/.
   ========================================================= */

/* --- Polices locales --- */

/* Arial (fallback système) */
@font-face {
    font-family: "Arial";
    src: url("/assets/fonts/arial.ttf") format("truetype");
    font-display: swap;
}

/* Spectral (titres, documents officiels) */
@font-face {
    font-family: 'Spectral';
    src: url('/assets/fonts/spectral/Spectral-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Spectral';
    src: url('/assets/fonts/spectral/Spectral-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Spectral';
    src: url('/assets/fonts/spectral/Spectral-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Inter (interface) */
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter/Inter-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter/Inter-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ae_AlHor (arabe) */
@font-face {
    font-family: 'AlHor';
    src: url('/assets/fonts/ae_AlHor.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}


/* --- Variables --- */
:root {
    --color-paper: #FAFAF8;
    --color-ink: #16323A;
    --color-teal: #0E7C86;
    --color-magenta: #E93583;
    --color-orange: #F5941F;
    --color-success: #3D8A5C;
    --color-white: #FFFFFF;
    --color-gray-light: #F3F4F6;
    --color-gray-medium: #6B7280;
    --color-gray-border: #E5E7EB;
    
    --font-serif: 'Spectral', serif;
    --font-sans: 'Inter', sans-serif;
    --font-times-new-roman: 'Times New Roman', serif;
    --font-amiri: 'Amiri', 'Arial', 'Times New Roman', sans-serif;
    --font-inherit: inherit;
    --font-arabic: 'AlHor', 'Amiri', serif;
    --font-times-new-roman: 'Times New Roman', serif;
    
    --shadow-sm: 0 1px 2px 0 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);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* --- Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--color-paper);
    color: var(--color-ink);
    overscroll-behavior-y: contain;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    overflow-y: auto;
}

.structure {
    width: 100%;
    max-width: 1400px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--color-paper);
    position: relative;
}

/* --- Header --- */
.header {
    width: 100%;
    height: 80px;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-gray-border);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.app-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.app-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.app-name {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
}

.app-name-ramda {
    color: var(--color-magenta);
}

.app-name-docs {
    color: var(--color-teal);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* --- Indicateur de statut --- */
.connection-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 500;
    color: var(--color-success);
    cursor: default;
    user-select: none;
    transition: color 0.3s ease;
}

.status-icon {
    font-size: 16px;
    transition: color 0.3s ease;
}

.connection-status.offline {
    color: #DC2626;
}

.connection-status.offline .status-icon {
    color: #DC2626;
}

/* --- Bouton Synchroniser --- */
.sync-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 8px;
    background: transparent;
    color: var(--color-teal);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 500;
}

.sync-btn:hover {
    color: var(--color-magenta);
}

.sync-btn i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.sync-btn.syncing i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Notifications --- */
.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    color: var(--color-gray-medium);
    transition: color 0.2s;
    font-size: 10px;
    font-weight: 500;
}

.quick-action-item:hover {
    color: var(--color-teal);
}

.quick-action-item i {
    font-size: 18px;
}

/* --- Profil --- */
.user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.user-profile:hover {
    opacity: 0.8;
}

.profile-icon-default {
    font-size: 32px;
    color: var(--color-teal);
}

.profile-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--color-gray-border);
}

.auth-text {
    font-size: 10px;
    font-weight: 500;
    color: var(--color-ink);
    white-space: nowrap;
}

/* --- Layout principal --- */
.content {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100% - 80px);
}

.left {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px;
    gap: 16px;
}

/* --- Barre latérale droite --- */
.right {
    width: 100px;
    background: var(--color-white);
    font-family: var(--font-inherit);
    border-left: 1px solid var(--color-gray-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 8px;
    overflow-y: auto;
    flex-shrink: 0;
}

.shortcut-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(100% - 10px);
    height: 60px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-gray-medium);
    gap: 2px;
}

.shortcut-icon i {
    font-size: 25px;
}

.shortcut-icon img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.shortcut-icon div {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
    word-break: break-word;
    max-width: 100%;
}

.shortcut-icon:hover {
    background: var(--color-gray-light);
    color: var(--color-teal);
}

.shortcut-icon.active {
    background: transparent;
    color: var(--color-magenta);
    border-bottom: 2px solid var(--color-magenta);
}

/* --- Actions flottantes --- */
.floating-actions-main {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-gray-border);
}

.edit-design, .export {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 4px;
}

.edit-design {
    background: #FCE7F3;
    color: var(--color-magenta);
}

.export {
    background: #D1FAE5;
    color: var(--color-success);
}

.edit-design:hover, .export:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.edit-design i, .export i {
    font-size: 18px;
}

.edit-design div, .export div {
    font-size: 11px;
    font-weight: 600;
}

/* --- Utilitaires --- */
.hidden {
    display: none !important;
}

.element-disabled, .element-disabled * {
    pointer-events: none !important;
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* --- Responsive (Mobile) --- */
@media (max-width: 768px) {
    .header {
        height: 70px;
        padding: 0 10px;
    }

    .app-logo {
        width: 30px;
        height: 30px;
    }

    .app-name {
        font-size: 14px;
    }

    .header-right {
        gap: 8px;
    }

    .connection-status {
        font-size: 9px;
    }

    .quick-action-item {
        font-size: 9px;
    }

    .quick-action-item i {
        font-size: 16px;
    }

    .sync-btn {
        font-size: 9px;
    }

    .sync-btn i {
        font-size: 16px;
    }

    .profile-icon-default {
        font-size: 28px;
    }

    .profile-image {
        width: 28px;
        height: 28px;
    }

    .auth-text {
        font-size: 9px;
    }

    .content {
        flex-direction: column;
        height: calc(100% - 70px - 60px);
    }

    .left {
        padding: 12px;
    }

    .right {
        order: 2;
        position: fixed;
        left: 0;
        font-family: var(--font-inherit);
        bottom: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        border-left: none;
        border-top: 1px solid var(--color-gray-border);
        padding: 0 4px;
        z-index: 900;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        gap: 2px;
    }

    .shortcut-icon {
        width: auto;
        min-width: 60px;
        height: 50px;
        padding: 0 8px;
        flex-shrink: 0;
    }

    .shortcut-icon i {
        font-size: 20px;
    }

    .shortcut-icon img {
        width: 20px;
        height: 20px;
    }

    .shortcut-icon div {
        font-size: 10px;
    }
}

/***************************les formulaires**********************/
/* ============================================================
   CHAMP DE RECHERCHE
   ============================================================ */

.input-search {
    flex-shrink: 0;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    margin-bottom: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    color: #1f2937;
    font: inherit;
    outline: none;
}

.input-search:focus {
    border-color: #64748b;
}

.input-search:disabled {
    opacity: .6;
    cursor: not-allowed;
}
