/* assets/css/style.css - Styles personnalisés modernes pour le Cloud Personnel */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --sidebar-width: 260px;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
}

body {
    background-color: var(--bg-light);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    overflow-x: hidden;
}

/* Sidebar Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-light);
}

/* Navigation Links */
.nav-link-custom {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: #64748b;
    font-weight: 500;
    border-radius: 0.5rem;
    margin: 0.2rem 0.75rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-link-custom:hover {
    color: var(--primary-color);
    background-color: #eff6ff;
}

.nav-link-custom.active {
    color: var(--primary-color);
    background-color: #dbeafe;
    font-weight: 600;
}

.nav-link-custom i {
    font-size: 1.15rem;
    width: 24px;
    margin-right: 0.75rem;
}

/* File Table & Cards */
.file-row {
    transition: background-color 0.15s ease;
}

.file-row:hover {
    background-color: #f1f5f9;
}

.file-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.25rem;
}

.icon-pdf {
    background-color: #fee2e2;
    color: #ef4444;
}

.icon-docx {
    background-color: #dbeafe;
    color: #2563eb;
}

.icon-odt {
    background-color: #e0e7ff;
    color: #4f46e5;
}

.icon-image {
    background-color: #fef3c7;
    color: #d97706;
}

.icon-other {
    background-color: #f1f5f9;
    color: #64748b;
}

/* Badges */
.badge-admin {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-user {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

/* Modals */
.modal-full-screen {
    max-width: 95vw;
    margin: 1.5rem auto;
}

.editor-toolbar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.editor-content-area {
    min-height: 980px;
    width: 100%;
    max-width: 850px;
    margin: 20px auto;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 60px 75px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    outline: none;
    color: #1e293b;
}

/* Palette de couleurs */
.color-picker-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #f8fafc;
}

.color-input-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border: none;
    cursor: pointer;
    background: transparent;
    padding: 0;
    border-radius: 4px;
}

.color-input-btn::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input-btn::-webkit-color-swatch {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    .sidebar.open {
        margin-left: 0;
    }
    .main-content {
        margin-left: 0;
    }
}

/* Rendu haute fidélité DOCX (vraie mise en page, feuilles A4 & ombres) */
.docx-page {
    background: #ffffff !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    margin-bottom: 24px !important;
    border-radius: 2px !important;
}

.docx-wrapper {
    background: #e2e8f0 !important;
    padding: 30px !important;
}

/* Drag and Drop Plein Écran */
.drag-drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.drag-drop-box {
    background: #ffffff;
    border: 3px dashed #2563eb;
    border-radius: 20px;
    padding: 50px 70px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* Zone de drop stylisée dans la modal */
.dropzone-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 35px 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone-area:hover, .dropzone-area.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

/* Rendu éditeur DOCX haute fidélité avec toutes les couleurs */
.docx-editor-page {
    background: #ffffff !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    margin: 20px auto !important;
    padding: 60px 80px !important;
    min-height: 980px !important;
    max-width: 850px !important;
    outline: none !important;
}

/* Dark Mode Styles */
[data-bs-theme="dark"] {
    color-scheme: dark;
}

[data-bs-theme="dark"] body {
    background-color: #0f172a;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .sidebar {
    background: #111827;
    border-right: 1px solid #334155;
}

[data-bs-theme="dark"] .main-content {
    background: #0f172a;
}

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .navbar-brand,
[data-bs-theme="dark"] .breadcrumb-item,
[data-bs-theme="dark"] .fw-bold,
[data-bs-theme="dark"] .fw-semibold,
[data-bs-theme="dark"] .fw-medium {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .small,
[data-bs-theme="dark"] .text-secondary {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .nav-link-custom {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .nav-link-custom:hover {
    color: #60a5fa;
    background-color: #1e293b;
}

[data-bs-theme="dark"] .nav-link-custom.active {
    color: #60a5fa;
    background-color: #1e3a8a;
}

[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-body,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .list-group-item,
[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .table-responsive,
[data-bs-theme="dark"] .input-group-text,
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .alert,
[data-bs-theme="dark"] .accordion-item,
[data-bs-theme="dark"] .offcanvas,
[data-bs-theme="dark"] .popover,
[data-bs-theme="dark"] .toast {
    background-color: #111827 !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(148, 163, 184, 0.06);
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(96, 165, 250, 0.08);
}

[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-warning,
[data-bs-theme="dark"] .btn-outline-primary,
[data-bs-theme="dark"] .btn-outline-light {
    color: #e2e8f0;
    border-color: #475569;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-warning:hover,
[data-bs-theme="dark"] .btn-outline-primary:hover,
[data-bs-theme="dark"] .btn-outline-light:hover {
    background-color: #1e293b;
    color: #f8fafc;
}

[data-bs-theme="dark"] .file-row:hover {
    background-color: rgba(148, 163, 184, 0.08);
}

[data-bs-theme="dark"] .dropzone-area {
    background: #111827;
    border-color: #475569;
}

[data-bs-theme="dark"] .dropzone-area:hover, [data-bs-theme="dark"] .dropzone-area.dragover {
    border-color: #3b82f6;
    background: #172554;
}

[data-bs-theme="dark"] .editor-toolbar {
    background: #111827;
    border-color: #334155;
}

[data-bs-theme="dark"] .color-picker-wrapper {
    background: #111827;
    border-color: #475569;
}

[data-bs-theme="dark"] .drag-drop-box {
    background: #111827;
    border-color: #3b82f6;
}

[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] .form-select::placeholder,
[data-bs-theme="dark"] textarea::placeholder {
    color: #94a3b8;
}

[data-bs-theme="dark"] .badge.bg-light {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}
