/* ===================================================
   DOCUMENT CARDS - MODERN TILE-BASED LAYOUT
   =================================================== */

/* Document grid container */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    gap: 1.25rem;
    margin-top: 1rem;
    justify-content: start;
}

/* Individual document card */
.document-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease-in-out;
    overflow: hidden;
    position: relative;
    height: auto;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.document-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

/* Document card header */
.document-card-header {
    padding: 1.25rem 1.25rem 0.75rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 1px solid #f8f9fa;
}

.document-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    font-size: 1.5rem;
}

.document-icon.type-resume {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
}

.document-icon.type-interview {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #388e3c;
}

.document-icon.type-certificate {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 100%);
    color: #f57c00;
}

.document-icon.type-transcript {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    color: #c2185b;
}

.document-icon.type-reference {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #7b1fa2;
}

.document-icon.type-cover {
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
    color: #00796b;
}

.document-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.document-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-actions {
    flex-shrink: 0;
    position: relative;
}

.document-actions .dropdown-menu {
    z-index: 1050;
    min-width: 180px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Document card body */
.document-card-body {
    padding: 0.75rem 1.25rem;
    flex: 1;
}

.document-metadata {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metadata-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #6c757d;
}

.metadata-item i {
    width: 16px;
    flex-shrink: 0;
    margin-right: 0.5rem;
    opacity: 0.7;
}

/* Document card footer */
.document-card-footer {
    padding: 0.75rem 1.25rem 1.25rem 1.25rem;
    border-top: 1px solid #f8f9fa;
    background: rgba(248, 249, 250, 0.5);
    margin-top: auto;
}

.document-actions-primary {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.document-actions-primary .btn {
    min-width: 100px;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
}

/* Badge styling improvements */
.document-card .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    border-radius: 20px;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

/* Responsive design */
@media (max-width: 768px) {
    .documents-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 0.75rem;
    }

    .document-card {
        min-height: 180px;
    }

    .document-card-header {
        padding: 1rem 1rem 0.5rem 1rem;
    }

    .document-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .document-name {
        font-size: 0.9rem;
    }

    .document-card-body {
        padding: 0.5rem 1rem;
    }

    .document-card-footer {
        padding: 0.5rem 1rem 1rem 1rem;
    }

    .document-actions-primary .btn {
        min-width: 80px;
        font-size: 0.8125rem;
        padding: 0.4rem 0.75rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .documents-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 300px));
        gap: 1rem;
    }
}

@media (min-width: 1200px) {
    .documents-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 340px));
        gap: 1.5rem;
    }

    .document-card {
        min-height: 220px;
    }
}

/* Empty state for documents */
.documents-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.documents-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.documents-empty-state h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.documents-empty-state p {
    font-size: 0.875rem;
    margin: 0;
}

/* Focus states for accessibility */
.document-card:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.document-actions .btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .document-card {
        border-width: 2px;
    }
    
    .document-icon {
        border: 2px solid currentColor;
    }
    
    .badge {
        border-width: 2px;
        font-weight: 700;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .document-card {
        transition: none;
    }
    
    .document-card:hover {
        transform: none;
    }
}

/* Loading state for document cards */
.document-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.document-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success/error state indicators */
.document-card.success {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff8 0%, #f0f8f0 100%);
}

.document-card.error {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff8f8 0%, #f8f0f0 100%);
}

/* Print styles */
@media print {
    .documents-grid {
        display: block;
        break-inside: avoid;
    }
    
    .document-card {
        border: 1px solid #000;
        box-shadow: none;
        margin-bottom: 1rem;
        break-inside: avoid;
    }
    
    .document-actions {
        display: none;
    }
    
    .document-card-footer {
        display: none;
    }
}
