/**
 * HappyHourHere Dashboard Custom Styles
 * Brand Color: #EA002F
 */

:root {
    --tblr-primary: #EA002F;
    --tblr-primary-rgb: 234, 0, 47;
    --happyhour-red: #EA002F;
    --happyhour-red-hover: #C00028;
    --happyhour-red-dark: #A0001F;
}

/* Brand Color Overrides */
.btn-primary {
    background-color: var(--happyhour-red);
    border-color: var(--happyhour-red);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--happyhour-red-hover);
    border-color: var(--happyhour-red-hover);
    color: #fff;
}

.btn-primary:active,
.btn-primary.active {
    background-color: var(--happyhour-red-dark);
    border-color: var(--happyhour-red-dark);
}

/* Buttons */
.ti {
    font-size: large;
    margin-right: 5px;
}

/* Links */
a {
    color: var(--happyhour-red);
}

a:hover {
    color: var(--happyhour-red-hover);
}

/* Navbar Brand */
.navbar-brand {
    color: var(--happyhour-red);
    font-weight: 600;
}

.navbar-brand:hover {
    color: var(--happyhour-red-hover);
}

/* Form Controls Focus */
.form-control:focus,
.form-select:focus {
    border-color: var(--happyhour-red);
    box-shadow: 0 0 0 0.25rem rgba(234, 0, 47, 0.25);
}

.form-check-input:checked {
    background-color: var(--happyhour-red);
    border-color: var(--happyhour-red);
}

/* Card Status Bar */
.card-status-top.bg-primary {
    background-color: var(--happyhour-red) !important;
}

/* Pagination */
.page-item.active .page-link {
    background-color: var(--happyhour-red);
    border-color: var(--happyhour-red);
}

.page-link {
    color: var(--happyhour-red);
}

.page-link:hover {
    color: var(--happyhour-red-hover);
}

/* Badge */
.badge.bg-primary {
    background-color: var(--happyhour-red) !important;
}

/* Alerts */
.alert-primary {
    background-color: rgba(234, 0, 47, 0.1);
    border-color: var(--happyhour-red);
    color: var(--happyhour-red-dark);
}

/* Table Styles */
.table-vcenter td {
    vertical-align: middle;
}

/* Action Buttons */
.btn-group .btn-icon {
    padding: 0.25rem 0.5rem;
}

/* Search Input */
#search-input {
    min-width: 200px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #search-input {
        min-width: 150px;
    }

    .card-actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Logo/Brand area */
.navbar-brand-image {
    max-height: 2rem;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Menu item formset styling */
#menuitem-table tbody tr {
    transition: background-color 0.2s;
}

#menuitem-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Loading states */
.ti-loader {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Row grouping for happy hour list (server-side) */
tr.bg-light td {
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--tblr-border-color);
}

/**
 * Table sort (List.js integration)
 * Ported from Tabler dev branch: core/scss/ui/_tables.scss
 */
.table-sort {
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    border: 0;
    background: inherit;
    display: block;
    width: 100%;
    text-align: inherit;
    cursor: pointer;
    padding: 0.75rem;
    margin: -0.75rem;
    transition: color 0.3s;
}

.table-sort:hover,
.table-sort.asc,
.table-sort.desc {
    color: var(--tblr-body-color);
}

.table-sort::after {
    content: '';
    display: inline-flex;
    width: 1rem;
    height: 1rem;
    vertical-align: bottom;
    background: currentColor;
    margin-left: 0.25rem;
    /* Neutral: up + down chevrons */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1'%3E%3Cpath d='M5 7l3 -3l3 3'/%3E%3Cpath d='M5 10l3 3l3 -3'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1'%3E%3Cpath d='M5 7l3 -3l3 3'/%3E%3Cpath d='M5 10l3 3l3 -3'/%3E%3C/svg%3E");
}

.table-sort.asc::after {
    /* Ascending: up chevron */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1' d='M5 10l3 -3l3 3'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1' d='M5 10l3 -3l3 3'/%3E%3C/svg%3E");
}

.table-sort.desc::after {
    /* Descending: down chevron */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1' d='M5 7l3 3l3 -3'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='1' d='M5 7l3 3l3 -3'/%3E%3C/svg%3E");
}
