/* Custom styles for Loyalty Admin Panel */

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    color: #333;
}

/* Navbar */
.navbar-dark {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Cards */
.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: #f9f9f9 !important;
    box-shadow: inset 3px 0 0 var(--primary);
}

.table thead th {
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Badges */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}

/* Form controls */
.form-control, .form-select {
    border-radius: 4px;
    border: 1px solid #ddd;
    padding: 10px 12px;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Filters */
.filters {
    background: #f9f9f9;
    border: 1px solid #eee;
}

/* Modal */
.modal-content {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.modal-header {
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.modal-title {
    font-weight: 600;
    color: #333;
}

/* Pagination (в стиле Google) */
.page-summary {
    margin-top: 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.pagination .page-item {
    display: inline-flex;
}

.page-link {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 18px;
    background: transparent;
    color: #1a0dab;
    font-size: 15px;
    cursor: pointer;
}

.page-link:hover:not(:disabled) {
    background: #f1f3f4;
}

.page-link:disabled {
    color: #bbb;
    cursor: default;
}

.page-link.page-nav {
    padding: 0 14px;
}

.page-item.active .page-link {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.page-gap {
    min-width: 36px;
    text-align: center;
    color: #666;
    line-height: 36px;
}

/* Responsive */
@media (max-width: 768px) {
    .filters {
        grid-template-columns: 1fr !important;
    }

    .stat-card .value {
        font-size: 22px;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }
}

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

.container-main {
    animation: fadeIn 0.3s ease-in;
}

/* Utilities */
.text-muted {
    color: #999 !important;
}

.cursor-pointer {
    cursor: pointer;
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Mobile: карточки пользователей */
.user-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
}

.user-card:active {
    background: #f9f9f9;
}

.user-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.user-card-stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-weight: 600;
}

.user-card-stats small {
    display: block;
    font-weight: normal;
    font-size: 0.75rem;
    color: #888;
}

/* Панель действий в профиле пользователя — прилипает к низу */
.user-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 1;
}

.user-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
}

/* Дополнительные фильтры: на десктопе — обычные элементы сетки */
.filters-extra {
    display: contents;
}

@media (max-width: 767.98px) {
    /* 16px — иначе iOS увеличивает страницу при фокусе на поле */
    .form-control, .form-select {
        font-size: 16px;
    }

    .filters-extra {
        display: none;
    }

    .filters-extra.open {
        display: contents;
    }

    .pagination .page-link {
        padding: 10px 16px;
    }
}
