/**
 * IdeaDunes Compact Mode CSS
 * For data-heavy users who want more density
 * Toggle via: document.documentElement.classList.add('compact-mode');
 */

html.compact-mode {
    --compact-font-size: 0.75rem;
    --compact-padding: 0.25rem 0.375rem;
    --compact-margin: 0.25rem;
    --compact-row-height: 2rem;
}

html.compact-mode body {
    font-size: var(--compact-font-size);
}

html.compact-mode h1, 
html.compact-mode h2, 
html.compact-mode h3,
html.compact-mode h4,
html.compact-mode h5,
html.compact-mode h6 {
    margin: 0.25rem 0;
}

html.compact-mode h1 { font-size: 1.1rem; }
html.compact-mode h2 { font-size: 1rem; }
html.compact-mode h3 { font-size: 0.95rem; }

/* Reduce padding throughout */
html.compact-mode .btn,
html.compact-mode button,
html.compact-mode input,
html.compact-mode textarea,
html.compact-mode select,
html.compact-mode .form-control {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

html.compact-mode .form-group {
    margin-bottom: 0.375rem;
}

/* Table compaction */
html.compact-mode .table {
    font-size: 12px;
    margin-bottom: 0;
}
html.compact-mode .table th,
html.compact-mode .table td {
    padding: 4px 6px;
    vertical-align: middle;
}

html.compact-mode .table thead {
    font-weight: 700;
}

html.compact-mode .table tbody tr {
    height: 2rem;
}

/* Card/panel compaction */
html.compact-mode .card,
html.compact-mode .panel,
html.compact-mode .dash-panel,
html.compact-mode .tile {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
}

html.compact-mode .card-header,
html.compact-mode .panel-heading {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 700;
}

html.compact-mode .card-body,
html.compact-mode .panel-body {
    padding: 6px 8px;
}

/* List compaction */
html.compact-mode .list-group-item {
    padding: 4px 8px;
    font-size: 12px;
}

html.compact-mode .dropdown-item {
    padding: 4px 8px;
    font-size: 12px;
}

/* Modal compaction */
html.compact-mode .modal-body {
    padding: 8px;
}

html.compact-mode .modal-header {
    padding: 6px 12px;
}

html.compact-mode .modal-header .btn-close {
    width: 1.25rem;
    height: 1.25rem;
}

/* Sidebar compaction */
html.compact-mode .sidebar-left {
    --sidebar-width: 12.5rem; /* Narrower sidebar */
}

html.compact-mode .sidebar-item {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.4;
}

html.compact-mode .sidebar-item > a {
    padding: 4px 6px;
}

/* Dashboard sidebar compaction */
html.compact-mode .aside li a {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

html.compact-mode .aside .brand {
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
}

/* Remove max heights from scrollable areas */
html.compact-mode .dash-panel__body--scroll {
    max-height: 12.5rem;
}

/* Reduce spacing on stat cards */
html.compact-mode .dash-stat-card {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

html.compact-mode .dash-stat-card__value {
    font-size: 1.4rem;
}

html.compact-mode .dash-stat-card__label {
    font-size: 11px;
}

/* Reduce spacing in alerts */
html.compact-mode .alert {
    padding: 0.375rem 0.5rem;
    margin-bottom: 0.375rem;
    font-size: 0.75rem;
}

/* Icon sizing in compact mode */
html.compact-mode i, 
html.compact-mode .fa {
    font-size: 0.875rem;
}

html.compact-mode .fa-2x { font-size: 1.5rem; }
html.compact-mode .fa-3x { font-size: 2rem; }

/* Badge sizing */
html.compact-mode .badge {
    padding: 0.125rem 0.25rem;
    font-size: 0.6875rem;
}

/* Lines and dividers more subtle */
html.compact-mode hr {
    margin: 0.25rem 0;
    height: 0.5px;
}

/* DataTables specific compaction */
html.compact-mode .dataTables_wrapper {
    font-size: 12px;
}

html.compact-mode .dataTables_paginate {
    margin-top: 0.25rem;
}

html.compact-mode .pagination > li > a,
html.compact-mode .pagination > li > span {
    padding: 0.1875rem 0.375rem;
    font-size: 0.6875rem;
}

/* Tab navigation compaction */
html.compact-mode .nav-tabs {
    border-bottom: 0.0625rem solid #ddd;
}

html.compact-mode .nav-tabs > li > a {
    padding: 6px 8px;
    font-size: 12px;
}

/* Breadcrumb compaction */
html.compact-mode .breadcrumb {
    padding: 0.375rem 0;
    font-size: 0.6875rem;
}

html.compact-mode .breadcrumb > li + li::before {
    content: "/ ";
    padding: 0 0.1875rem;
}

/* Tooltip text sizing */
html.compact-mode .tooltip-inner,
html.compact-mode .popover {
    font-size: 0.6875rem;
    max-width: 12.5rem;
}

/* Improve readability - don't make text TOO small for accessibility */
html.compact-mode body { font-size: 0.75rem; line-height: 1.4; }
