/**
 * TileSections – Plugin Styles
 *
 * Styles for tile section headers and wrappers on the Helpdesk home page.
 * Uses Tabler/Bootstrap classes for theme compatibility.
 */

/* ── Anti-flash during admin grid reorganization ─────────────────────── */

[data-glpi-helpdesk-config-tiles].ts-loading {
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}

[data-glpi-helpdesk-config-tiles] {
    opacity: 1;
    transition: opacity 0.15s ease-in-out;
}

.tiles-banner.ts-loading {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.tiles-banner {
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

/* ── Section Wrapper ────────────────────────────────────────────────── */

.ts-section {
    border-radius: 8px;
    padding: 1rem 0;
    margin-bottom: 1rem;
    transition: background-color 0.3s ease;
}

.ts-section:first-child {
    margin-top: 0.5rem;
}

/* When using a background class, add some padding (and reset row gutters
   so cards don't overflow the colored area) */
.ts-section[class*="bg-"] {
    padding: 1rem 1.5rem;
}

.ts-section[class*="bg-"] > .row {
    margin-left: 0;
    margin-right: 0;
}

/* Section header gets matching horizontal alignment with row gutters */
.ts-section .ts-section-header {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ── Section Header ─────────────────────────────────────────────────── */

.ts-section-header {
    padding: 0.25rem 0;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid rgba(128, 128, 128, 0.15);
}

.ts-section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0;
    color: inherit;
    letter-spacing: 0.01em;
}

.ts-section-header .text-muted {
    font-size: 0.85rem;
}

.ts-section-header i {
    font-size: 1.2rem;
}

/* ── Smooth fade-in for reorganized tiles ───────────────────────────── */

.ts-section .row {
    animation: tsFadeIn 0.3s ease-in-out;
}

@keyframes tsFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Section dropdown in admin offcanvas ─────────────────────────────── */

#ts-section-dropdown {
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: var(--tblr-border-radius, 4px);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#ts-section-dropdown:focus {
    border-color: var(--tblr-primary, #206bc4);
    box-shadow: 0 0 0 0.25rem rgba(32, 107, 196, 0.25);
}

/* ── Admin page styles ──────────────────────────────────────────────── */

.ts-edit-section {
    padding: 0.25rem 0.5rem;
}

/* ── Responsive adjustments ─────────────────────────────────────────── */

@media (max-width: 576px) {
    .ts-section {
        padding: 0.5rem 0.25rem;
    }

    .ts-section-header h3 {
        font-size: 0.9rem;
    }

    .ts-section-header .text-muted {
        display: none;
    }
}

/* ── Dark mode compatibility (GLPI uses [data-bs-theme="dark"]) ──── */

[data-bs-theme="dark"] .ts-section-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
