/* ============================================================
   HAPPI CONVERTER - Styles personnalisés
   ============================================================ */

:root {
    --happi-primary: #1a237e;
    --happi-secondary: #ffab00;
    --happi-dark: #0d1442;
    --happi-light: #e8eaf6;
    --happi-accent: #ff6f00;
}

body {
    background-color: #f5f6fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Navbar */
.bg-happi {
    background: linear-gradient(135deg, var(--happi-primary), var(--happi-dark)) !important;
}

.navbar-brand {
    font-size: 1.3rem;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--happi-primary) 0%, #283593 50%, var(--happi-dark) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--happi-secondary), var(--happi-accent));
    padding: 2rem;
    text-align: center;
    color: #fff;
}

.login-header h2 {
    margin: 0;
    font-weight: 700;
}

.login-body {
    padding: 2rem;
}

/* Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-icon.bg-primary-soft { background: linear-gradient(135deg, #1a237e, #3949ab); }
.stat-icon.bg-success-soft { background: linear-gradient(135deg, #1b5e20, #43a047); }
.stat-icon.bg-warning-soft { background: linear-gradient(135deg, #e65100, #ff9800); }
.stat-icon.bg-info-soft    { background: linear-gradient(135deg, #01579b, #039be5); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--happi-primary);
    line-height: 1;
}

.stat-label {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Upload Zone */
.upload-zone {
    border: 3px dashed #bdbdbd;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--happi-secondary);
    background: var(--happi-light);
}

.upload-zone .upload-icon {
    font-size: 4rem;
    color: #bdbdbd;
    transition: color 0.3s;
}

.upload-zone:hover .upload-icon {
    color: var(--happi-secondary);
}

/* Processing Animation */
.processing-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 35, 126, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: #fff;
}

.processing-content {
    text-align: center;
    max-width: 400px;
}

.pulse-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--happi-secondary);
    margin: 0 auto 2rem;
    animation: pulse 1.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

@keyframes pulse {
    0%   { transform: scale(1);   opacity: 1; }
    50%  { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1);   opacity: 1; }
}

.step-indicator {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
    margin-top: 1.5rem;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.4;
    transition: all 0.5s;
}

.step-item.active {
    opacity: 1;
    background: rgba(255, 171, 0, 0.2);
}

.step-item.done {
    opacity: 0.8;
}

.step-item .step-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Preview Page */
.data-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.data-card .card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

.mapping-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--happi-secondary);
    padding: 1rem;
}

/* HAPPI Preview */
.happi-preview {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.happi-header {
    border-bottom: 3px solid var(--happi-primary);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.happi-numero {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--happi-primary);
}

.happi-section {
    background: #fffde7;
    border: 1px solid #fff9c4;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.happi-section-title {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #e65100;
    margin-bottom: 0.5rem;
    font-style: italic;
}

/* Table HAPPI */
.table-happi thead {
    background: var(--happi-primary);
    color: #fff;
}

.table-happi thead th {
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    padding: 0.75rem;
}

.table-happi .total-row {
    background: #e8eaf6;
    font-weight: 700;
}

/* Confidence Badge */
.confidence-high   { color: #2e7d32; }
.confidence-medium { color: #f57f17; }
.confidence-low    { color: #c62828; }

/* Alert custom */
.alert-happi {
    background: linear-gradient(135deg, #e8eaf6, #c5cae9);
    border: 1px solid #9fa8da;
    color: var(--happi-primary);
    border-radius: 12px;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Progress Steps */
.workflow-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 2rem 0;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #999;
    background: #e0e0e0;
    position: relative;
}

.workflow-step.active {
    background: var(--happi-primary);
    color: #fff;
}

.workflow-step.done {
    background: #43a047;
    color: #fff;
}

.workflow-connector {
    width: 40px;
    height: 3px;
    background: #e0e0e0;
    align-self: center;
}

.workflow-connector.done {
    background: #43a047;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1060;
}

/* Responsive */
@media (max-width: 768px) {
    .workflow-steps { flex-direction: column; align-items: center; }
    .workflow-connector { width: 3px; height: 20px; }
    .stat-value { font-size: 1.5rem; }
}
