/**
 * --------------------------------------------------------------------------------
 * Admin Modern Premium UI Styles
 * Centralized stylesheet for standardizing Blade views across the application.
 * --------------------------------------------------------------------------------
 */

/* =========================================================================
   1. Modern Card Containers
   ========================================================================= */
.modern-card, 
.modern-form-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    background: #fff;
    margin-bottom: 25px;
}

/* =========================================================================
   2. Modern Headers (Gradient Dark Blue)
   ========================================================================= */
.modern-header,
.modern-form-header {
    background: linear-gradient(135deg, var(--brand-navy, #4482c8), #1d334d);
    color: white;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
}
.modern-header h4,
.modern-form-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}
.modern-header h4 i,
.modern-form-header h4 i {
    font-size: 1.5rem;
    margin-right: 10px;
    color: var(--brand-orange, #F3780A); /* Brand Orange */
}

/* =========================================================================
   3. Custom Form Inputs
   ========================================================================= */
.custom-label {
    font-weight: 600;
    color: #1b3a5f;
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.custom-input {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 10px 15px;
    font-size: 0.95rem;
    background: #f8fafc;
    transition: all 0.3s ease;
}
.custom-input:focus {
    background: #fff;
    border-color: var(--brand-orange, #F3780A);
    box-shadow: 0 0 0 3px rgba(243, 120, 10, 0.15);
    outline: none;
}

/* =========================================================================
   4. Location/Filter Wrappers — Professional Filter Box System
   ========================================================================= */
.location-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

/* Legacy filter-section: now delegates to .pro-filter-card */
.filter-section {
    margin-bottom: 25px;
}

/* Force all columns in the filter form to align and wrap into multiple lines —
   prevents single line overflow and scrollbars */
.pro-filter-card,
.pro-filter-card form,
.pro-filter-card form.row,
.pro-filter-card .row {
    display: flex !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-x: visible !important;
    max-width: 100% !important;
}

.pro-filter-card form.row,
.pro-filter-card form {
    align-items: flex-end !important;
    width: 100% !important;
}

.pro-filter-card form.row > [class*="col-"],
.pro-filter-card form > [class*="col-"] {
    flex-shrink: 0 !important;
    max-width: 100% !important;
}

/* ── Professional Filter Card ── */
.pro-filter-card {
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
    border: 1px solid #dde4f5;
    border-radius: 14px;
    padding: 18px 22px 14px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(79, 108, 176, 0.07);
    position: relative;
    overflow: visible !important;
}
.pro-filter-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, var(--brand-navy, #4482c8), #6c8be3);
    border-radius: 14px 0 0 14px;
}
.pro-filter-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--brand-navy, #4482c8);
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.pro-filter-title i { font-size: 14px; }

/* Field wrapper with leading icon */
.pro-filter-field {
    position: relative;
}
.pro-filter-field .pf-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #7a93cc;
    font-size: 13px;
    z-index: 5;
    pointer-events: none;
}
.pro-filter-field .form-select,
.pro-filter-field .form-control,
.pro-filter-field .custom-input {
    padding-left: 30px !important;
    border-radius: 9px !important;
    border-color: #c8d5ef !important;
    background-color: #fff !important;
    font-size: 13px;
    height: 38px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pro-filter-field .form-select:focus,
.pro-filter-field .form-control:focus,
.pro-filter-field .custom-input:focus {
    border-color: var(--brand-navy, #4482c8) !important;
    box-shadow: 0 0 0 3px rgba(68, 130, 200, 0.12) !important;
}

/* Small uppercase label above each field */
.pro-filter-label {
    font-size: 10.5px;
    font-weight: 700;
    color: #6b7fa8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

/* Search button */
.btn-pro-search {
    background: linear-gradient(135deg, var(--brand-navy, #4482c8) 0%, #2d5ca6 100%);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(68, 130, 200, 0.28);
    white-space: nowrap;
    height: 38px;
}
.btn-pro-search:hover {
    opacity: 0.88;
    box-shadow: 0 4px 14px rgba(68, 130, 200, 0.38);
    color: #fff;
}

/* Reset button */
.btn-pro-reset {
    background: #fff;
    color: #6b7fa8;
    border: 1.5px solid #c8d5ef;
    border-radius: 9px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    height: 38px;
}
.btn-pro-reset:hover {
    background: #eef2ff;
    color: var(--brand-navy, #4482c8);
    border-color: var(--brand-navy, #4482c8);
    text-decoration: none;
}

/* Active filter chips row */
.pro-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.pro-filter-chip {
    background: #e0e8f8;
    color: #3a5ba0;
    border-radius: 20px;
    padding: 3px 11px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pro-filter-chips-label {
    font-size: 11px;
    color: #6b7fa8;
    font-weight: 600;
    align-self: center;
    white-space: nowrap;
}


/* =========================================================================
   5. Dynamic Rows (e.g. Traffic signs, multiple entries)
   ========================================================================= */
.traffic-sign-row,
.dynamic-form-row {
    background: #ffffff;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 20px !important;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 1.5rem !important;
}
.traffic-sign-row:hover,
.dynamic-form-row:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1 !important;
    transform: translateY(-2px);
}
.row-number-badge {
    position: absolute;
    top: -12px;
    left: 15px;
    background: var(--brand-orange, #F3780A);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* =========================================================================
   6. Buttons Customization
   ========================================================================= */
/* Submit Form Buttons */
.btn-submit-modern {
    background: linear-gradient(135deg, var(--brand-navy, #4482c8), #1d334d);
    border: none;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 10px rgba(27, 58, 95, 0.3);
    transition: all 0.3s ease;
}
.btn-submit-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(27, 58, 95, 0.4);
    color: white;
}
.btn-cancel-modern {
    background: #e2e8f0;
    color: #475569;
    border: none;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}
.btn-cancel-modern:hover {
    background: #cbd5e1;
    color: #1e293b;
    text-decoration: none;
}

/* Add New / Register Action Buttons */
.btn-register {
    background: linear-gradient(135deg, var(--brand-orange, #F3780A), #d96500);
    border: none;
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(243, 120, 10, 0.3);
    text-decoration: none;
}
.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(243, 120, 10, 0.4);
    color: white;
    text-decoration: none;
}

/* Dynamic Add Row / Add More */
.btn-dashed-add {
    width: 100%;
    padding: 12px;
    background: rgba(243, 120, 10, 0.05);
    border: 2px dashed var(--brand-orange, #F3780A);
    color: var(--brand-orange, #F3780A);
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.3s ease;
}
.btn-dashed-add:hover {
    background: var(--brand-orange, #F3780A);
    color: white;
}

/* Small Action Item Buttons (Tables, Rows) */
.btn-action-remove {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-action-remove:hover {
    background: #dc3545;
    color: white;
}

.btn-view, .btn-view-modern {
    background: rgba(68, 130, 200, 0.1);
    color: var(--brand-navy, #4482c8);
    border: none;
    font-weight: 600;
    padding: 6px 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-view:hover, .btn-view-modern:hover {
    background: var(--brand-navy, #4482c8);
    color: white;
    text-decoration: none;
}

.btn-edit-modern {
    background: rgba(243, 120, 10, 0.1);
    color: var(--brand-orange, #F3780A);
    border: none;
    font-weight: 600;
    padding: 6px 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-edit-modern:hover {
    background: var(--brand-orange, #F3780A);
    color: white;
    text-decoration: none;
}

.btn-delete-modern {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: none;
    font-weight: 600;
    padding: 6px 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-delete-modern:hover {
    background: #dc2626;
    color: white;
    text-decoration: none;
}

/* Back Button in Headers */
.btn-back-modern {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-back-modern:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
}


/* =========================================================================
   7. Tables & Information Display
   ========================================================================= */
.modern-table {
    width: 100%;
}
.modern-table th {
    background: #f8fafc;
    color: var(--brand-navy, #4482c8);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 15px;
}
.modern-table td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
.modern-table tbody tr {
    transition: all 0.2s ease;
}
.modern-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Details and Quantity Badges */
.badge-quantity {
    background: rgba(68, 130, 200, 0.1);
    color: var(--brand-navy, #4482c8);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Info Blocks (for Show pages, Dashboard details, etc) */
.info-block {
    background: #f8fafc;
    border-left: 4px solid var(--brand-orange, #F3780A);
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 0.95rem;
    margin-bottom: 15px;
}
.info-block strong {
    color: var(--brand-navy, #4482c8);
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}
.info-block span {
    font-weight: 700;
    color: #334155;
    font-size: 1.1rem;
}

/* =========================================================================
   8. Select2 — Pro Filter Override (Block dropdown)
   Matches native pro-filter-field selects exactly in height, border & focus.
   ========================================================================= */

/* Make Select2 container fill the pro-filter-field wrapper */
.pro-filter-field .select2-container {
    width: 100% !important;
    font-size: 13px;
}

/* The visible selection box — mirrors .form-select in pro-filter-field */
.pro-filter-field .select2-container--default .select2-selection--single {
    height: 38px !important;
    line-height: 38px !important;
    border-radius: 9px !important;
    border: 1px solid #c8d5ef !important;
    background-color: #fff !important;
    padding: 0 32px 0 30px !important; /* left room for icon, right for arrow */
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Rendered value text — vertically centred via line-height */
.pro-filter-field .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
    padding: 0 !important;
    color: #475569;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* Caret arrow — pinned to the right, vertically centred */
.pro-filter-field .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    width: 28px !important;
    top: 0 !important;
    right: 4px !important;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pro-filter-field .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #6b7fa8 transparent transparent !important;
    border-width: 5px 4px 0 !important;
    margin-top: 0 !important;
    top: auto !important;
}

/* Focus ring — mirrors pro-filter-field focus */
.pro-filter-field .select2-container--default.select2-container--focus .select2-selection--single,
.pro-filter-field .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--brand-navy, #4482c8) !important;
    box-shadow: 0 0 0 3px rgba(68, 130, 200, 0.12) !important;
    outline: none;
}

/* Dropdown panel */
.select2-dropdown {
    border-radius: 9px !important;
    border: 1px solid #c8d5ef !important;
    box-shadow: 0 6px 20px rgba(68, 130, 200, 0.12) !important;
    font-size: 13px;
    overflow: hidden;
}

/* Search input inside the dropdown */
.select2-container--default .select2-search--dropdown .select2-search__field {
    border-radius: 6px !important;
    border: 1px solid #c8d5ef !important;
    padding: 6px 10px !important;
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--brand-navy, #4482c8) !important;
    box-shadow: 0 0 0 3px rgba(68, 130, 200, 0.12) !important;
    outline: none;
}

/* Options — highlighted / selected state */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--brand-navy, #4482c8) !important;
    color: #fff !important;
}
.select2-container--default .select2-results__option {
    padding: 7px 12px;
}

/* Clear (×) button */
.pro-filter-field .select2-container--default .select2-selection--single .select2-selection__clear {
    position: absolute;
    right: 26px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: #94a3b8;
    line-height: 1;
    z-index: 1;
}
.pro-filter-field .select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #dc2626;
}


