/* =============================================
   Document Module Styles
   ============================================= */

/* Statistics Cards */
.stats-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.stats-card .stats-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.stats-card .bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.stats-card .bg-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.stats-card .bg-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

.stats-card .bg-info {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%) !important;
}

/* Document Cards */
.document-card {
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 20px;
}

.document-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: #cbd5e1;
}

.document-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 2px solid #e2e8f0;
    padding: 20px;
}

.document-card-body {
    padding: 20px;
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    font-size: 0.85rem;
}

.badge.bg-warning {
    background-color: #fbbf24 !important;
    color: #78350f;
}

.badge.bg-success {
    background-color: #10b981 !important;
    color: white;
}

.badge.bg-secondary {
    background-color: #6b7280 !important;
    color: white;
}

/* Keyword Tags */
.keyword-tags .badge {
    margin: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
    background-color: #3b82f6 !important;
    color: white;
}

.keyword-tags-small .badge {
    font-size: 0.7rem;
    margin: 2px;
    padding: 0.25em 0.5em;
}

/* Table Enhancements */
.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9 !important;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Filter Section */
#filterSection {
    transition: all 0.3s ease;
}

.card-header h5 {
    font-weight: 600;
    color: #1e293b;
}

/* Action Buttons */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.btn-outline-info:hover {
    background-color: #06b6d4;
    border-color: #06b6d4;
    color: white;
}

.btn-outline-primary:hover {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.btn-outline-danger:hover {
    background-color: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* File Icons */
.bi-file-earmark-pdf {
    color: #dc2626 !important;
}

.bi-file-earmark-word {
    color: #2563eb !important;
}

.bi-file-earmark-excel {
    color: #16a34a !important;
}

.bi-file-earmark-image {
    color: #f59e0b !important;
}

/* Attachment Cards */
.attachment-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    background: white;
}

.attachment-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.attachment-card .file-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.attachment-card .file-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
    word-break: break-word;
}

.attachment-card .file-meta {
    font-size: 0.85rem;
    color: #64748b;
}

/* Version Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline:before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    padding-bottom: 25px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -26px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    z-index: 1;
}

.timeline-item.active .timeline-marker {
    background: #fbbf24;
    border-color: #fbbf24;
}

.timeline-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #e2e8f0;
    transition: all 0.3s ease;
}

.timeline-item.active .timeline-content {
    border-left-color: #fbbf24;
    background: #fffbeb;
}

.timeline-content:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Form Enhancements */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.required:after {
    content: " *";
    color: #ef4444;
    font-weight: bold;
}

/* Pagination */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 3px;
    border: 1px solid #e2e8f0;
    color: #475569;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
}

.pagination .page-item.disabled .page-link {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
}

/* Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading:after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spinner-border 0.75s linear infinite;
}

/* Sticky Sidebar */
.sticky-top {
    position: sticky;
    top: 20px;
    z-index: 1020;
}

/* File Preview */
.file-preview-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.file-preview-zone:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-preview-zone.drag-over {
    border-color: #667eea;
    background: #e0e7ff;
}

.file-list-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 10px;
    background: white;
    transition: all 0.2s ease;
}

.file-list-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #94a3b8;
}

.breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #64748b;
}

/* Alert Enhancements */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Modal Enhancements */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 2px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Dropdown Enhancements */
.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
    color: #667eea;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e2e8f0;
}

/* Select2 Customization */
.select2-container--bootstrap-5 .select2-selection {
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    min-height: 38px;
}

.select2-container--bootstrap-5 .select2-selection:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.select2-container--bootstrap-5 .select2-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .stats-card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
    }

    .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }

    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }
}

@media (max-width: 576px) {
    .document-card-header,
    .document-card-body {
        padding: 15px;
    }

    h2 {
        font-size: 1.5rem;
    }

    .stats-card .stats-icon {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .btn,
    .navbar,
    .filter-section,
    .pagination,
    .sticky-top {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }

    .table {
        font-size: 0.9rem;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #1e293b;
        border-color: #334155;
    }

    .card-header {
        background-color: #0f172a;
        border-bottom-color: #334155;
    }

    .text-muted {
        color: #94a3b8 !important;
    }

    .form-control,
    .form-select {
        background-color: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }

    .table {
        color: #f1f5f9;
    }

    .table-hover tbody tr:hover {
        background-color: #334155 !important;
    }
}
