/**
 * PBG DOCUMENTS - CSS
 * Style pour l'interface freelance de gestion des documents
 */

/* ========================================
   VARIABLES PBG
======================================== */
:root {
    --pbg-primary: #8A9A7B;
    --pbg-dark: #2C2C2C;
    --pbg-black: #000;
    --pbg-white: #FFF;
    --pbg-gray: #666;
    --pbg-light: #F5F5F5;
    --pbg-red: #EF4444;
    --pbg-orange: #F59E0B;
    --pbg-green: #10B981;
}

/* ========================================
   TYPOGRAPHY
======================================== */
.pbg-title {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    font-size: 48px;
    color: var(--pbg-black);
    margin: 0 0 12px 0;
    line-height: 0.95;
}

.pbg-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    color: var(--pbg-gray);
    font-weight: 500;
    margin: 0;
}

/* ========================================
   LAYOUT
======================================== */
.pbg-documents-page {
    min-height: 100vh;
    background: var(--pbg-white);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

/* Gradient background effects */
.pbg-documents-page::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(138, 154, 123, 0.12) 0%, rgba(138, 154, 123, 0.06) 40%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.pbg-documents-page::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -8%;
    width: 1000px;
    height: 1000px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(138, 154, 123, 0.08) 0%, rgba(138, 154, 123, 0.04) 40%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* Dot grid pattern */
.pbg-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(138, 154, 123, 0.08) 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    z-index: 0;
    pointer-events: none;
}

.pbg-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

/* ========================================
   HEADER
======================================== */
.pbg-header {
    margin-bottom: 48px;
}

.pbg-header-content {
    margin-bottom: 32px;
}

/* ========================================
   PROGRESS CARD
======================================== */
.pbg-progress-card {
    background: var(--pbg-white);
    border: 3px solid var(--pbg-black);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.pbg-progress-card:hover {
    transform: translateY(-2px);
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.15);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pbg-gray);
}

.progress-percentage {
    font-size: 32px;
    font-weight: 900;
    color: var(--pbg-primary);
    font-family: 'Archivo Black', sans-serif;
}

.progress-bar {
    height: 12px;
    background: var(--pbg-light);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 2px solid var(--pbg-black);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pbg-primary) 0%, #7A8A6B 100%);
    transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);
    border-radius: 100px;
}

.progress-stats {
    font-size: 14px;
    color: var(--pbg-gray);
    font-weight: 600;
}

/* ========================================
   STATUS BADGE
======================================== */
.pbg-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--pbg-light);
    border: 2px solid var(--pbg-black);
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 40px;
}

.status-icon {
    width: 20px;
    height: 20px;
    color: var(--pbg-primary);
}

.pbg-status-badge strong {
    color: var(--pbg-black);
    text-transform: uppercase;
}

/* ========================================
   DOCUMENTS GRID
======================================== */
.pbg-documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

/* ========================================
   DOCUMENT CARD
======================================== */
.pbg-document-card {
    background: var(--pbg-white);
    border: 3px solid var(--pbg-black);
    border-radius: 16px;
    padding: 28px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.08);
}

.pbg-document-card:hover {
    transform: translateY(-4px);
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.12);
}

/* Status badge in card */
.doc-status-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid;
}

.doc-status-badge svg {
    width: 16px;
    height: 16px;
}

.status-validated {
    background: #DCFCE7;
    color: var(--pbg-green);
    border-color: var(--pbg-green);
}

.status-pending {
    background: #FEF3C7;
    color: var(--pbg-orange);
    border-color: var(--pbg-orange);
}

.status-refused {
    background: #FEE2E2;
    color: var(--pbg-red);
    border-color: var(--pbg-red);
}

.status-empty {
    background: var(--pbg-light);
    color: var(--pbg-gray);
    border-color: var(--pbg-gray);
}

/* Document header */
.doc-header {
    margin-bottom: 24px;
    padding-right: 120px;
}

.doc-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--pbg-black);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.doc-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--pbg-gray);
    line-height: 1.5;
}

.doc-info svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--pbg-primary);
}

.doc-info a {
    color: var(--pbg-primary);
    text-decoration: underline;
}

/* Expiration date */
.doc-expiration {
    margin-bottom: 24px;
}

.doc-expiration label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pbg-gray);
    margin-bottom: 8px;
}

.pbg-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    border: 2px solid var(--pbg-black);
    border-radius: 8px;
    background: var(--pbg-white);
    transition: all 0.3s ease;
    font-weight: 600;
}

.pbg-input:focus {
    outline: none;
    border-color: var(--pbg-primary);
    box-shadow: 0 0 0 3px rgba(138, 154, 123, 0.1);
}

.pbg-input:disabled {
    background: var(--pbg-light);
    color: var(--pbg-gray);
    cursor: not-allowed;
}

.expiration-warning {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
}

.expiration-warning.expiring {
    color: var(--pbg-orange);
}

.expiration-warning.expired {
    color: var(--pbg-red);
}

/* Upload area */
.doc-upload-area {
    margin-top: 20px;
}

.doc-current-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--pbg-light);
    border: 2px solid var(--pbg-black);
    border-radius: 8px;
    margin-bottom: 16px;
}

.doc-current-file svg {
    width: 20px;
    height: 20px;
    color: var(--pbg-primary);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--pbg-black);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-view {
    font-size: 13px;
    font-weight: 700;
    color: var(--pbg-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.file-view:hover {
    text-decoration: underline;
}

/* Refusal reason */
.doc-refusal-reason {
    padding: 16px;
    background: #FEE2E2;
    border: 2px solid var(--pbg-red);
    border-radius: 8px;
    margin-bottom: 16px;
}

.doc-refusal-reason strong {
    display: block;
    color: var(--pbg-red);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.doc-refusal-reason p {
    font-size: 14px;
    color: var(--pbg-black);
    margin: 0;
    line-height: 1.5;
}

/* Upload dropzone */
.upload-dropzone {
    position: relative;
    margin-bottom: 16px;
}

.file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    border: 3px dashed var(--pbg-gray);
    border-radius: 12px;
    background: var(--pbg-white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-label:hover {
    border-color: var(--pbg-primary);
    background: rgba(138, 154, 123, 0.05);
}

.upload-label svg {
    width: 32px;
    height: 32px;
    color: var(--pbg-primary);
    margin-bottom: 12px;
}

.upload-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--pbg-black);
    margin-bottom: 4px;
}

.upload-formats {
    font-size: 12px;
    color: var(--pbg-gray);
    font-weight: 500;
}

/* Drag and drop active state */
.upload-dropzone.drag-over .upload-label {
    border-color: var(--pbg-primary);
    background: rgba(138, 154, 123, 0.1);
    transform: scale(1.02);
}

/* File selected state */
.upload-dropzone.file-selected .upload-label {
    border-color: var(--pbg-green);
    background: #DCFCE7;
}

/* Buttons */
.pbg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}

.pbg-btn-upload {
    width: 100%;
    background: var(--pbg-black);
    color: var(--pbg-white);
    border: 3px solid var(--pbg-black);
}

.pbg-btn-upload:hover {
    background: var(--pbg-primary);
    color: var(--pbg-black);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(138, 154, 123, 0.3);
}

.pbg-btn-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    animation: spin 1s linear infinite;
}

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

/* Validated info */
.doc-validated-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

.doc-validated-info svg {
    width: 48px;
    height: 48px;
    color: var(--pbg-green);
    margin-bottom: 16px;
}

.doc-validated-info p {
    font-size: 15px;
    font-weight: 600;
    color: var(--pbg-gray);
    margin: 0 0 16px 0;
}

.view-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--pbg-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.view-doc-link:hover {
    text-decoration: underline;
}

/* ========================================
   CTA CARD (All validated)
======================================== */
.pbg-cta-card {
    background: linear-gradient(135deg, var(--pbg-primary) 0%, #7A8A6B 100%);
    border: 3px solid var(--pbg-black);
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.1);
    margin-top: 48px;
}

.cta-content h2 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 32px;
    text-transform: uppercase;
    color: var(--pbg-black);
    margin: 0 0 16px 0;
    line-height: 1.1;
}

.cta-content p {
    font-size: 16px;
    color: var(--pbg-dark);
    margin: 0 0 32px 0;
    line-height: 1.6;
}

.pbg-btn-primary {
    background: var(--pbg-black);
    color: var(--pbg-white);
    border: 3px solid var(--pbg-black);
    padding: 16px 32px;
}

.pbg-btn-primary:hover {
    background: var(--pbg-white);
    color: var(--pbg-black);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.pbg-btn-primary svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .pbg-container {
        padding: 0 20px;
    }

    .pbg-title {
        font-size: 32px;
    }

    .pbg-subtitle {
        font-size: 16px;
    }

    .pbg-documents-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .pbg-progress-card {
        padding: 24px;
    }

    .progress-percentage {
        font-size: 24px;
    }

    .doc-header {
        padding-right: 100px;
    }

    .doc-title {
        font-size: 16px;
    }

    .doc-status-badge {
        font-size: 11px;
        padding: 6px 12px;
        top: 16px;
        right: 16px;
    }

    .pbg-cta-card {
        padding: 32px 24px;
    }

    .cta-content h2 {
        font-size: 24px;
    }

    .cta-content p {
        font-size: 15px;
    }
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pbg-document-card {
    animation: fadeIn 0.5s ease backwards;
}

.pbg-document-card:nth-child(1) { animation-delay: 0.1s; }
.pbg-document-card:nth-child(2) { animation-delay: 0.2s; }
.pbg-document-card:nth-child(3) { animation-delay: 0.3s; }
.pbg-document-card:nth-child(4) { animation-delay: 0.4s; }
.pbg-document-card:nth-child(5) { animation-delay: 0.5s; }

/* ========================================
   NOTIFICATIONS
======================================== */
.pbg-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--pbg-white);
    border: 3px solid var(--pbg-black);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(calc(100% + 40px));
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.pbg-notification.success {
    border-color: var(--pbg-green);
    background: #DCFCE7;
}

.pbg-notification.error {
    border-color: var(--pbg-red);
    background: #FEE2E2;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-content svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

/* ========================================
   WARNING DOCUMENTS EN ATTENTE
======================================== */
.pbg-pending-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px solid #F59E0B;
    border-radius: 12px;
    margin-bottom: 24px;
    animation: slideIn 0.3s ease-out;
}

.pbg-pending-warning svg {
    color: #D97706;
    flex-shrink: 0;
}

.pbg-pending-warning span {
    font-size: 14px;
    color: #92400E;
}

.pbg-pending-warning strong {
    color: #78350F;
}

/* Carte avec fichier sélectionné mais pas enregistré */
.pbg-document-card.pending-save {
    border-color: #F59E0B !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.pbg-document-card.pending-save::after {
    content: '⚠️ Pensez à enregistrer !';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #F59E0B;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Animation pulse pour attirer l'attention */
@keyframes pulse-warning {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.3);
    }
}

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