/* documents.css */

.documents-toolbar {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
    padding: 25px;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
}

@media (max-width: 1200px) {
    .documents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .documents-toolbar { flex-direction: column; align-items: stretch; }
    .search-wrapper { width: 100%; max-width: none; }
    .category-filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
    .category-filter { flex: 0 0 auto; min-height: 42px; }
    .documents-grid { grid-template-columns: minmax(0, 1fr); }
    .document-card, .document-info { min-width: 0; }
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-wrapper .search-icon {
    position: absolute;
    top: 50%;
    right: 20px;
    z-index: 1;
    color: #888888;
    font-size: 1.1rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-wrapper input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    background: #fdfdfd;
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color, #1a5276);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(26, 82, 118, 0.1);
}

.categories-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.filter-btn {
    padding: 10px 22px;
    border: 1px solid transparent;
    border-radius: 30px;
    background: #f1f3f5;
    color: #555555;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.filter-btn:hover {
    background: #e2e8f0;
    color: #333333;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--primary-color, #1a5276);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(26, 82, 118, 0.3);
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.document-card {
    --document-color: #cccccc;
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    overflow: hidden;
    padding: 25px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.document-card::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--document-color);
    content: '';
}

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

.doc-icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 65px;
    border-radius: 12px;
    font-size: 2.2rem;
}

.doc-info {
    flex: 1 1 auto;
    min-width: 0;
}

.doc-category-badge {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #f1f2f6;
    color: #555555;
    font-size: 0.75rem;
    font-weight: 700;
}

.doc-info h3 {
    overflow: hidden;
    margin: 0 0 10px;
    color: #2c3e50;
    font-size: 1.15rem;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.doc-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.doc-file-type {
    font-weight: 800;
}

.doc-action-btn {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(26, 82, 118, 0.08);
    color: var(--primary-color, #1a5276);
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.doc-action-btn:hover,
.doc-action-btn:focus-visible {
    background: var(--primary-color, #1a5276);
    color: #ffffff;
    transform: scale(1.08);
    outline: none;
}

.documents-status {
    grid-column: 1 / -1;
    width: 100%;
    padding: 40px 20px;
    border-radius: 12px;
    background: #ffffff;
    color: #64748b;
    text-align: center;
}

.documents-status p {
    margin: 14px 0 0;
}

.documents-status-error {
    background: #fff1f2;
    color: #b42318;
}

.retry-documents-btn {
    margin-top: 16px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--primary-color, #1a5276);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.application-process {
    margin-top: 20px;
    padding: 50px 30px;
    border-radius: 15px;
    background: #f8f9fc;
}

.section-title {
    margin-bottom: 40px;
    color: var(--primary-color, #1a5276);
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
}

.process-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.process-step {
    padding: 30px 20px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease;
}

.process-step:hover {
    transform: translateY(-5px);
}

.step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(230, 126, 34, 0.1);
    color: var(--secondary-color, #e67e22);
    font-size: 1.8rem;
}

.process-step h4 {
    margin-bottom: 10px;
    color: #333333;
    font-size: 1.2rem;
}

.process-step p {
    margin: 0;
    color: #666666;
    font-size: 0.95rem;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .documents-grid {
        grid-template-columns: 1fr;
    }

    .document-card {
        flex-direction: column;
        padding: 30px 20px;
        text-align: center;
    }

    .document-card::before {
        width: 100%;
        height: 4px;
    }

    .doc-info h3 {
        white-space: normal;
    }

    .doc-meta {
        justify-content: center;
    }

    .doc-action-btn {
        width: 100%;
        height: 45px;
        border-radius: 8px;
    }

    .doc-action-btn::after {
        margin-right: 8px;
        content: 'تحميل المستند';
        font-family: 'Cairo', sans-serif;
        font-size: 1rem;
        font-weight: 700;
    }
}

@media (max-width: 1200px) {
    .documents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .documents-toolbar { flex-direction: column; align-items: stretch; }
    .search-wrapper { width: 100%; max-width: none; }
    .categories-wrapper, .category-filters { justify-content: flex-start; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
    .filter-btn, .category-filter { flex: 0 0 auto; min-height: 42px; }
    .documents-grid { grid-template-columns: minmax(0, 1fr); }
    .document-card, .document-info { min-width: 0; }
}
