/* AnonyShare - Style moderne et professionnel */

/* Import de la police Google Roboto */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap');

/* Palette de couleurs basée sur le logo */
:root {
    /* Couleurs principales du logo */
    --primary-color: #AE5FA0;
    --primary-dark: #8a4a7f;
    --primary-light: #c98dbd;
    --accent-color: #451C42;
    --accent-dark: #2d1229;

    /* Couleurs complémentaires */
    --success-color: #52b788;
    --danger-color: #e63946;
    --warning-color: #f77f00;
    --info-color: #457b9d;

    /* Neutres */
    --text-dark: #1a1a1a;
    --text-medium: #4a4a4a;
    --text-light: #6a6a6a;
    --bg-white: #ffffff;
    --bg-light: #f8f6f7;
    --bg-lighter: #fdfcfd;
    --border-color: #e5d9e3;
    --border-light: #f0e8ef;

    /* Messages */
    --message-bg: #f1f3f5;
    --message-own: #D9FDD3;
    --message-private: #fff8e6;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(69, 28, 66, 0.08);
    --shadow-md: 0 4px 12px rgba(69, 28, 66, 0.12);
    --shadow-lg: 0 8px 24px rgba(69, 28, 66, 0.15);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--bg-lighter) 0%, var(--bg-light) 100%);
    min-height: 100vh;
}

/* ==================== Header ==================== */
.app-header {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
    color: white;
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.app-header h1 {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.app-header a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.app-header a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* ==================== Home Container ==================== */
.home-container {
    max-width: 650px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.home-container h2 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 2rem;
}

.home-container h3 {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.home-container > p {
    color: var(--text-medium);
    margin-bottom: 2rem;
}

.home-container hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 2.5rem 0;
}

/* ==================== Forms ==================== */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    max-width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    box-sizing: border-box;
    resize: vertical;
    background: var(--bg-lighter);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(174, 95, 160, 0.1);
}

textarea.form-control {
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
}

/* ==================== Buttons ==================== */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent-color) 100%);
}

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

.btn-secondary {
    background-color: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--text-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #40916c;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #d62828;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

/* ==================== Project View Layout ==================== */
.project-container {
    display: flex;
    height: calc(100vh - 78px);
    position: relative;
}

.document-panel {
    flex: 1;
    min-width: 0;
    background: var(--bg-white);
    position: relative;
    overflow: hidden;
}

.document-embed {
    width: 100%;
    height: 100%;
    border: none;
}

.resize-handle {
    display: none;
}

.chat-panel {
    width: 420px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-white);
    border-left: 2px solid var(--border-light);
    overflow: hidden;
    box-shadow: -4px 0 12px rgba(69, 28, 66, 0.05);
}

/* ==================== Tabs ==================== */
.chat-tabs {
    display: flex;
    background: linear-gradient(to bottom, var(--bg-white) 0%, var(--bg-lighter) 100%);
    border-bottom: 2px solid var(--border-light);
    padding: 0.5rem 0.5rem 0 0.5rem;
}

.chat-tab {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px 8px 0 0;
    position: relative;
}

.chat-tab:hover {
    background-color: rgba(174, 95, 160, 0.08);
    color: var(--primary-color);
}

.chat-tab.active {
    color: var(--primary-color);
    background-color: var(--bg-white);
}

.chat-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 3px 3px 0 0;
}

.chat-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(to bottom, var(--bg-lighter) 0%, var(--bg-white) 100%);
    border-bottom: 1px solid var(--border-light);
}

.chat-header h3 {
    font-size: 1.125rem;
    margin: 0 0 0.5rem 0;
    color: var(--accent-color);
}

/* ==================== Tab Content ==================== */
.comments-content,
.add-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.comments-content.active,
.add-content.active {
    display: flex;
}

/* ==================== Messages ==================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    padding: 1rem;
    border-radius: 12px;
    background-color: var(--message-bg);
    width: 95%;
    word-wrap: break-word;
    align-self: flex-start;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid transparent;
}

.message:hover {
    box-shadow: var(--shadow-md);
}

.message.own {
    background-color: var(--message-own);
    align-self: flex-end;
    border-color: #b8e6b0;
}

.message.private {
    background-color: var(--message-private);
    border-left: 4px solid var(--warning-color);
}

.message.own.private {
    background-color: var(--message-private);
}

.message-header {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

/* ==================== Chat Input ==================== */
.chat-input {
    padding: 1.25rem;
    border-top: 2px solid var(--border-light);
    background: linear-gradient(to bottom, var(--bg-white) 0%, var(--bg-lighter) 100%);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chat-input > * {
    max-width: 100%;
}

.input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.input-group .form-control {
    flex: 1;
    min-width: 0;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0.75rem 0;
}

.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-check label {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-medium);
}

/* ==================== Admin Panel ==================== */
.admin-panel {
    max-width: 900px;
    margin: 2.5rem auto;
    padding: 2.5rem;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.admin-panel h2 {
    margin-bottom: 2rem;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 2rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.75rem;
}

.admin-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--bg-lighter);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.admin-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--accent-color);
    font-weight: 600;
}

.admin-section h4 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.25rem 0;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-white);
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.radio-option:hover {
    background-color: rgba(174, 95, 160, 0.05);
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-option label {
    cursor: pointer;
    font-weight: 500;
}

.document-options {
    margin-top: 1.25rem;
    padding: 1.5rem;
    background-color: var(--bg-white);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

/* ==================== Alerts ==================== */
.alert {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 12px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    font-weight: 500;
}

.alert-success {
    color: #0d5832;
    background: linear-gradient(135deg, #d1f4dd 0%, #e8f8ef 100%);
    border-color: #52b788;
}

.alert-danger {
    color: #721c24;
    background: linear-gradient(135deg, #f8d7da 0%, #fce8ea 100%);
    border-color: var(--danger-color);
}

.alert-info {
    color: #0c4a6e;
    background: linear-gradient(135deg, #dbeafe 0%, #f0f9ff 100%);
    border-color: var(--info-color);
}

.alert-warning {
    color: #7c2d12;
    background: linear-gradient(135deg, #fed7aa 0%, #fff7ed 100%);
    border-color: var(--warning-color);
}

/* ==================== Utilities ==================== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

/* ==================== Mobile Tabs ==================== */
.mobile-tabs {
    display: none;
    background: linear-gradient(to bottom, var(--bg-white) 0%, var(--bg-lighter) 100%);
    border-bottom: 2px solid var(--border-light);
}

.mobile-tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.mobile-tab:hover {
    color: var(--primary-color);
}

.mobile-tab.active {
    color: var(--primary-color);
}

.mobile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

/* ==================== Add Hint ==================== */
.mobile-add-hint {
    display: block;
    cursor: pointer;
    transition: var(--transition);
    border-top: 1px solid var(--border-light);
    padding: 1rem 0;
}

.mobile-add-hint:hover {
    background-color: rgba(174, 95, 160, 0.05);
}

.add-content .chat-input {
    padding: 1.75rem;
    flex: 1;
    overflow-y: auto;
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .mobile-tabs {
        display: flex;
    }

    .chat-tabs {
        display: none;
    }

    .project-container {
        flex-direction: column;
        height: calc(100vh - 78px - 60px);
    }

    .document-panel {
        width: 100%;
        height: 100%;
        display: none;
    }

    .document-panel.active {
        display: block;
    }

    .chat-panel {
        width: 100%;
        max-width: 100%;
        height: 100%;
        border-left: none;
        border-top: none;
        display: none;
    }

    .chat-panel.active {
        display: flex;
    }

    .resize-handle {
        display: none;
    }

    .home-container {
        margin: 1.5rem;
        padding: 1.75rem;
    }

    .admin-panel {
        margin: 1.5rem;
        padding: 1.75rem;
    }
}

/* ==================== Scrollbar ==================== */
.chat-messages::-webkit-scrollbar {
    width: 10px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-lighter);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    border: 2px solid var(--bg-lighter);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--accent-color) 100%);
}

/* ==================== Loading Spinner ==================== */
.spinner {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-light);
}

.empty-state p {
    margin: 0.75rem 0;
    font-size: 1.05rem;
}

.empty-state p:first-child {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-medium);
}

/* ==================== Special Touches ==================== */
/* Projet en cours sur la page d'accueil */
.home-container > div[style*="border: 2px solid"] {
    border: 2px solid var(--primary-color) !important;
    background: linear-gradient(135deg, rgba(174, 95, 160, 0.08) 0%, rgba(174, 95, 160, 0.03) 100%) !important;
    box-shadow: var(--shadow-md);
}

/* Amélioration des inputs readonly */
input[readonly] {
    background-color: var(--bg-lighter);
    cursor: default;
}

/* Focus visible pour l'accessibilité */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==================== PDF Controls ==================== */
.pdf-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
}

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

.pdf-btn-primary:hover {
    background: linear-gradient(135deg, #8a4a7f 0%, #451C42 100%) !important;
}

.pdf-btn-success:hover {
    background: #40916c !important;
}

/* Conteneur PDF avec contrôles en flex */
#pdfViewerContainer {
    box-sizing: border-box !important;
}

/* Scrollbar pour le conteneur PDF */
#pdfViewerContainer::-webkit-scrollbar {
    width: 12px;
}

#pdfViewerContainer::-webkit-scrollbar-track {
    background: #3a3a3a;
}

#pdfViewerContainer::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 6px;
    border: 2px solid #3a3a3a;
}

#pdfViewerContainer::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--accent-color) 100%);
}
