/* Documents Tab Styles */
.documents-section {
    padding: 20px;
}

.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.documents-actions {
    display: flex;
    gap: 10px;
}

.document-item {
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
}

.document-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.document-icon {
    font-size: 1.5rem;
    margin-right: 10px;
}

.document-actions .btn {
    margin: 0 2px;
}

.upload-modal .modal-body {
    padding: 30px;
}

.file-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-drop-zone:hover {
    border-color: #007bff;
    background-color: #e3f2fd;
}

.file-drop-zone.dragover {
    border-color: #28a745;
    background-color: #d4edda;
}

.file-input-hidden {
    display: none;
}

.upload-instructions {
    color: #6c757d;
    margin-top: 10px;
}

.selected-file-info {
    margin-top: 15px;
}

.documents-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.documents-empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.document-type-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
}

.documents-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .documents-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .documents-actions {
        justify-content: center;
    }
    
    .document-item .row {
        align-items: flex-start;
    }
    
    .document-item .col-md-3.text-end {
        text-align: left !important;
        margin-top: 10px;
    }
    
    .documents-stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.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-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Alert styles for better UX */
.alert {
    margin-bottom: 15px;
}

.alert-success {
    border-color: #28a745;
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    border-color: #dc3545;
    background-color: #f8d7da;
    color: #721c24;
}

.alert-info {
    border-color: #17a2b8;
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Document preview styles */
.document-preview {
    max-width: 100%;
    height: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.document-viewer-modal .modal-dialog {
    max-width: 90vw;
    max-height: 90vh;
}

.document-viewer-modal .modal-body {
    padding: 0;
    height: 80vh;
    overflow: hidden;
}

.document-viewer-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Enhanced Document Management Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: #ecf0f1;
}

/* Fixed Banner */
.fixed-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 80px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    display: flex;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-placeholder {
    margin-left: 40px;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
}

.project-info {
    margin-left: auto;
    margin-right: 40px;
    text-align: right;
}

.project-info h1 {
    font-size: 24px;
    font-weight: 600;
    color: #ecf0f1;
    margin: 0;
}

.project-info p {
    font-size: 14px;
    color: #bdc3c7;
    margin: 0;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
    padding: 0;
}

/* Documents Layout */
.documents-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Documents Sidebar */
.documents-sidebar {
    width: 280px;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-btn {
    display: block;
    width: 100%;
    padding: 18px 25px;
    background: transparent;
    border: none;
    color: #bdc3c7;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    margin-bottom: 2px;
}

.sidebar-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border-left-color: rgba(52, 152, 219, 0.3);
}

.sidebar-btn.active {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border-left-color: #3498db;
    font-weight: 600;
}

/* Documents Viewport */
.documents-viewport {
    flex: 1;
    padding: 30px;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%);
    overflow-y: auto;
}

/* Document Sections */
.document-section {
    display: none;
}

.document-section.active {
    display: block;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.section-header h2 {
    color: #ecf0f1;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.section-description {
    color: #bdc3c7;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(52, 73, 94, 0.3);
    border-radius: 12px;
    border-left: 4px solid #3498db;
}

/* Document Statistics */
.documents-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(44, 62, 80, 0.8);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 10px;
}

.stat-label {
    color: #bdc3c7;
    font-size: 1rem;
    font-weight: 500;
}

/* Job Paperwork Types Grid */
.paperwork-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.paperwork-type-card {
    background: rgba(44, 62, 80, 0.8);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.paperwork-type-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4);
    background: rgba(52, 152, 219, 0.1);
}

.paperwork-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.paperwork-type-card h4 {
    color: #ecf0f1;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.paperwork-type-card p {
    color: #bdc3c7;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Documents Container */
.documents-container {
    background: rgba(44, 62, 80, 0.3);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Upload Area */
.upload-area {
    margin-bottom: 30px;
}

.file-drop-zone {
    border: 3px dashed rgba(52, 152, 219, 0.4);
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    background: rgba(52, 152, 219, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-drop-zone:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.file-drop-zone.dragover {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.file-drop-zone h4 {
    color: #ecf0f1;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.file-drop-zone p {
    color: #bdc3c7;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.file-drop-zone small {
    color: #95a5a6;
    font-size: 0.9rem;
}

/* Photos Grid */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.btn-secondary {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
    border: 1px solid rgba(149, 165, 166, 0.4);
}

.btn-secondary:hover {
    background: rgba(149, 165, 166, 0.3);
    transform: translateY(-1px);
}

/* Form Styles */
.form-control {
    background: rgba(52, 73, 94, 0.8);
    border: 1px solid rgba(127, 140, 141, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    color: #ecf0f1;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(52, 73, 94, 0.9);
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

.form-control::placeholder {
    color: #7f8c8d;
}

.form-label {
    color: #bdc3c7;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

/* Modal Enhancements */
.modal-content {
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: #ecf0f1;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 30px;
}

.modal-title {
    color: #ecf0f1;
    font-weight: 600;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 30px;
}

.btn-close {
    background: none;
    border: none;
    color: #bdc3c7;
    font-size: 1.5rem;
    opacity: 0.7;
}

.btn-close:hover {
    opacity: 1;
    color: #ecf0f1;
}

/* Progress Bar */
.progress {
    background: rgba(52, 73, 94, 0.8);
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    transition: width 0.3s ease;
    height: 100%;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    z-index: 10000;
    font-weight: 500;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification-success {
    background: #2ecc71;
    color: white;
}

.notification-error {
    background: #e74c3c;
    color: white;
}

.notification-info {
    background: #3498db;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .documents-layout {
        flex-direction: column;
    }
    
    .documents-sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }
    
    .sidebar-btn {
        white-space: nowrap;
        margin-right: 10px;
        margin-bottom: 0;
        padding: 12px 20px;
        border-radius: 8px;
    }
    
    .documents-viewport {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .paperwork-types-grid {
        grid-template-columns: 1fr;
    }
    
    .documents-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Document Card Styles */
.document-card {
    background: rgba(44, 62, 80, 0.8);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 15px;
}

.document-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.document-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.document-title {
    color: #ecf0f1;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.document-type-badge {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.document-card-body {
    margin-bottom: 15px;
}

.document-meta {
    color: #bdc3c7;
    font-size: 0.9rem;
}

.document-card-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-outline-primary {
    background: transparent;
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.4);
}

.btn-outline-primary:hover {
    background: rgba(52, 152, 219, 0.2);
    border-color: #3498db;
}

.btn-outline-success {
    background: transparent;
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.btn-outline-success:hover {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
}

.btn-outline-danger {
    background: transparent;
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.4);
}

.btn-outline-danger:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
}

/* Recent Documents Section */
.recent-documents h3 {
    color: #ecf0f1;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Generated Paperwork Section */
.generated-paperwork h3 {
    color: #ecf0f1;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 40px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced form styling for modals */
.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .row {
    margin-bottom: 15px;
}

/* Material item styling for dynamic forms */
.material-item {
    background: rgba(52, 73, 94, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.material-item:not(:last-child) {
    margin-bottom: 15px;
}

/* Form check styling */
.form-check {
    padding-left: 1.5rem;
}

.form-check-input {
    background-color: rgba(52, 73, 94, 0.8);
    border: 1px solid rgba(127, 140, 141, 0.3);
}

.form-check-input:checked {
    background-color: #3498db;
    border-color: #3498db;
}

.form-check-label {
    color: #bdc3c7;
}

/* Select styling */
select.form-control {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23bdc3c7' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 40px;
}

/* Loading state for buttons */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Document viewer enhancements */
.document-viewer-modal .modal-dialog {
    max-width: 95vw;
    max-height: 95vh;
    margin: 1rem auto;
}

.document-viewer-modal .modal-content {
    height: 90vh;
}

.document-viewer-modal .modal-body {
    height: calc(90vh - 120px);
    padding: 0;
}

#documentViewerFrame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Empty state styling */
.text-center.py-4 {
    padding: 40px 20px;
    color: #7f8c8d;
}

.text-center.py-4 p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Text utilities */
.text-muted {
    color: #7f8c8d !important;
}

/* Alert styling for dark theme */
.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 20px;
}

.alert-info {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border-left: 4px solid #3498db;
}

.alert-success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border-left: 4px solid #2ecc71;
}

.alert-danger {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 1.25rem 1rem;
}
