/* =====================================================
   AI MPF - Application Styles
   ===================================================== */

.cursor-pointer { cursor: pointer; }

/* ---- Document Thumbnails ---- */
.doc-thumbs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.doc-thumb-wrapper {
    position: relative;
    flex-shrink: 0;
}

.doc-thumb {
    width: 88px;
    height: 88px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    position: relative;
    transition: border-color .15s;
}
.doc-thumb:hover {
    border-color: #0d6efd;
}
.doc-thumb:hover .doc-thumb-overlay {
    opacity: 1;
}

.doc-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s;
}

.doc-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-thumb-pdf {
    text-align: center;
    padding: 6px 4px;
}

.doc-thumb-label {
    font-size: 10px;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 78px;
    margin-top: 2px;
}

.doc-thumb-delete {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 12px;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    line-height: 1;
    opacity: 0;
    transition: opacity .15s;
}
.doc-thumb-wrapper:hover .doc-thumb-delete {
    opacity: 1;
}

:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1a1f36;
    --primary: #0d6efd;
}

/* Layout */
body {
    background-color: #f0f2f5;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.wrapper {
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

/* Sidebar Nav */
#sidebar .nav-link {
    color: rgba(255,255,255,0.65);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    transition: all 0.15s;
    font-size: 0.9rem;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.12);
    color: #fff;
}

#sidebar .nav-link.active {
    background-color: rgba(13,110,253,0.25);
    color: #4da6ff;
}

/* Cards */
.card {
    border-radius: 12px;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
}

/* Tabs */
.nav-tabs .nav-link {
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    color: #495057;
}

.nav-tabs .nav-link.active {
    font-weight: 600;
    color: var(--primary);
}

.tab-content {
    border-radius: 0 0 12px 12px;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #dee2e6;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9fa;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: #e7f0ff;
}

.upload-zone.uploading {
    opacity: 0.6;
    pointer-events: none;
}

/* Doc cards */
.doc-card {
    transition: box-shadow 0.2s;
}

.doc-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.doc-item {
    background: #f8f9fa;
    font-size: 0.82rem;
}

/* Page content */
.page-content {
    background-color: #f0f2f5;
}

/* Tables */
.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    font-weight: 600;
}

/* Badges */
.badge {
    font-weight: 500;
}

/* Form sizing */
.form-control-sm, .form-select-sm {
    font-size: 0.875rem;
}

/* Sidebar logo */
.sidebar-logo {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
}

/* Toast container */
.toast-container {
    z-index: 9999;
}

/* Accordion */
.accordion-button:not(.collapsed) {
    background-color: #e7f0ff;
    color: #0d6efd;
}

/* Status badge in header */
.badge.fs-6 {
    font-size: 0.85rem !important;
    padding: 0.4em 0.75em;
}

/* Disabled generate button */
button:disabled {
    cursor: not-allowed;
}

/* Auth page */
body.auth-page {
    background: linear-gradient(135deg, #1a1f36 0%, #0d6efd 100%);
}

/* Quick upload zones (dashboard) */
.quick-upload-zone {
    border: 2px dashed #dee2e6;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9fa;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quick-upload-zone:hover,
.quick-upload-zone.dragover {
    border-color: var(--primary);
    background: #e7f0ff;
}

.quick-upload-zone input[type="file"] {
    display: none;
}
