/* IMASCIENCE Validation Hub - Styles */

/* ============================================
   Variables CSS
   ============================================ */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    --bg-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --card-bg: #ffffff;

    --text-color: #334155;
    --text-light: #64748b;
    --text-white: #ffffff;

    --border-color: #e2e8f0;
    --border-radius: 8px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);

    --sidebar-width: 260px;
    --header-height: 60px;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.logo-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-logo {
    max-width: 180px;
    height: auto;
    display: block;
    margin-bottom: 8px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    text-decoration: none;
}

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

.nav-icon {
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
}

.logout-link {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.logout-link:hover {
    color: var(--text-white);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.main-header {
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.page-content {
    padding: 32px;
}

/* ============================================
   Auth Layout
   ============================================ */
.auth-page {
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.auth-subtitle {
    display: block;
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Radio buttons groupe */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.02);
}

.radio-label:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.radio-label input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--primary-color);
}

.radio-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-text strong {
    font-weight: 600;
    color: var(--text-color);
}

.radio-text .text-small {
    font-size: 12px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* ============================================
   Tables
   ============================================ */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.table-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-pending {
    background: #f1f5f9;
    color: #475569;
}

.badge-open {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-validated {
    background: #dcfce7;
    color: #166534;
}

.badge-locked {
    background: #fef3c7;
    color: #92400e;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-completed {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-archived {
    background: #f1f5f9;
    color: #475569;
}

/* Badges type de projet */
.badge-type-animation {
    background: #ede9fe;
    color: #6d28d9;
}

.badge-type-illustration {
    background: #fce7f3;
    color: #be185d;
}

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

/* ============================================
   Utilities
   ============================================ */
.text-muted {
    color: var(--text-light);
}

.text-small {
    font-size: 13px;
}

.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mr-2 { margin-right: 8px; }

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

/* ============================================
   Draft System (Client Portal)
   ============================================ */

/* Draft restored banner */
.draft-restored-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: var(--border-radius);
    color: #92400e;
}

.draft-restored-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.draft-restored-icon {
    font-size: 20px;
}

.draft-restored-text {
    font-size: 14px;
}

.draft-restored-dismiss {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #b45309;
    border-radius: 4px;
    color: #92400e;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.draft-restored-dismiss:hover {
    background: #b45309;
    color: white;
}

/* Draft note styling */
.draft-note {
    color: var(--text-light);
    font-size: 13px;
    text-align: center;
}

/* Draft toast notifications */
.draft-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.draft-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.draft-toast-success {
    background: #10b981;
    color: white;
}

.draft-toast-warning {
    background: #f59e0b;
    color: white;
}

.draft-toast-error {
    background: #ef4444;
    color: white;
}

.draft-toast-info {
    background: #3b82f6;
    color: white;
}
