@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #0f172a;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #cffafe;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-alt: #f1f5f9;
    --border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-main: #121212;
    --bg-card: #1e1e1e;
    --bg-alt: #2a2a2a;
    --border: #333333;
    --text-main: #ffffff;
    --text-muted: #cccccc;
    --text-light: #aaaaaa;
    --secondary: #ffffff;
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    direction: rtl;
    text-align: right;
}

/* Numbers in Latin font for crisp look */
.font-number, .code-tag, .phone-num {
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
}

/* Navbar */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--secondary);
    font-weight: 800;
    font-size: 1.25rem;
}

.nav-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-item a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.nav-item a:hover, .nav-item a.active {
    color: var(--primary);
    background: var(--primary-light);
}

.badge-pulse {
    position: absolute;
    top: 2px;
    left: 4px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-tag {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-alt);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.btn-logout {
    color: var(--danger);
    background: var(--danger-light);
    border: none;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #fecaca;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 260px;
    height: 100vh;
    max-height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 200;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.sidebar-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--secondary);
    font-weight: 800;
    font-size: 1.05rem;
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(79,70,229,0.3);
}

.sidebar-brand-text { line-height: 1.3; }
.sidebar-brand-text small { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; display: block; }

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    list-style: none;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.4) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.4);
    border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.sidebar-nav li a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.sidebar-nav li a.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 700;
}

.sidebar-nav li a i { width: 1.1rem; text-align: center; flex-shrink: 0; }

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0.75rem;
}

.sidebar-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem 0.25rem;
}

.sidebar-user {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg,var(--primary),#7c3aed);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-weight: 700; font-size: 0.9rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.75rem; color: var(--text-muted); }

/* Mobile toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 300;
    background: var(--primary);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

/* Layout */
.main-wrapper {
    margin-right: 260px;
    padding: 2rem 1.5rem;
    flex: 1;
    width: calc(100% - 260px);
    min-height: 100vh;
    transition: margin-right 0.3s ease;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-right: 0;
        width: 100%;
        padding: 1rem;
        padding-top: 4rem;
    }
    .sidebar-toggle { display: flex; }
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.stat-number {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--secondary);
    font-family: 'Outfit', sans-serif;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }

/* Notice Banner */
.scope-banner {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 1.25rem 1.75rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow-md);
}

.scope-banner .scope-text h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.scope-banner .scope-text p {
    font-size: 0.9rem;
    color: #cbd5e1;
}

.scope-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Card & Table */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 2rem;
}

.card-header-bar {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--bg-main);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filters-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input, .select-filter {
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--bg-card);
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.search-input:focus, .select-filter:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.custom-table th {
    background: var(--bg-main);
    padding: 0.95rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.custom-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    vertical-align: middle;
}

.custom-table tr:hover td {
    background: rgba(79, 70, 229, 0.05);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-primary { background: var(--primary-light); color: var(--primary-hover); }
.badge-info { background: var(--info-light); color: #155e75; }

.code-tag {
    background: var(--bg-alt);
    border: 1px dashed var(--border);
    color: var(--text-main);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 1px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalShow 0.25s ease-out;
}

@keyframes modalShow {
    from { opacity: 0; transform: translateY(15px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-main);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.75rem;
    max-height: 80vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text-main);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }

/* Code Checker Card */
.checker-box {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.checker-box h2 {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.checker-form {
    max-width: 550px;
    margin: 1.5rem auto 0;
    display: flex;
    gap: 0.5rem;
}

.checker-input {
    flex: 1;
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    font-size: 1.1rem;
    outline: none;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 1px;
}

/* Profile Card */
.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
}

.profile-meta h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.profile-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Empty State */
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-links {
        gap: 0.25rem;
    }
    .nav-item a {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    .filters-bar, .page-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    .nav-container {
        flex-wrap: wrap;
        padding: 1rem;
    }
    .nav-brand {
        flex: 1;
    }
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0;
        border-top: 1px solid var(--border);
        margin-top: 1rem;
    }
    .nav-links.show {
        display: flex;
    }
    .user-profile-menu {
        width: 100%;
        justify-content: space-between;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .checker-form {
        flex-direction: column;
    }
    .profile-card {
        flex-direction: column;
        text-align: center;
    }
    
    /* Make table fully scrollable and look better on mobile */
    .table-responsive {
        border-radius: var(--radius-sm);
        box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
    }
    
    /* Stats cards stacking */
    div[style*="display: grid; grid-template-columns: repeat"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Filter form inputs should stack */
    form[action="winners.php"] > div {
        width: 100%;
        min-width: 100% !important;
    }
    
    .news-ticker marquee, .motivation-ticker marquee {
        font-size: 0.8rem;
    }
}

/* ========================================================
   Box Choice Grid & Rating Buttons Components
   ======================================================== */
.box-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
    margin-top: 6px;
}
.box-choice-btn {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
}
.box-choice-btn:hover {
    border-color: #f59e0b;
    background: #fffdf5;
    color: #92400e;
    transform: translateY(-1px);
}
.box-choice-btn.active {
    border-color: #f59e0b;
    background: #fef3c7;
    color: #92400e;
    font-weight: 800;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}
.box-choice-btn.custom-btn {
    border-style: dashed;
    border-color: #93c5fd;
    color: #1e40af;
    background: #f8fafc;
}
.box-choice-btn.custom-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}
.box-choice-btn.custom-btn.active {
    border-style: solid;
    border-color: #2563eb;
    background: #dbeafe;
    color: #1e40af;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.rating-btn-group {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 6px;
}
@media (max-width: 480px) {
    .rating-btn-group {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 6px;
    }
}
.rating-btn {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: inherit;
    transition: all 0.2s ease;
    width: 100%;
}
.rating-btn .rate-emoji {
    font-size: 1.35rem;
    line-height: 1;
}
.rating-btn .rate-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: #475569;
}
.rating-btn:hover {
    transform: translateY(-2px);
    border-color: #94a3b8;
    background: #f8fafc;
}
.rating-btn.active.rate-5 {
    border-color: #10b981;
    background: #ecfdf5;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}
.rating-btn.active.rate-5 .rate-label {
    color: #047857;
}
.rating-btn.active.rate-4 {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}
.rating-btn.active.rate-4 .rate-label {
    color: #1d4ed8;
}
.rating-btn.active.rate-3 {
    border-color: #f59e0b;
    background: #fffbeb;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}
.rating-btn.active.rate-3 .rate-label {
    color: #b45309;
}
.rating-btn.active.rate-2 {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.22);
}
.rating-btn.active.rate-2 .rate-label {
    color: #c2410c;
}
.rating-btn.active.rate-1 {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
}
.rating-btn.active.rate-1 .rate-label {
    color: #b91c1c;
}

