/**
 * AccountingLT - Custom Styles
 */

/* ==========================================================================
   General Layout
   ========================================================================== */

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ==========================================================================
   Navbar
   ========================================================================== */

.navbar-brand {
    font-weight: 600;
}

.navbar .dropdown-menu {
    min-width: 220px;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table th {
    font-weight: 600;
    white-space: nowrap;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-label {
    font-weight: 500;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    border-top: 1px solid #dee2e6;
}

/* ==========================================================================
   Quick Action Buttons
   ========================================================================== */

.btn-outline-primary.py-3,
.btn-outline-success.py-3,
.btn-outline-danger.py-3 {
    transition: all 0.2s ease;
}

.btn-outline-primary.py-3:hover,
.btn-outline-success.py-3:hover,
.btn-outline-danger.py-3:hover {
    transform: translateY(-2px);
}

/* ==========================================================================
   Loading Overlay
   ========================================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
}

.loading-message {
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--color-primary-600, #2563eb);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #212529;
}

/* ==========================================================================
   Collapsible Sections
   ========================================================================== */

.collapsible-section {
    border: 1px solid #dee2e6;
}

.collapsible-section:hover {
    box-shadow: none;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    background-color: #f8f9fa;
    transition: background-color 0.15s ease;
}

.collapsible-header:hover {
    background-color: #e9ecef;
}

.collapsible-header:focus {
    outline: 2px solid var(--color-primary-600, #2563eb);
    outline-offset: -2px;
}

.collapsible-icon {
    transition: transform 0.2s ease;
    display: inline-block;
}

.collapsible-header[aria-expanded="false"] .collapsible-icon {
    transform: rotate(-90deg);
}

.collapsible-header[aria-expanded="true"] .collapsible-icon {
    transform: rotate(0deg);
}

/* ==========================================================================
   Date Presets
   ========================================================================== */

.date-presets {
    margin-bottom: 0.5rem;
}

.date-presets .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.date-presets .btn.active {
    background-color: var(--color-primary-600, #2563eb);
    color: white;
    border-color: var(--color-primary-600, #2563eb);
}

/* ==========================================================================
   Saved Filters
   ========================================================================== */

.saved-filters .dropdown-item {
    padding-right: 2.5rem;
    position: relative;
}

.saved-filters .dropdown-item button[data-filter-delete] {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.saved-filters .dropdown-item:hover button[data-filter-delete] {
    opacity: 1;
}

/* ==========================================================================
   Form Field Enhancements
   ========================================================================== */

/* Required field indicator */
.required-field label::after {
    content: " *";
    color: #dc3545;
}

/* Field with error */
.field-error input,
.field-error select,
.field-error textarea {
    border-color: #dc3545;
}

.compact-form .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .date-presets .btn-group {
        flex-wrap: wrap;
    }

    .date-presets .btn {
        margin-bottom: 0.25rem;
    }

    .collapsible-header {
        padding: 0.75rem 1rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .navbar,
    .footer,
    .btn,
    .no-print,
    .date-presets,
    .saved-filters,
    .loading-overlay,
    .breadcrumb {
        display: none !important;
    }

    main {
        padding: 0 !important;
    }

    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    .collapsible-section .collapse {
        display: block !important;
    }

    .collapsible-header {
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
