/* ===================================================
   USER PORTAL STYLESHEET (Compact, Responsive & Pagination)
   =================================================== */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --user-bg: #f8fafc;
    --card-border: #e2e8f0;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --dark-nav: #0f172a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--user-bg);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Navbar */
.navbar-dark.bg-dark {
    background-color: var(--dark-nav) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* Cards */
.card {
    border: 1px solid var(--card-border);
    border-radius: 0.85rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
}

/* Tabs */
.nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    border-bottom: 2px solid var(--card-border);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tabs .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    border: none;
    padding: 0.75rem 1.1rem;
    border-radius: 0;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    font-weight: 700;
    border-bottom: 3px solid var(--primary-color);
    background: transparent;
}

/* ===================================================
   SIDE-BY-SIDE UPLOAD CONTAINER (Left dropzone, Right button)
   =================================================== */
.upload-horizontal-container {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.upload-dropzone-side {
    flex-grow: 1;
    border: 2px dashed #93c5fd;
    background-color: #f8faff;
    border-radius: 0.65rem;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-dropzone-side:hover,
.upload-dropzone-side.dragover {
    background-color: #eff6ff;
    border-color: var(--primary-color);
}

.upload-btn-side {
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: 0.65rem;
}

/* Medium Square Media Box */
.media-square-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f1f5f9;
    border-radius: 0.65rem;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
}

.media-square-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.media-square-box img:hover {
    transform: scale(1.03);
}

.pdf-preview-box {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
}

.pdf-icon {
    font-size: 2.8rem;
    line-height: 1;
}

/* ===================================================
   LOGS TABLE: FIXED WIDTH PAYLOAD & WRAP ALL CONTENT
   =================================================== */
.payload-col-fixed {
    width: 360px;
    min-width: 320px;
    max-width: 400px;
}

.payload-content-box {
    background: #18181b;
    color: #a5f3fc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.35;
    padding: 8px 10px;
    border-radius: 6px;
    max-height: 140px;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid #27272a;
    margin: 0;
}

.payload-content-box::-webkit-scrollbar {
    width: 4px;
}

.payload-content-box::-webkit-scrollbar-thumb {
    background: #52525b;
    border-radius: 4px;
}

/* Pagination bar styles */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding: 8px 4px;
}

.pagination-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.pagination .page-link {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
    color: var(--text-primary);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    font-weight: bold;
}

/* ===================================================
   TOP & BOTTOM PAGINATION BAR CONTROLS
   =================================================== */

.pagination-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    padding: 6px 2px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 14px;
    padding: 6px 2px;
}

@media (max-width: 576px) {
    .pagination-top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .pagination-bottom-bar {
        justify-content: center;
    }
}

.table-responsive {
    border-radius: 0.65rem;
    background-color: #ffffff;
    border: 1px solid var(--card-border);
}

.table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}


/* ===================================================
   COMPACT MEDIA TABLE THUMBNAIL (NOT OVERSIZED)
   =================================================== */

.media-thumb-square {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.pdf-thumb-box {
    background: #fee2e2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
}

.pdf-thumb-box small {
    font-size: 0.6rem;
    font-weight: bold;
    color: #dc2626;
    margin-top: 2px;
}


/* Terminal Code Box Styling */
.code-terminal-box {
    position: relative;
    background: #18181b !important;
    border: 1px solid #27272a;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 1rem;
}

.code-terminal-box pre {
    background: transparent !important;
    color: #38bdf8 !important; /* Cyan terminal font */
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.45;
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-terminal-box .copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #27272a;
    color: #e4e4e7;
    border: 1px solid #3f3f46;
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.code-terminal-box .copy-code-btn:hover {
    background: #3f3f46;
    color: #ffffff;
}

@media (max-width: 768px) {
    .upload-horizontal-container {
        flex-direction: column;
    }
    .upload-btn-side {
        width: 100%;
        min-height: 40px;
    }
    .pagination-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}