
/* ==========================================
   Global Button Styles - Bold Text
   ========================================== */

.btn,
.btn-small,
.btn-large,
.btn-flat,
.btn-floating {
    font-weight: bold !important;
}

/* ==========================================
   ACL Sidebar Menu Styles
   ========================================== */

.acl-sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.acl-sidebar-menu li {
    margin: 0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.acl-sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #424242;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.acl-sidebar-menu li a:hover {
    background-color: #e3f2fd;
    color: #1976d2;
}

.acl-sidebar-menu li.active a {
    background-color: #1976d2;
    color: white;
    font-weight: 500;
}

.acl-sidebar-menu li a i.material-icons {
    margin-right: 12px;
    font-size: 20px;
}

.acl-sidebar-menu li a span {
    font-size: 0.95rem;
}

/* ACL Section container */
.acl-section {
    animation: fadeIn 0.3s ease;
}

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

/* Responsive adjustments for sidebar */
@media only screen and (max-width: 992px) {
    .acl-sidebar-menu li a {
        padding: 10px 12px;
    }

    .acl-sidebar-menu li a span {
        font-size: 0.9rem;
    }
}

@media only screen and (max-width: 600px) {
    .acl-sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .acl-sidebar-menu li {
        flex: 1 1 45%;
    }

    .acl-sidebar-menu li a {
        padding: 10px;
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }

    .acl-sidebar-menu li a i.material-icons {
        margin-right: 0;
        margin-bottom: 5px;
    }
}


/* ==========================================
   ACL Permission Matrix - Tree View Styles
   ========================================== */

/* Tree container */
.permissions-tree-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px 0;
}

/* Main tree list */
.acl-tree {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* Nested tree lists */
.acl-tree ul.tree-children {
    list-style: none;
    padding-left: 25px;
    margin: 0;
    border-left: 2px dashed #e0e0e0;
    margin-left: 12px;
}

/* Tree item */
.acl-tree li.tree-item {
    padding: 2px 0;
}

/* Tree item content wrapper */
.acl-tree .tree-item-content {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.acl-tree .tree-item-content:hover {
    background-color: #f5f5f5;
}

/* Toggle button for expand/collapse */
.acl-tree .tree-toggle {
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.acl-tree .tree-toggle:hover {
    background-color: #e0e0e0;
}

.acl-tree .tree-toggle i {
    font-size: 18px;
    color: #757575;
}

/* Placeholder for items without children (alignment) */
.acl-tree .tree-toggle-placeholder {
    width: 24px;
    height: 24px;
    margin-right: 5px;
}

/* Checkbox label styling */
.acl-tree label {
    cursor: pointer;
    display: flex;
    align-items: center;
    flex: 1;
}

.acl-tree label span {
    padding-left: 30px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.acl-tree label span strong {
    color: #1976d2;
    font-weight: 600;
}

/* Source icon (static vs dynamic) */
.acl-tree label span i.tiny {
    font-size: 14px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Roles list styling */
#roles-list .collection-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

#roles-list .collection-item:hover {
    background-color: #e3f2fd;
}

#roles-list .collection-item.active {
    background-color: #1976d2 !important;
    color: white !important;
}

#roles-list .collection-item.active .badge {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Indeterminate checkbox visual indicator */
.acl-tree input[type="checkbox"].filled-in:indeterminate + span:not(.lever):after {
    border-color: #2196F3;
    background-color: #2196F3;
}

.acl-tree input[type="checkbox"].filled-in:indeterminate + span:not(.lever):before {
    border-right-color: transparent;
    border-bottom-color: white;
    border-right-width: 2px;
    border-bottom-width: 2px;
    top: 1px;
    left: 2px;
    width: 6px;
    height: 3px;
    transform: rotate(0deg);
}

/* Scrollbar styling for tree container */
.permissions-tree-container::-webkit-scrollbar {
    width: 8px;
}

.permissions-tree-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.permissions-tree-container::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 4px;
}

.permissions-tree-container::-webkit-scrollbar-thumb:hover {
    background: #9e9e9e;
}

/* Animation for tree expand/collapse */
.acl-tree .tree-children {
    overflow: hidden;
}

/* Responsive adjustments */
@media only screen and (max-width: 992px) {
    .acl-tree label span {
        font-size: 0.9rem;
    }

    .acl-tree ul.tree-children {
        padding-left: 15px;
    }
}

@media only screen and (max-width: 600px) {
    .permissions-tree-container {
        max-height: 350px;
    }

    .acl-tree .tree-item-content {
        padding: 8px 5px;
    }

    .acl-tree label span {
        font-size: 0.85rem;
    }
}


/* ==========================================
   City Search Dropdown Styles
   ========================================== */

.city-search-wrapper {
    position: relative;
}

.city-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
}

.city-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}

.city-dropdown-item:last-child {
    border-bottom: none;
}

.city-dropdown-item:hover {
    background: linear-gradient(135deg, #4169E1 0%, #3155B5 100%);
    color: white;
}

.city-dropdown-item:hover i {
    color: white;
}

.city-dropdown-item i {
    margin-right: 12px;
    color: #4169E1;
    font-size: 20px;
}

.city-dropdown-item span {
    flex: 1;
    font-size: 0.95rem;
}

.city-dropdown-item span small {
    color: #9e9e9e;
    margin-left: 5px;
}

.city-dropdown-item:hover span small {
    color: rgba(255, 255, 255, 0.8);
}

.city-dropdown-empty {
    padding: 15px;
    text-align: center;
    color: #9e9e9e;
    font-style: italic;
}

/* Scrollbar styling for city dropdown */
.city-dropdown::-webkit-scrollbar {
    width: 6px;
}

.city-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.city-dropdown::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 3px;
}

.city-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9e9e9e;
}

/* ==========================================
   City Collapse (collapsible city list in tables)
   ========================================== */

.city-collapse-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 260px;
}

.city-collapse-visible,
.city-collapse-hidden {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.city-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    white-space: nowrap;
    line-height: 1.6;
}

.city-badge i.material-icons {
    font-size: 13px;
    color: #4169E1;
}

.city-collapse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    background: #4169E1;
    color: #fff !important;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.city-collapse-toggle:hover {
    background: #3155B5;
}

.city-collapse-less {
    background: #90a4ae;
    font-weight: 500;
}

.city-collapse-less:hover {
    background: #78909c;
}

/* ==========================================
   CRUD Table Styles (Row-based display)
   ========================================== */

.crud-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.crud-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 16px 12px;
    border-bottom: 2px solid #e0e0e0;
}

.crud-table tbody tr {
    transition: background 0.2s;
}

.crud-table tbody tr:hover {
    background: #f8f9fa;
}

.crud-table tbody td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

/* Row Info Cell */
.row-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.row-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    text-transform: uppercase;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4169E1 0%, #3155B5 100%);
}

.row-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.row-details {
    display: flex;
    flex-direction: column;
}

.row-title {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.row-subtitle {
    font-size: 12px;
    color: #777;
}

/* Action Buttons - consistent style */
.action-buttons {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    justify-content: flex-start;
    white-space: nowrap;
}

.action-buttons .btn-small {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
}

.action-buttons .btn-small i {
    font-size: 20px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Ensure action column is wide enough */
.crud-table .actions-column,
.crud-table td:last-child {
    white-space: nowrap !important;
    width: 1% !important;
    min-width: fit-content !important;
}

.users-table .actions-column,
.users-table td:last-child {
    white-space: nowrap !important;
    width: 1% !important;
}

/* ==========================================
   Global Materialize Select Styling (Backend)
   ========================================== */

/* ---- GLOBAL CATCH-ALL: All Materialize selects ---- */
.select-wrapper .caret {
    fill: #4169E1 !important;
    right: 8px;
    z-index: 1;
    pointer-events: none;
}

.select-wrapper input.select-dropdown {
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    padding-right: 32px !important;
    cursor: pointer;
}

.select-wrapper input.select-dropdown:focus {
    border-color: #4169E1 !important;
}

/* Global dropdown content styling */
.select-wrapper .dropdown-content {
    border-radius: 8px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
    z-index: 9999 !important;
}

.select-wrapper .dropdown-content li > a,
.select-wrapper .dropdown-content li > span {
    color: #333 !important;
    font-size: 0.9rem;
}

.select-wrapper .dropdown-content li.selected {
    background-color: rgba(65, 105, 225, 0.08) !important;
}

.select-wrapper .dropdown-content li:hover {
    background-color: rgba(65, 105, 225, 0.05) !important;
}

/* ---- Standard .input-field selects in modals ---- */
.modal .input-field .select-wrapper .caret {
    fill: #4169E1 !important;
    right: 8px;
}

.modal .input-field .select-wrapper input.select-dropdown {
    border: 2px solid #e0e0e0 !important;
    border-radius: 10px !important;
    padding: 0 32px 0 14px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 14px;
    background: #fff !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

.modal .input-field .select-wrapper input.select-dropdown:focus {
    border-color: #4169E1 !important;
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.12) !important;
}

.modal .input-field .select-wrapper {
    margin: 0;
}

.modal .input-field .select-wrapper + label {
    transform: translateY(-24px) scale(0.85);
    transform-origin: 0 0;
    left: 0 !important;
    color: #4169E1;
    font-weight: 500;
}

/* Filter bar selects - all bar types */
.search-filter-bar .input-field,
.support-filter-bar .input-field,
.applications-filter-bar .input-field,
.filter-wrapper .input-field,
.filter-box .input-field {
    margin: 0 !important;
}

.search-filter-bar .select-wrapper input.select-dropdown,
.filter-wrapper .select-wrapper input.select-dropdown,
.filter-box .select-wrapper input.select-dropdown,
.support-filter-bar .select-wrapper input.select-dropdown,
.applications-filter-bar .select-wrapper input.select-dropdown {
    border: 2px solid #e0e5ee !important;
    border-radius: 10px !important;
    padding: 8px 14px !important;
    height: auto !important;
    line-height: normal !important;
    margin: 0 !important;
    font-size: 0.9rem;
    background: #fff;
    box-sizing: border-box !important;
    min-width: 140px;
}

.search-filter-bar .select-wrapper input.select-dropdown:focus,
.filter-wrapper .select-wrapper input.select-dropdown:focus,
.filter-box .select-wrapper input.select-dropdown:focus,
.support-filter-bar .select-wrapper input.select-dropdown:focus,
.applications-filter-bar .select-wrapper input.select-dropdown:focus {
    border-color: #4169E1 !important;
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.12) !important;
}

.search-filter-bar .select-wrapper .caret,
.filter-wrapper .select-wrapper .caret,
.filter-box .select-wrapper .caret,
.support-filter-bar .select-wrapper .caret,
.applications-filter-bar .select-wrapper .caret {
    fill: #4169E1;
}

/* Filter bar dropdown content */
.search-filter-bar .dropdown-content,
.filter-wrapper .dropdown-content,
.filter-box .dropdown-content,
.support-filter-bar .dropdown-content,
.applications-filter-bar .dropdown-content {
    border-radius: 10px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
}

.search-filter-bar .dropdown-content li > a,
.search-filter-bar .dropdown-content li > span,
.filter-wrapper .dropdown-content li > a,
.filter-wrapper .dropdown-content li > span,
.filter-box .dropdown-content li > a,
.filter-box .dropdown-content li > span {
    color: #333 !important;
    font-size: 0.9rem;
}

/* Subscription/Payment form Materialize selects */
.subscription-form .field .select-wrapper input.select-dropdown,
.payment-form .field .select-wrapper input.select-dropdown {
    width: 100%;
    height: 42px !important;
    padding: 0 32px 0 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box !important;
    margin: 0 !important;
    line-height: 42px !important;
}

.subscription-form .field .select-wrapper input.select-dropdown:focus,
.payment-form .field .select-wrapper input.select-dropdown:focus {
    border-color: #4169E1 !important;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.12) !important;
}

.subscription-form .field .select-wrapper .caret,
.payment-form .field .select-wrapper .caret {
    fill: #4169E1;
    right: 10px;
}

.subscription-form .field .select-wrapper,
.payment-form .field .select-wrapper {
    margin: 0;
}

.subscription-form .field .dropdown-content,
.payment-form .field .dropdown-content {
    border-radius: 8px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
    z-index: 9999 !important;
}

.subscription-form .field .dropdown-content li > a,
.subscription-form .field .dropdown-content li > span,
.payment-form .field .dropdown-content li > a,
.payment-form .field .dropdown-content li > span {
    color: #333 !important;
    font-size: 14px;
    padding: 10px 14px;
}

/* Subscription plan form Materialize selects */
.plan-form .field .select-wrapper input.select-dropdown {
    width: 100%;
    height: 42px !important;
    padding: 0 32px 0 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box !important;
    margin: 0 !important;
    line-height: 42px !important;
}

.plan-form .field .select-wrapper input.select-dropdown:focus {
    border-color: #4169E1 !important;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.12) !important;
}

.plan-form .field .select-wrapper .caret {
    fill: #4169E1;
    right: 10px;
}

.plan-form .field .select-wrapper {
    margin: 0;
}

.plan-form .field .dropdown-content {
    border-radius: 8px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
    z-index: 9999 !important;
}

/* Modal form selects */
.modal .input-field.materialize-select-styled {
    margin: 0 !important;
    padding: 0 !important;
}

.modal .materialize-select-styled .select-wrapper {
    margin: 0;
}

.modal .materialize-select-styled .select-wrapper input.select-dropdown {
    border: 2px solid #e0e5ee !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    height: auto !important;
    line-height: normal !important;
    margin: 0 !important;
    font-size: 0.95rem;
    color: #333;
    background: #fff;
    box-sizing: border-box !important;
}

.modal .materialize-select-styled .select-wrapper input.select-dropdown:focus {
    border-color: #4169E1 !important;
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.12) !important;
}

.modal .materialize-select-styled .select-wrapper .caret {
    fill: #4169E1;
    right: 10px;
}

.modal .materialize-select-styled .dropdown-content {
    z-index: 9999 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
}

.modal .materialize-select-styled .dropdown-content li > a,
.modal .materialize-select-styled .dropdown-content li > span {
    color: #333 !important;
    font-size: 0.95rem;
    padding: 10px 16px;
}

.modal .materialize-select-styled .dropdown-content li.selected {
    background: rgba(65, 105, 225, 0.08);
}

.modal .materialize-select-styled .dropdown-content li:hover {
    background: rgba(65, 105, 225, 0.06) !important;
}

/* ==========================================
   Celebration Selector in Search Filter Bar
   ========================================== */

/* When a select (not text input) is inside search-input-wrapper,
   the icon overlaps - add left padding to clear it */
.search-filter-bar .search-input-wrapper .select-wrapper input.select-dropdown {
    padding-left: 44px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.search-filter-bar .search-input-wrapper .select-wrapper input.select-dropdown:focus {
    border: none !important;
    box-shadow: none !important;
}

/* Blue icon for celebration selector */
.search-filter-bar .search-input-wrapper > i.material-icons {
    color: #4169E1 !important;
}

/* ==========================================
   Modern Input - Select wrapper in Modals
   Fix for select elements not getting proper
   Materialize styling in modal forms
   ========================================== */

.modern-input .select-wrapper input.select-dropdown,
.modern-input .select-wrapper input.select-dropdown[type="text"],
.modern-input .select-wrapper input[type="text"].select-dropdown:not(.browser-default),
.modal .modern-input .select-wrapper input.select-dropdown,
.modal .modern-input .select-wrapper input.select-dropdown[type="text"] {
    padding: 16px 36px 16px 52px !important;
    border: 0 none !important;
    border-bottom: 0 none !important;
    border-width: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 1rem !important;
    height: auto !important;
    margin: 0 !important;
    cursor: pointer;
}

.modern-input .select-wrapper input.select-dropdown:focus,
.modal .modern-input .select-wrapper input.select-dropdown:focus {
    border: 0 none !important;
    border-bottom: 0 none !important;
    border-width: 0 !important;
    box-shadow: none !important;
}

.modern-input .select-wrapper {
    border: none !important;
    border-bottom: none !important;
}

.modern-input .select-wrapper > select {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    border: none !important;
}

.modern-input .select-wrapper .caret {
    fill: #4169E1 !important;
    right: 12px;
}

.modern-input .select-wrapper .dropdown-content {
    z-index: 9999 !important;
}

/* ==========================================
   Celebration Budget Summary Cards
   ========================================== */

#budget-summary .col {
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    #budget-summary .row {
        margin-bottom: 0;
    }

    #budget-summary div[style*="font-size: 24px"] {
        font-size: 20px !important;
    }
}

/* ==========================================
   Celebration Table Rows - Text Overflow
   ========================================== */

.crud-table td {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crud-table td .row-info {
    overflow: hidden;
}

.crud-table td .row-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 200px;
}

/* Actions column should not be constrained */
.crud-table td:last-child,
.crud-table th.actions-column + td {
    max-width: none;
    overflow: visible;
}

/* ==========================================
   Empty State Direct Icon Styling
   When <i> is used without .empty-icon wrapper
   ========================================== */

.empty-state > i.material-icons {
    display: block;
    font-size: 60px;
    color: #4169E1;
    opacity: 0.3;
    margin-bottom: 15px;
}
