/**
 * Styles frontend E-DOCUMENT
 */

/* === FORMULAIRE D'UPLOAD === */
.edoc-upload-form-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.edoc-upload-form-wrapper h2 {
    margin: 0 0 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
    color: #333;
    font-size: 22px;
}

.edoc-form-group {
    margin-bottom: 20px;
}

.edoc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

.edoc-input,
.edoc-textarea,
.edoc-select,
.edoc-file-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.edoc-input:focus,
.edoc-textarea:focus,
.edoc-select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
    outline: none;
}

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

.edoc-select[multiple] {
    height: auto;
    min-height: 120px;
}

.edoc-file-input {
    padding: 10px;
    background: #f9f9f9;
}

.edoc-help {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #888;
}

.edoc-submit-btn {
    display: inline-block;
    padding: 14px 35px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.edoc-submit-btn:hover {
    background: #005a87;
}

/* === MESSAGES === */
.edoc-message {
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    font-size: 15px;
}

.edoc-message.edoc-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.edoc-message.edoc-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.edoc-message.edoc-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* === GRILLE DE DOCUMENTS === */
.edoc-documents-grid-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.edoc-documents-grid-wrapper h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Filtres */
.edoc-filters {
    margin-bottom: 25px;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 6px;
}

.edoc-filter-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.edoc-filter-form input,
.edoc-filter-form select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.edoc-filter-form input {
    min-width: 200px;
}

/* Grille */
.edoc-documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.edoc-document-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.edoc-document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.edoc-card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edoc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edoc-file-icon {
    width: 80px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    font-weight: bold;
}

.edoc-file-icon .edoc-icon-ext {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Couleurs par type */
.edoc-file-pdf  { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important; }
.edoc-file-doc  { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important; }
.edoc-file-xls  { background: linear-gradient(135deg, #27ae60 0%, #229954 100%) !important; }
.edoc-file-zip  { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important; }
.edoc-file-mp3  { background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%) !important; }
.edoc-file-jpg  { background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%) !important; }
.edoc-file-png  { background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%) !important; }

.edoc-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.edoc-card-content {
    padding: 20px;
}

.edoc-card-content h3 {
    margin: 0 0 10px;
    font-size: 17px;
    color: #333;
    line-height: 1.3;
}

.edoc-card-desc {
    margin: 0 0 12px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.edoc-card-price {
    margin: 0 0 15px;
    font-size: 16px;
}

.edoc-card-price strong {
    color: #0073aa;
}

.edoc-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.edoc-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.edoc-btn-preview {
    background: #f0f0f0;
    color: #555;
}

.edoc-btn-preview:hover {
    background: #e0e0e0;
}

.edoc-btn-download {
    background: #28a745;
    color: #fff;
}

.edoc-btn-download:hover {
    background: #218838;
}

.edoc-btn-buy {
    background: #0073aa;
    color: #fff;
}

.edoc-btn-buy:hover {
    background: #005a87;
}

.edoc-btn-login {
    background: #ffc107;
    color: #333;
}

.edoc-btn-login:hover {
    background: #e0a800;
}

.edoc-btn-delete {
    background: #dc3545;
    color: #fff;
}

.edoc-btn-delete:hover {
    background: #c82333;
}

.edoc-btn-view {
    background: #6c757d;
    color: #fff;
}

.edoc-btn-view:hover {
    background: #5a6268;
}

/* === PAGINATION === */
.edoc-pagination {
    text-align: center;
    margin: 30px 0;
}

.edoc-pagination a,
.edoc-pagination span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #0073aa;
    text-decoration: none;
    transition: all 0.3s;
}

.edoc-pagination a:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.edoc-pagination .current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* === MODAL === */
.edoc-modal {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.edoc-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 25px;
}

.edoc-modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 30px;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

.edoc-modal-close:hover {
    color: #333;
}

.edoc-modal-content h3 {
    margin: 0 0 20px;
    padding-right: 30px;
}

/* === BOUTON RÉINITIALISER === */
.edoc-btn-reset {
    background: #6c757d;
    color: #fff;
}

.edoc-btn-reset:hover {
    background: #5a6268;
}

/* === MES DOCUMENTS === */
.edoc-my-documents {
    max-width: 1200px;
    margin: 0 auto;
}

.edoc-my-documents h2 {
    margin-bottom: 20px;
}

.edoc-empty {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 16px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .edoc-documents-grid {
        grid-template-columns: 1fr;
    }
    
    .edoc-filter-form {
        flex-direction: column;
    }
    
    .edoc-filter-form input,
    .edoc-filter-form select {
        width: 100%;
    }
    
    .edoc-upload-form-wrapper {
        padding: 20px;
    }
    
    .edoc-card-actions {
        flex-direction: column;
    }
}

/* === MODERATION FRONTEND === */
.edoc-moderation-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.edoc-moderation-title {
    margin-bottom: 20px;
}

.edoc-moderation-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e5e5;
}

.edoc-moderation-table th,
.edoc-moderation-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.edoc-moderation-table thead th {
    background: #f7f7f7;
    font-weight: 600;
}

.edoc-moderation-row-actions {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.edoc-moderation-actions .edoc-btn {
    margin-right: 6px;
    margin-bottom: 4px;
}

.edoc-btn-approve {
    background: #46b450;
    color: #fff;
}

.edoc-btn-approve:hover {
    background: #3a9a43;
    color: #fff;
}

.edoc-btn-reject {
    background: #dc3232;
    color: #fff;
}

.edoc-btn-reject:hover {
    background: #b82727;
    color: #fff;
}

.edoc-status-pending {
    color: #e08e0b;
    font-weight: 600;
}

.edoc-status-rejected {
    color: #dc3232;
    font-weight: 600;
}

.edoc-status-approved {
    color: #46b450;
    font-weight: 600;
}

@media (max-width: 768px) {
    .edoc-moderation-table thead {
        display: none;
    }

    .edoc-moderation-table,
    .edoc-moderation-table tbody,
    .edoc-moderation-table tr,
    .edoc-moderation-table td {
        display: block;
        width: 100%;
    }

    .edoc-moderation-table tr {
        margin-bottom: 14px;
        border: 1px solid #e5e5e5;
    }
}

/* ==========================================================================
   APERCU INTEGRE DANS LA PAGE (v1.1.5)
   ========================================================================== */

.edoc-preview-section {
    margin: 25px 0;
    clear: both;
}

.edoc-preview-section[data-edoc-collapsed="1"] .edoc-preview-inline,
.edoc-preview-section:not(.edoc-preview-open) .edoc-preview-inline {
    display: none;
}

.edoc-preview-section.edoc-preview-open .edoc-preview-inline {
    display: block;
    animation: edocFadeIn .25s ease-in;
}

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

.edoc-preview-inline {
    background: #fff;
    border: 1px solid #e2e5e9;
    border-radius: 6px;
    padding: 18px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}

.edoc-preview-inline-title {
    margin: 0 0 14px;
    font-size: 18px;
    line-height: 1.3;
    padding-bottom: 10px;
    border-bottom: 1px solid #eceff1;
}

.edoc-preview-notice {
    background: #f1f8ff;
    border-left: 4px solid #0073aa;
    color: #2b3a45;
    font-size: 13px;
    padding: 9px 12px;
    margin-bottom: 14px;
    border-radius: 3px;
}

.edoc-preview-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.edoc-preview-page {
    margin: 0;
    width: 100%;
    max-width: 820px;
    text-align: center;
}

.edoc-preview-page img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #dfe3e6;
    border-radius: 4px;
    background: #fafafa;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

.edoc-preview-page figcaption {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7680;
}

.edoc-preview-frame-wrap {
    position: relative;
    width: 100%;
    min-height: 320px;
    background: #f5f6f7;
    border: 1px solid #dfe3e6;
    border-radius: 4px;
    overflow: hidden;
}

.edoc-preview-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.edoc-preview-audio {
    padding: 10px 0;
}

.edoc-preview-audio audio {
    width: 100%;
}

.edoc-preview-loading {
    padding: 25px;
    text-align: center;
    color: #6b7680;
    font-size: 14px;
    background: #fff;
    border: 1px dashed #dfe3e6;
    border-radius: 6px;
}

.edoc-preview-ajax {
    margin: 15px 0;
}

.edoc-preview-btn[aria-expanded="true"] {
    background: #005177;
}

@media (max-width: 768px) {
    .edoc-preview-inline {
        padding: 12px;
    }

    .edoc-preview-frame-wrap {
        height: 60vh !important;
        min-height: 260px;
    }

    .edoc-preview-pages {
        gap: 12px;
    }
}
