/* ============================================
   Utility Classes
   ============================================ */

/* Loading State Transitions */
#statsContainer,
#performanceTableContainer,
#leadsContainer,
.section-body {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Smooth Table Transitions */
.table-fade-out {
    opacity: 0.4;
    transform: translateY(5px);
    pointer-events: none;
}

.table-fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Table Row Animations */
table tbody tr {
    transition: background-color 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
}

table tbody tr.row-entering {
    animation: rowSlideIn 0.3s ease forwards;
}

@keyframes rowSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Filter Select Transitions */
.status-filter-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.status-filter-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    outline: none;
}

/* Loading Spinner for Filters */
.filter-loading {
    position: relative;
}

.filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: filterSpin 0.6s linear infinite;
}

@keyframes filterSpin {
    to { transform: rotate(360deg); }
}

/* Text Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Color Utilities */
.text-muted { color: #666; }
.text-primary { color: var(--primary); }
.text-success { color: #4CAF50; }
.text-warning { color: #ff9800; }
.text-danger { color: #f44336; }

/* Font Size Utilities */
.text-sm { font-size: 0.7em; }
.text-md { font-size: 0.8em; }
.text-lg { font-size: 0.95em; }
.text-xl { font-size: 1.1em; }
.text-2xl { font-size: 1.5em; }

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 30px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 30px; }

.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }
.p-5 { padding: 30px; }

.pt-4 { padding-top: 20px; }
.pt-5 { padding-top: 30px; }
.pb-4 { padding-bottom: 20px; }

/* Flexbox Utilities */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 5px; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 15px; }
.gap-4 { gap: 20px; }
.flex-1 { flex: 1; }

/* Display Utilities */
.d-none { display: none !important; }
.hidden { display: none !important; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }

/* Width Utilities */
.w-100 { width: 100%; }
.w-50 { width: 50%; }
.w-auto { width: auto; }

/* Height Utilities */
.h-100 { height: 100%; }
.h-auto { height: auto; }

/* Border Utilities */
.border-top { border-top: 2px solid #f0f0f0; }
.border-rounded { border-radius: 8px; }

/* Overflow Utilities */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.text-ellipsis { 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
}

/* Max Width Utilities */
.max-w-150 { max-width: 150px; }
.max-w-200 { max-width: 200px; }

/* Background Utilities */
.bg-success-light { background: #e8f5e9; }
.bg-warning-light { background: #fff3e0; }
.bg-info-light { background: #e3f2fd; }
.bg-duplicate { background: #fff8e1; }

/* Specific Component Classes */
.sidebar-user-info {
    color: #666;
    font-size: 0.8em;
}

.menu-item-logout {
    margin-top: 20px;
    border-top: 2px solid #f0f0f0;
    padding-top: 20px;
}

.empty-state-container {
    text-align: center;
    padding: 30px 20px;
}

.empty-state-icon {
    font-size: 1.4em;
    margin-bottom: 8px;
}

.leads-summary {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.summary-item {
    padding: 8px 12px;
    border-radius: 6px;
    flex: 1;
    min-width: 90px;
    text-align: center;
}

.summary-item.success {
    background: #e8f5e9;
}

.summary-item.warning {
    background: #fff3e0;
}

.summary-item.info {
    background: #e3f2fd;
}

.summary-value {
    font-size: 1.1em;
    font-weight: bold;
}

.summary-value.success {
    color: #2e7d32;
}

.summary-value.warning {
    color: #e65100;
}

.summary-value.info {
    color: #1565c0;
}

.summary-label {
    font-size: 0.75em;
}

.summary-label.success {
    color: #388e3c;
}

.summary-label.warning {
    color: #f57c00;
}

.summary-label.info {
    color: #1976d2;
}

.marketer-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.marketer-name {
    font-weight: bold;
}

.marketer-code {
    font-size: 0.85em;
    color: #888;
}

.campaign-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.form-group.hidden {
    display: none;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    width: 100%;
}

.create-campaign-btn {
    width: 100%;
    padding: 20px;
    font-size: 1.2em;
    margin-bottom: 20px;
}

.campaign-hint {
    text-align: center;
    color: #666;
    margin-bottom: 15px;
}

/* ============================================
   Centralized Styles for Marketing System
   ============================================ */

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #4CAF50;
    --warning: #ff9800;
    --danger: #f44336;
    --light: #f8f9fa;
    --dark: #343a40;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    padding: 0;
    direction: rtl;
    margin: 0;
}

/* Body styles for pages with side menu */
body:has(.side-menu),
body.has-side-menu {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* ============================================
   Side Menu Styles
   ============================================ */

.side-menu {
    width: 280px;
    background: white;
    min-height: 100vh;
    box-shadow: 5px 0 20px rgba(0,0,0,0.1);
    padding: 30px 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 10000;
    transition: width 0.3s ease, transform 0.3s ease;
    overflow: visible;
}

/* Toggle Button - Always visible outside menu */
.menu-toggle-btn {
    position: fixed;
    right: 15px;
    top: 15px;
    width: 45px;
    height: 45px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10002;
    transition: all 0.3s ease;
    color: var(--primary);
}

.menu-toggle-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Desktop: Position toggle button inside menu (RTL - menu on right) */
@media (min-width: 993px) {
    .menu-toggle-btn {
        left: auto;
        right: 230px;
        top: 20px;
        transform: none;
    }
    
    /* When menu is collapsed (70px), position inside collapsed menu */
    .menu-toggle-btn.menu-collapsed {
        right: 12px;
    }
}

/* Mobile Menu Overlay */
.side-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.side-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: flex;
    position: fixed;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: white;
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 10001;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.mobile-menu-toggle:hover span {
    background: white;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.side-menu.collapsed {
    width: 70px;
}

.side-menu.collapsed .side-menu-item-text,
.side-menu.collapsed .side-menu-header h2,
.side-menu.collapsed .side-menu-header p {
    display: none;
}

.side-menu.collapsed .side-menu-item {
    justify-content: center;
    align-items: center;
    padding: 18px 10px;
    min-height: 60px;
}

.side-menu.collapsed .side-menu-item-icon {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    width: 100%;
}

.menu-toggle {
    position: fixed;
    right: 20px;
    top: 20px;
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10005;
    transition: all 0.3s;
    line-height: 1;
    font-size: 20px;
}

.menu-toggle:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.side-menu-header {
    padding: 0 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.side-menu-header h2 {
    color: var(--primary);
    font-size: 1.2em;
    margin-bottom: 5px;
    white-space: nowrap;
}

.side-menu-item {
    padding: 16px 25px;
    cursor: pointer;
    transition: all 0.3s;
    border-right: 4px solid transparent;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    min-height: 56px;
}

.side-menu-item a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    height: 100%;
}

.side-menu-item:hover {
    background: #f8f9fa;
    border-right-color: var(--primary);
}

.side-menu-item.active {
    background: linear-gradient(to left, rgba(102, 126, 234, 0.1), transparent);
    border-right-color: var(--primary);
    color: var(--primary);
    font-weight: bold;
}

.side-menu-item-icon {
    font-size: 1.2em;
    min-width: 32px;
    width: 32px;
    height: 32px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.side-menu-item-text {
    font-size: 0.95em;
    white-space: nowrap;
}

/* ============================================
   Layout & Container Styles
   ============================================ */

.page-wrapper {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.dashboard {
    flex: 1;
    margin-right: 280px;
    padding: 12px;
    width: calc(100% - 280px);
    max-width: calc(100% - 280px);
    box-sizing: border-box;
    transition: margin-right 0.3s ease, width 0.3s ease, max-width 0.3s ease;
}

.side-menu.collapsed ~ .dashboard,
.page-wrapper:has(.side-menu.collapsed) .dashboard,
body:has(.side-menu.collapsed) .dashboard,
body.has-side-menu:has(.side-menu.collapsed) .dashboard {
    margin-right: 70px;
    width: calc(100% - 70px);
    max-width: calc(100% - 70px);
}

.page-content-wrapper {
    flex: 1;
    margin-right: 280px;
    padding: 12px;
    width: calc(100% - 280px);
    max-width: calc(100% - 280px);
    box-sizing: border-box;
    transition: margin-right 0.3s ease, width 0.3s ease, max-width 0.3s ease;
}

.page-wrapper:has(.side-menu.collapsed) .page-content-wrapper,
body:has(.side-menu.collapsed) .page-content-wrapper,
body.has-side-menu:has(.side-menu.collapsed) .page-content-wrapper {
    margin-right: 70px;
    width: calc(100% - 70px);
    max-width: calc(100% - 70px);
}

/* Responsive Design */
/* Mobile Menu Overlay */
.side-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.side-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 10001;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.mobile-menu-toggle:hover span {
    background: white;
}

.mobile-menu-toggle span {
    width: 26px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: none;
    }
    
    .menu-toggle {
        display: flex !important;
        right: 15px;
        top: 15px;
        width: 50px;
        height: 50px;
        font-size: 24px;
        z-index: 10005;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    
    .menu-toggle-btn {
        left: 15px !important;
        top: 15px !important;
        transform: none !important;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    h2 {
        font-size: 1.2em;
    }
    
    h3 {
        font-size: 1em;
    }
    
    .side-menu {
        transform: translateX(100%);
        transition: transform 0.3s ease;
        width: 280px !important;
        z-index: 10000;
        box-shadow: -5px 0 20px rgba(0,0,0,0.3);
    }
    
    .side-menu.open,
    .side-menu.mobile-open {
        transform: translateX(0);
    }
    
    /* Force uncollapsed state on mobile */
    .side-menu.collapsed {
        transform: translateX(100%);
        width: 280px !important;
    }
    
    .side-menu.collapsed.mobile-open {
        transform: translateX(0);
    }
    
    .side-menu.collapsed .side-menu-item-text,
    .side-menu.collapsed .side-menu-header h2,
    .side-menu.collapsed .side-menu-header p {
        display: block !important;
    }
    
    .side-menu.open .side-menu-item-text,
    .side-menu.mobile-open .side-menu-item-text,
    .side-menu.open .side-menu-header h2,
    .side-menu.mobile-open .side-menu-header h2,
    .side-menu.open .side-menu-header p,
    .side-menu.mobile-open .side-menu-header p {
        display: block !important;
    }
    
    .side-menu.collapsed .side-menu-item {
        justify-content: flex-start !important;
        padding: 16px 25px !important;
    }
    
    .side-menu.collapsed .side-menu-item-icon {
        margin: 0;
        font-size: 1.5em !important;
        width: 32px;
    }
    
    .dashboard,
    .page-content-wrapper {
        margin-right: 0 !important;
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px 15px;
        padding-top: 75px;
        background: #f5f6fa;
        box-sizing: border-box;
    }
    
    body,
    body.has-side-menu,
    body:has(.side-menu) {
        padding: 0;
        display: block !important;
        background: #f5f6fa;
    }
    
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
    
    table {
        font-size: 0.85em;
    }
    
    th, td {
        padding: 8px 5px;
    }
}

@media (max-width: 768px) {
    .dashboard,
    .page-content-wrapper {
        padding: 10px;
        padding-top: 70px;
        background: #f5f6fa;
    }
    
    .header {
        padding: 12px 15px;
        margin-bottom: 12px;
    }
    
    .header h1 {
        font-size: 1.4em;
        line-height: 1.3;
    }
    
    .welcome-card {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
    
    .welcome-card h1 {
        font-size: 1.6em;
    }
    
    .stats-container {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px 8px;
    }
    
    .stat-card h3 {
        font-size: 0.75em;
        margin-bottom: 6px;
    }
    
    .stat-value {
        font-size: 1.3em !important;
    }
    
    .stat-card .label {
        font-size: 0.7em;
    }
    
    .section {
        padding: 15px;
        margin-bottom: 15px;
        overflow-x: hidden;
        max-width: 100%;
    }
    
    .section > div[style*="overflow-x: auto"],
    .section .table-responsive {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .section h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    table {
        font-size: 0.75em;
        min-width: 800px;
        width: 100%;
    }
    
    th, td {
        padding: 6px 3px;
        white-space: nowrap;
    }
    
    td {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-bar input,
    .filter-bar select,
    .filter-bar button {
        width: 100%;
    }
    
    .chart-container {
        max-height: 250px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }
    
    .modal-content form .modal-body {
        max-height: calc(85vh - 160px);
        overflow-y: auto;
    }
    
    .modal-content form .modal-footer {
        flex-shrink: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 15px;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-width: 100px;
        padding: 10px 12px;
        font-size: 0.85em;
    }
}
    
    .section {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .section h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    table {
        font-size: 0.85em;
    }
    
    th, td {
        padding: 8px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

@media (max-width: 576px) {
    .header h1 {
        font-size: 1.3em;
    }
    
    .header p {
        font-size: 0.9em;
    }
    
    .section {
        padding: 15px;
    }
    
    .tabs {
        margin-bottom: 15px;
    }
    
    .toolbar {
        padding: 12px;
    }
    
    .toolbar h2 {
        font-size: 1.1em;
    }
    
    .stat-card {
        padding: 8px 6px;
    }
    
    .stat-card h3 {
        font-size: 0.7em;
        margin-bottom: 4px;
    }
    
    .stat-value {
        font-size: 1.1em !important;
    }
    
    .stats-container {
        gap: 6px;
    }
    
    .welcome-card {
        padding: 25px;
    }
    
    .welcome-card h1 {
        font-size: 1.8em;
    }
}

/* ============================================
   Header Styles
   ============================================ */

.header {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
}

.header h1 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 8px;
}

.header p {
    color: #666;
    font-size: 0.95em;
}

/* ============================================
   Section Styles
   ============================================ */

.section {
    background: white;
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 15px;
}

.section h2 {
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 0.95em;
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

/* ============================================
   Stats & Cards
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

@media (min-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.stat-card h3 {
    color: #666;
    font-size: 0.75em;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 0.8em;
    color: var(--success);
    font-weight: bold;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

.stat-change.neutral {
    color: #666;
}

/* Transaction Status Badges */
.status-completed {
    color: #388e3c;
    font-weight: 600;
}

.status-rejected {
    color: #c62828;
    font-weight: 600;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.content-grid > .section {
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.content-grid > .section h2 {
    flex-shrink: 0;
}

.content-grid > .section > div:not(.actions) {
    flex: 1;
}

.content-grid .actions {
    margin-top: auto;
    padding-top: 15px;
}

/* Charts grid specific styling */
.charts-grid > .section {
    min-height: 350px;
}

.charts-grid .chart-container {
    height: 100%;
    min-height: 300px;
}

@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid > .section {
        min-height: auto;
    }
    
    .charts-grid > .section {
        min-height: 300px;
    }
}

/* ============================================
   Table Styles
   ============================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

th, td {
    padding: 6px 8px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #f8f9fa;
    font-weight: bold;
    color: #666;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

tr:hover {
    background: #fafafa;
}

/* ============================================
   Status Badges
   ============================================ */

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.badge-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
    color: #333;
}

.badge-info {
    background: linear-gradient(135deg, #3494e6 0%, #ec6ead 100%);
    color: white;
}

.badge-secondary {
    background: linear-gradient(135deg, #a8a8a8 0%, #c4c4c4 100%);
    color: white;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.7em;
    font-weight: bold;
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

.status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-جديد {
    background: #e3f2fd;
    color: #1976d2;
}

.status-cancel {
    background: #ffebee;
    color: #c62828;
}

.status-الغاء-الطلب {
    background: #ffebee;
    color: #c62828;
}

.status-confirm {
    background: #e8f5e9;
    color: #388e3c;
}

.status-تاكيد-الطلب {
    background: #e8f5e9;
    color: #388e3c;
}

.status-no-response {
    background: #f5f5f5;
    color: #757575;
}

.status-لم-يتم-الرد {
    background: #f5f5f5;
    color: #757575;
}

.status-qualified {
    background: #fff8e1;
    color: #ffb300;
}

.status-مؤهل {
    background: #fff8e1;
    color: #ffb300;
}

.status-delivered {
    background: #e0f2f1;
    color: #00897b;
}

.status-تم-التوصيل {
    background: #e0f2f1;
    color: #00897b;
}

/* Hide all export buttons across screens */
button[id^="export"],
a[id^="export"],
#exportBtn {
    display: none !important;
}

/* Facebook Pixel input rows */
.pixel-item {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.pixel-item .pixel-id {
    flex: 1;
    min-width: 220px;
}

.pixel-remove-btn {
    padding: 8px 12px;
    font-size: 0.85em;
    min-width: 90px;
}

@media (max-width: 640px) {
    .pixel-item {
        flex-direction: column;
        align-items: stretch;
    }

    .pixel-item .pixel-id,
    .pixel-remove-btn {
        width: 100%;
    }
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-decoration: none;
    font-family: 'Tajawal', sans-serif;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: visible;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

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

.btn-success:hover {
    background: #45a049;
}

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

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

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8em;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: 10px;
}

.form-group label,
.form-label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: bold;
    font-size: 0.9em;
}

.form-control,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85em;
    font-family: 'Tajawal', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    background: white;
}

.form-group select,
.form-control[type="select"],
select.form-control {
    width: 100%;
    padding: 12px 35px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.9em;
    font-family: 'Tajawal', sans-serif;
    transition: border-color 0.3s;
    box-sizing: border-box;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 12px;
}

.form-control:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Ensure all inputs in modals are styled */
.modal-body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.modal-body textarea,
.modal-body select,
.modal input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
.modal textarea,
.modal select,
#campaignForm input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
#campaignForm textarea,
#campaignForm select {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 0.95em !important;
    font-family: 'Tajawal', sans-serif !important;
    transition: border-color 0.3s, box-shadow 0.3s !important;
    box-sizing: border-box !important;
    background: white !important;
    display: block;
    color: #333 !important;
}

.modal-body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):focus,
.modal-body textarea:focus,
.modal-body select:focus,
.modal input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):focus,
.modal textarea:focus,
.modal select:focus,
#campaignForm input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):focus,
#campaignForm textarea:focus,
#campaignForm select:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.form-control[readonly],
.form-group input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.8;
}

.form-control[readonly]:focus,
.form-group input[readonly]:focus {
    border-color: #e0e0e0;
    box-shadow: none;
}

/* ============================================
   Modals
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.modal-content.loading {
    pointer-events: none;
    opacity: 0.7;
}

.modal-content.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Prevent modal from resizing */
.modal.active .modal-content {
    height: auto;
    max-height: 85vh;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
    font-weight: bold;
    line-height: 1.4;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title {
    margin: 0;
    color: #333;
    font-size: 1em;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.6em;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 15px 20px;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

.modal-content form {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 90vh;
}

.modal-content form .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
    max-height: calc(85vh - 140px);
}

.modal-content form .form-group:last-of-type {
    margin-bottom: 0;
}

.modal-footer,
.actions {
    padding: 15px 20px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 10px;
    margin-top: 0;
    flex-shrink: 0;
    flex-direction: row-reverse;
    background: white;
    flex-wrap: wrap;
}

.modal-content form .modal-footer {
    padding: 15px 20px;
    border-top: 2px solid #f0f0f0;
    margin-top: 0;
    background: white;
    flex-shrink: 0;
}

.modal-content form .actions {
    padding: 0;
    border-top: none;
    margin-top: 15px;
}

.modal-footer .btn {
    min-width: 120px;
    padding: 10px 20px;
    font-size: 0.9em;
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
}

/* Mobile optimization for modal footer */
@media (max-width: 640px) {
    .modal-content form .modal-footer {
        padding: 12px 15px;
        flex-direction: row;
        gap: 8px;
    }
    
    .modal-footer .btn {
        min-width: auto;
        flex: 1;
        padding: 12px 8px;
        font-size: 0.85em;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .modal-content form .modal-body {
        max-height: calc(90vh - 140px);
        padding: 15px;
    }
    
    .modal-content form .modal-footer {
        padding: 10px 12px;
        gap: 6px;
    }
    
    .modal-footer .btn {
        padding: 10px 8px;
        font-size: 0.8em;
        min-width: auto;
    }
}

/* ============================================
   Form Row (Side-by-side fields)
   ============================================ */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 12px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* Ensure form-row items align properly */
.form-row .form-group textarea,
.form-row .form-group input {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-row .form-group {
        margin-bottom: 12px;
    }
}

/* ============================================
   Color Picker Styles
   ============================================ */

.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.color-option.selected,
.color-option.active {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    transform: scale(1.15);
}

/* ============================================
   Image Preview Styles
   ============================================ */

.image-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.gallery-preview img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-preview img:hover {
    transform: scale(1.05);
}

/* ============================================
   Feature Editor Styles
   ============================================ */

#featuresEditor {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.feature-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.feature-item-title {
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
}

.feature-item-remove {
    background: #f44336;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s;
}

.feature-item-remove:hover {
    background: #d32f2f;
    transform: scale(1.05);
}

.feature-item-fields {
    display: grid;
    grid-template-columns: 60px 1fr 2fr;
    gap: 8px;
}

.feature-icon,
.feature-title,
.feature-desc {
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'Tajawal', sans-serif;
    transition: border-color 0.3s;
}

.feature-icon {
    text-align: center;
    font-size: 1.2em;
}

.feature-icon:focus,
.feature-title:focus,
.feature-desc:focus {
    outline: none;
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .feature-item-fields {
        grid-template-columns: 1fr;
    }
}

/* Modal Loader */
.modal-loading {
    position: relative;
    pointer-events: none;
}

.modal-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1;
    border-radius: 20px;
}

.modal-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   Fullscreen and Large Modals
   ============================================ */

.modal.fullscreen-modal {
    padding: 20px;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.modal.fullscreen-modal.active {
    display: flex !important;
}

.modal.fullscreen-modal .modal-content.large-modal {
    width: 85%;
    max-width: 1100px;
    max-height: 85vh;
    height: auto;
    margin: 0 auto;
    position: relative;
}

.modal-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 30px;
    border-bottom: 2px solid #f0f0f0;
    background: #f8f9fa;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-box {
    min-width: 150px;
}

.filter-box select {
    width: 100%;
    padding: 12px 35px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    font-family: 'Tajawal', sans-serif;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 12px;
}

.filter-box select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-body-scroll {
    padding: 20px 30px;
    overflow-y: auto;
    overflow-x: auto;
    max-height: calc(90vh - 200px);
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.modal-body-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-body-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body-scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-body-scroll::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.modal-body-scroll table {
    width: 100%;
    border-collapse: collapse;
}

.modal-body-scroll table th,
.modal-body-scroll table td {
    padding: 8px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
}

.modal-body-scroll table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-body-scroll table tr:hover {
    background: #f8f9fa;
}

.modal-body-scroll table a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.modal-body-scroll table a:hover {
    text-decoration: underline;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.marketers-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    min-width: 1200px;
    background: white;
}

.marketers-table th,
.marketers-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column widths for better layout */
.marketers-table th:nth-child(1),
.marketers-table td:nth-child(1) { width: 120px; } /* الكود */
.marketers-table th:nth-child(2), 
.marketers-table td:nth-child(2) { width: 200px; white-space: normal; } /* الاسم */
.marketers-table th:nth-child(3),
.marketers-table td:nth-child(3) { width: 140px; } /* الهاتف */
.marketers-table th:nth-child(4),
.marketers-table td:nth-child(4) { width: 80px; text-align: center; } /* العملاء */
.marketers-table th:nth-child(5),
.marketers-table td:nth-child(5) { width: 120px; text-align: center; } /* الحالة */
.marketers-table th:nth-child(6),
.marketers-table td:nth-child(6) { width: 120px; text-align: center; } /* الإجراءات */

.marketers-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
    font-size: 0.95em;
}

.marketers-table td {
    color: #333;
}

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

.marketers-table a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.marketers-table a:hover {
    text-decoration: underline;
}

.status-badge.status-active {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    display: inline-block;
}

.status-badge.status-inactive {
    background: #fff3e0;
    color: #e65100;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    display: inline-block;
}

.status-badge.status-suspended {
    background: #ffebee;
    color: #c62828;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    display: inline-block;
}

@media (max-width: 768px) {
    .modal.fullscreen-modal {
        padding: 10px;
        align-items: flex-start;
    }
    
    .modal.fullscreen-modal .modal-content.large-modal {
        width: 95%;
        max-height: 95vh;
        margin-top: 10px;
    }
    
    .modal-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 15px;
    }
    
    .search-box,
    .filter-box {
        width: 100%;
        min-width: auto;
    }
    
    .modal-body-scroll {
        padding: 15px;
        max-height: calc(98vh - 300px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-body-scroll table,
    .marketers-table {
        font-size: 0.85em;
        table-layout: auto;
    }
    
    .modal-body-scroll table th,
    .modal-body-scroll table td,
    .marketers-table th,
    .marketers-table td {
        padding: 8px 4px;
        font-size: 0.9em;
    }
    
    /* Hide less important columns on mobile */
    .marketers-table th:nth-child(3),
    .marketers-table td:nth-child(3) { display: none; } /* Hide phone */
    
    .marketers-table th:nth-child(4),
    .marketers-table td:nth-child(4) { display: none; } /* Hide leads count */
    
    .marketers-table .btn-sm {
        padding: 4px 8px;
        font-size: 0.8em;
    }
}

/* ============================================
   Loading States
   ============================================ */

.loading {
    text-align: center;
    padding: 40px;
}

.loading .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading p {
    color: #666;
    font-size: 1em;
    margin: 0;
}

/* Table loading states */
table tbody .loading {
    padding: 50px 20px;
}

table tbody .loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.global-loader.hidden {
    display: none;
}

.loader-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loader-text {
    font-size: 1.2em;
    color: #666;
    font-weight: bold;
}

/* ============================================
   Alerts
   ============================================ */

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    left: auto;
    max-width: 500px;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    word-wrap: break-word;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert.active {
    display: block;
    animation: slideInDown 0.3s ease-out;
}

/* For pages with side menu, adjust alert position */
body.has-side-menu .alert {
    right: calc(280px + 20px);
}

body.has-side-menu .side-menu.collapsed ~ * .alert,
body:has(.side-menu.collapsed) .alert {
    right: calc(70px + 20px);
}

@media (max-width: 992px) {
    body.has-side-menu .alert {
        right: 20px;
    }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================
   Pagination
   ============================================ */

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 12px;
    width: 100%;
    flex-wrap: wrap;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.pagination-btn {
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.85em;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

.pagination-info {
    padding: 6px 12px;
    color: #666;
    font-size: 0.85em;
}

/* ============================================
   Utilities
   ============================================ */

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ============================================
   Admin-specific Styles
   ============================================ */

.date-filter-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.date-filter label {
    font-weight: bold;
    color: #333;
}

.date-filter input[type="date"] {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1em;
    transition: all 0.3s;
}

.date-filter input[type="date"]:focus {
    border-color: var(--primary);
    outline: none;
}

.secondary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 10px;
}

/* Horizontal Cards Layout */
.horizontal-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px 30px !important;
    border-radius: 12px !important;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1) !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.horizontal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15) !important;
}

.horizontal-card > div:first-child {
    flex: 1;
    text-align: right;
}

.horizontal-card > div:last-child {
    font-size: 3em;
    font-weight: bold;
    margin-left: 30px;
}

#mainStatsContainer .summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 30px;
    min-width: 280px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

#mainStatsContainer .summary-item > div:first-child {
    text-align: center;
}

#mainStatsContainer .summary-item > div:last-child {
    text-align: center;
}

.mini-stat {
    background: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.mini-stat .label {
    font-size: 0.8em;
    color: #888;
}

.mini-stat .value {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-top: 5px;
}

.mini-stat .sub-value {
    font-size: 0.75em;
    color: #999;
}

.performance-zone-legend {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.zone-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
}

.zone-badge.zone-green {
    background: #4caf50;
    color: #fff;
}

.zone-badge.zone-yellow {
    background: #ffc107;
    color: #000;
}

.zone-badge.zone-red {
    background: #f44336;
    color: #fff;
}

.zone-badge.zone-black {
    background: #424242;
    color: #fff;
}

.zone-badge.zone-norank {
    background: #9e9e9e;
    color: #fff;
}

.performance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.performance-table th,
.performance-table td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.performance-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
}

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

.performance-table .zone-cell {
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.85em;
}

.performance-table .zone-cell.green {
    background: #4CAF50;
    color: white;
}

.performance-table .zone-cell.yellow {
    background: #FFC107;
    color: #333;
}

.performance-table .zone-cell.red {
    background: #f44336;
    color: white;
}

.performance-table .zone-cell.black {
    background: #333;
    color: white;
}

.performance-table .zone-cell.norank {
    background: #9e9e9e;
    color: white;
}

.stat-card.zone-green {
    border-right-color: #4CAF50;
}

.stat-card.zone-yellow {
    border-right-color: #FFC107;
}

.stat-card.zone-red {
    border-right-color: #f44336;
}

.stat-card.zone-black {
    border-right-color: #333;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin-top: 20px;
}

/* Top Marketers List */
.top-marketers {
    list-style: none;
}

.top-marketers li {
    padding: 20px;
    background: #f8f9fa;
    margin-bottom: 15px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s;
}

.top-marketers li:hover {
    transform: translateX(-5px);
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.marketer-info {
    flex: 1;
}

.marketer-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.marketer-code-display {
    color: var(--primary);
    font-size: 0.9em;
    margin-bottom: 5px;
    font-family: monospace;
}

.marketer-stats {
    color: #666;
    font-size: 0.9em;
}

.marketer-revenue {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--success);
    text-align: left;
    min-width: 120px;
}

/* Compact Top Lists (Marketers & Sales) */
.top-list {
    list-style: none;
    padding: 0;
    margin: 0;
    min-height: 300px;
}

.top-list li {
    padding: 12px 15px;
    background: #f8f9fa;
    margin-bottom: 8px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.top-list li:hover {
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transform: translateX(-3px);
}

.list-item-info {
    flex: 1;
}

.list-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
    font-size: 0.95em;
}

.list-item-meta {
    color: #888;
    font-size: 0.8em;
}

.list-item-value {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--primary);
    margin-right: 10px;
}

/* Enhanced Top Lists Styles */
.top-list-enhanced {
    min-height: auto;
}

.top-list-item-enhanced {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.top-list-item-enhanced:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
    border-color: var(--primary);
}

.list-item-rank {
    font-size: 1.5em;
    min-width: 40px;
    text-align: center;
}

.list-item-rank .rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #e9ecef;
    border-radius: 50%;
    font-size: 0.8em;
    font-weight: 600;
    color: #666;
}

.top-list-item-enhanced .list-item-info {
    flex: 1;
}

.top-list-item-enhanced .list-item-name {
    font-weight: 700;
    font-size: 1em;
    color: #333;
    margin-bottom: 2px;
}

.top-list-item-enhanced .list-item-meta {
    font-size: 0.75em;
    color: #888;
    margin-bottom: 6px;
}

.list-item-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-stat {
    font-size: 0.7em;
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 4px;
    color: #666;
    white-space: nowrap;
}

.list-item-score {
    text-align: center;
    padding: 8px 12px;
    border-radius: 10px;
    min-width: 60px;
}

.list-item-score .score-value {
    font-size: 1.3em;
    font-weight: 800;
}

.list-item-score .score-label {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.score-excellent {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
}

.score-good {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.score-average {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #ef6c00;
}

.score-low {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #757575;
}

/* Sales Table Enhanced Styles */
.sales-info {
    display: flex;
    flex-direction: column;
}

.sales-info strong {
    font-size: 0.95em;
    color: #333;
}

.sales-info small {
    font-size: 0.75em;
    color: #888;
}

.metric-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85em;
}

.metric-total {
    background: #e3f2fd;
    color: #1565c0;
}

/* Status filter panels for leads/sales tables */

/* Status filter panels inside leads/sales tables (match wallet filter feel) */
.status-filter-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f3e5f5 0%, #e8eaf6 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e4d3f7;
}

.status-filter-label {
    font-weight: 700;
    font-size: 0.9em;
    color: #6b21a8;
    margin: 0;
}

.status-filter-panel select {
    min-width: 200px;
    padding: 10px 12px;
    border: 2px solid #d8b4fe;
    border-radius: 10px;
    font-size: 0.95em;
    background: white;
    text-align: right;
    direction: rtl;
}

.leads-status-filter,
.sales-status-filter {
    color: #6b21a8;
}

@media (max-width: 768px) {
    .status-filter-panel {
        align-items: stretch;
    }

    .status-filter-panel select,
    .status-filter-panel .btn {
        width: 100%;
    }
}

.metric-delivered {
    background: #e8f5e9;
    color: #2e7d32;
}

.metric-confirmed {
    background: #f3e5f5;
    color: #7b1fa2;
}

.metric-cancelled {
    background: #ffebee;
    color: #c62828;
}

.metric-default {
    background: #f5f5f5;
    color: #616161;
}

.rate-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85em;
}

.rate-excellent {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
}

.rate-good {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.rate-average {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #ef6c00;
}

.rate-low {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
}

/* Marketer Info in Table */
.marketer-info {
    display: flex;
    flex-direction: column;
}

.marketer-info strong {
    font-size: 0.95em;
    color: #333;
}

.marketer-info small {
    font-size: 0.75em;
    color: #888;
}

/* Cost Value Styling */
.cost-value {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

/* Score Badge */
.score-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85em;
}

.score-badge.score-excellent {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
}

.score-badge.score-good {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.score-badge.score-average {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #ef6c00;
}

.score-badge.score-low {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #757575;
}

/* Marketer Detail Card */
.marketer-detail-card {
    padding: 10px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.detail-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.detail-item label {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.detail-item span {
    font-weight: bold;
    color: #333;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-box {
    background: linear-gradient(135deg, var(--primary), #764ba2);
    color: white;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

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

.stat-box .stat-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
    display: block;
}

.stat-box .stat-label {
    font-size: 0.75em;
    opacity: 0.9;
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-box .stat-value {
    font-size: 1.5em;
    font-weight: bold;
    margin: 5px 0;
    display: block;
}

.stat-box .stat-number {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 5px;
}

.stat-box .stat-sub {
    font-size: 0.8em;
    opacity: 0.85;
    margin-top: 5px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
}

.detail-actions {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Marketers Table */
.marketers-table {
    width: 100%;
    border-collapse: collapse;
}

.marketers-table th,
.marketers-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.marketers-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

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

.marketers-table .btn-sm {
    padding: 5px 10px;
    font-size: 0.85em;
    margin-left: 5px;
}

/* Status badges for marketers */
.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-inactive {
    background: #fff3e0;
    color: #e65100;
}

.status-suspended {
    background: #ffebee;
    color: #c62828;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.quick-action {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    border: 2px solid transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.quick-action:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.quick-action-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
}

.quick-action-text {
    font-weight: bold;
    color: #333;
}

/* Section Header Row */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header-row h2 {
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
    opacity: 0.5;
}

.welcome-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
}

.welcome-card h1 {
    color: #333;
    font-size: 1.6em;
    margin-bottom: 10px;
}

.welcome-card p {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 15px;
}

/* ============================================
   Page-Specific Body Styles
   ============================================ */

/* Body styles for pages without side menu (index, login, campaign, thanks) */
body.page-fullscreen {
    display: block !important;
    padding: 10px;
}

body.page-login {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body.page-campaign {
    display: block !important;
    background: #fff;
    padding: 0 !important;
    margin: 0 !important;
}

body.page-campaign .container {
    padding: 0 20px;
}

/* ============================================
   Index Page Styles
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero section - full width image with overlay text */
#heroSection.hero,
.hero {
    position: relative !important;
    min-height: 500px !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Override background gradient when image is present */
#heroSection.hero:has(.hero-image-container[style*="block"]),
#heroSection.hero:has(#heroImageContainer[style*="block"]) {
    background: transparent !important;
}

/* Force hero image container to be visible when display is block */
#heroImageContainer[style*="display: block"],
.hero-image-container[style*="display: block"] {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important;
}

/* Hero image container - full width background */
#heroImageContainer.hero-image-container,
.hero .hero-image-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 500px !important;
    z-index: 0 !important;
}

#heroImage.hero-image,
.hero .hero-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    min-width: 100% !important;
}

/* Hero content container - overlay on image */
#heroSection .hero .container,
.hero .container {
    position: relative !important;
    z-index: 2 !important;
    padding: 40px !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    text-align: right !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    background: transparent !important;
}

/* When no image, center the content */
.hero:not(:has(.hero-image-container[style*="block"])) .container {
    text-align: center !important;
    align-items: center !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero {
        min-height: 400px;
    }
    
    .hero-image-container {
        min-height: 400px !important;
    }
    
    .hero .container {
        padding: 30px 20px !important;
    }
}

.logo {
    font-size: 2.5em;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hero h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.2em;
    margin-bottom: 20px;
    opacity: 0.95;
    line-height: 1.6;
    color: white;
}

/* Hero Content Section (Below Image) */
.hero-content-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 15px;
    text-align: center;
    color: white;
}

.hero-content-section h1 {
    font-size: 1.8em;
    margin-bottom: 12px;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.hero-content-section .hero-subtitle {
    font-size: 1.1em;
    margin-bottom: 18px;
    opacity: 0.95;
}

.hero-features {
    list-style: none;
    padding: 0;
    margin: 15px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hero-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.hero-features li::before {
    content: '✅';
    font-size: 1em;
}

.subtitle {
    font-size: 1.1em;
    margin-bottom: 20px;
    opacity: 0.95;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.feature-card {
    background: white;
    padding: 18px 12px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    transition: all 0.3s;
    text-align: center;
    border: 1px solid #e8e8e8;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 2em;
    margin-bottom: 10px;
    display: block;
}

.feature-title {
    color: #333;
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-desc {
    color: #666;
    line-height: 1.5;
    font-size: 0.9em;
}

.stats-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px 20px;
    border-radius: 20px;
    margin: 25px 0;
    backdrop-filter: blur(10px);
}

.stats-grid-index {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    text-align: center;
}

.stat-item {
    color: white;
}

.stat-number {
    font-size: 2.2em;
    font-weight: 800;
    margin-bottom: 5px;
    display: block;
}

.stat-label {
    font-size: 1em;
    opacity: 0.9;
}

.login-section {
    text-align: center;
    margin: 30px 0;
}

.login-btn {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 15px 45px;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
    background: #f0f0f0;
}

.login-btn:active {
    transform: translateY(-1px);
}

.info-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px 20px;
    border-radius: 20px;
    margin: 25px 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.info-section h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 18px;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.info-item {
    padding: 10px 8px;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 3px solid #667eea;
}

.info-item h3 {
    color: #667eea;
    font-size: 0.95em;
    margin-bottom: 5px;
}

.info-item p {
    color: #666;
    line-height: 1.4;
    font-size: 0.75em;
}

.footer {
    background: white;
    text-align: center;
    color: #333;
    padding: 40px 20px;
    font-size: 0.95em;
    border-top: 1px solid #e0e0e0;
}

@media (max-width: 1400px) {
    .info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .logo {
        font-size: 2.5em;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .feature-card {
        padding: 10px 8px;
    }
    
    .feature-icon {
        font-size: 1.3em;
    }
    
    .feature-title {
        font-size: 0.9em;
    }
    
    .feature-desc {
        font-size: 0.75em;
    }
    
    .login-btn {
        padding: 12px 35px;
        font-size: 1.1em;
    }
    
    .info-section h2 {
        font-size: 1.5em;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .info-item {
        padding: 8px 6px;
    }
    
    .info-item h3 {
        font-size: 0.85em;
    }
    
    .info-item p {
        font-size: 0.7em;
    }
    
    .stat-number {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Login Page Styles
   ============================================ */

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
    max-width: 450px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #333;
    font-size: 2em;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 0.95em;
}

.role-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: #f5f5f5;
    padding: 5px;
    border-radius: 10px;
}

.role-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-weight: 500;
    transition: all 0.3s;
    color: #666;
}

.role-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.marketer-code-group {
    display: none;
}

.marketer-code-group.active {
    display: block;
}

@media (max-width: 768px) {
    .login-container {
        padding: 30px 20px;
        margin: 10px;
    }

    .login-header h1 {
        font-size: 1.8em;
    }

    .login-header p {
        font-size: 0.9em;
    }

    .role-selector {
        flex-direction: column;
        gap: 8px;
    }

    .role-btn {
        padding: 10px;
        font-size: 0.95em;
    }

    .form-group input {
        padding: 10px 12px;
        font-size: 16px;
        min-height: 44px;
    }

    .btn-login {
        padding: 12px;
        font-size: 1em;
        min-height: 44px;
    }
}

/* ============================================
   Campaign Page Styles
   ============================================ */

:root {
    --campaign-primary: #F68E1D;
    --campaign-primary-dark: #e07d0c;
    --campaign-secondary: #F54F22;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--campaign-primary), var(--campaign-secondary));
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    font-size: 1.2em;
    margin-top: 20px;
}

.countdown {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 1em;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.hero-image-container {
    width: 100%;
    height: 50vh;
    max-height: 450px;
    min-height: 350px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    max-width: 100%;
    max-height: 100%;
    min-width: 100%;
}

.product-image-section {
    background: white;
    padding: 25px 0;
}

.product-image-wrapper {
    max-width: 480px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    background: #f8f9fa;
}

.product-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.product-image:hover {
    transform: scale(1.05);
}

.gallery-section {
    background: #f8f9fa;
    padding: 30px 0;
}

.gallery-title {
    text-align: center;
    font-size: 1.5em;
    color: #333;
    margin-bottom: 25px;
    font-weight: 700;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.features {
    background: white;
    padding: 50px 0;
}

.features h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 40px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.feature-card-campaign {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.feature-card-campaign:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.feature-icon-campaign {
    font-size: 3.5em;
    margin-bottom: 20px;
}

.feature-title-campaign {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 12px;
    font-weight: 700;
}

.feature-desc-campaign {
    color: #666;
    line-height: 1.7;
}

.price-section {
    background: white;
    padding: 30px 0;
    text-align: center;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 1.2em;
}

.new-price {
    font-size: 2.5em;
    font-weight: 700;
    margin: 12px 0;
}

.discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--success), #45a049);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
}

.form-section {
    padding: 30px 0;
}

.form-container {
    background: linear-gradient(135deg, #667eea, #764ba2);
    max-width: 480px;
    margin: 0 auto;
    padding: 35px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.form-title {
    color: white;
    text-align: center;
    font-size: 1.6em;
    margin-bottom: 30px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

#orderForm .input-group .form-control,
.form-section .input-group .form-control,
.input-group .form-control {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 1.1em;
    font-family: 'Tajawal', sans-serif;
    background: white;
    color: #333 !important;
    transition: all 0.3s;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#orderForm .input-group .form-control::placeholder,
.form-section .input-group .form-control::placeholder {
    color: #999 !important;
}

#orderForm .input-group .form-control:focus,
.form-section .input-group .form-control:focus {
    background: white;
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

#orderForm .input-group .form-control[value],
#orderForm .input-group .form-control:not(:placeholder-shown),
#orderForm .input-group input[type="text"],
#orderForm .input-group input[type="tel"],
.form-section .input-group .form-control[value],
.form-section .input-group .form-control:not(:placeholder-shown),
.form-section .input-group input[type="text"],
.form-section .input-group input[type="tel"] {
    color: #1a1a1a !important;
    font-weight: 500 !important;
}

/* Specific styling for phone number input */
#phone,
input[type="tel"]#phone,
.form-control#phone {
    color: #1a1a1a !important;
    font-weight: 500 !important;
    direction: ltr;
    text-align: left;
    -webkit-text-fill-color: #1a1a1a !important;
}

/* Phone placeholder should be RTL and grey */
#phone::placeholder,
input[type="tel"]#phone::placeholder,
.form-control#phone::placeholder,
#orderForm #phone::placeholder,
.form-section #phone::placeholder,
.input-group #phone::placeholder {
    direction: rtl !important;
    text-align: right !important;
    color: #999 !important;
    -webkit-text-fill-color: #999 !important;
}

/* Override any conflicting rules - ensure form inputs are clearly visible */
#orderForm input,
.form-section input,
.form-container input {
    color: #333 !important;
    background: white !important;
}

#orderForm input::placeholder,
.form-section input::placeholder {
    color: #999 !important;
}

.input-group .form-control::placeholder {
    color: #999 !important;
}

.input-group .form-control:-webkit-autofill,
.input-group .form-control:-webkit-autofill:hover,
.input-group .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: white !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.1) inset !important;
    box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.1) inset !important;
}

.input-group .form-control:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    color: white !important;
}

.input-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4em;
    pointer-events: none;
    z-index: 1;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.3em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(238, 90, 111, 0.3);
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 90, 111, 0.4);
    background: linear-gradient(135deg, #ee5a6f, #ff6b6b);
}

.submit-btn:active {
    transform: translateY(0);
}
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
    font-family: 'Tajawal', sans-serif;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.5);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.error-message {
    background: #ff4444;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.error-message.active {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.form-loading {
    display: none;
    text-align: center;
    padding: 20px;
    background: rgba(102, 126, 234, 0.95);
    border-radius: 12px;
    margin: 15px 0;
    color: white;
    font-weight: bold;
}

.form-loading.active {
    display: block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 15px;
}

.footer-item span:not(.footer-icon) {
    color: #666;
    font-size: 1em;
    font-weight: 500;
}

.footer-icon {
    font-size: 2.5em;
    margin-bottom: 8px;
}

.error-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-align: center;
    padding: 20px;
}

.error-page h1 {
    font-size: 3em;
    margin-bottom: 20px;
}

.error-page p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.error-page a {
    background: white;
    color: var(--primary);
    padding: 15px 40px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1em;
    transition: transform 0.3s;
    text-decoration: none;
}

.error-page a:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .hero-image-container {
        height: 300px;
        max-height: 300px;
    }
    
    .form-container {
        padding: 30px 20px;
    }

    .new-price {
        font-size: 2.5em;
    }
}

@media (max-width: 480px) {
    .hero-image-container {
        height: 250px;
        max-height: 250px;
    }
}

/* ============================================
   Mobile Menu Toggle (for pages with side menu)
   ============================================ */

.mobile-menu-toggle {
    display: none;
    position: fixed;
    right: 15px;
    top: 15px;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    line-height: 1;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    align-items: center;
    justify-content: center;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-menu-overlay.active {
    display: block;
}

@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    body.has-side-menu {
        display: block !important;
    }
    
    .side-menu {
        width: 280px !important;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -5px 0 20px rgba(0,0,0,0.3);
        z-index: 10000;
    }

    .side-menu.open,
    .side-menu.mobile-open {
        transform: translateX(0);
    }
    
    /* Show text on mobile */
    .side-menu .side-menu-item-text,
    .side-menu .side-menu-header h2,
    .side-menu .side-menu-header p {
        display: block !important;
    }

    .side-menu.collapsed {
        width: 280px !important;
    }
    
    .side-menu.collapsed .side-menu-item-text,
    .side-menu.collapsed .side-menu-header h2,
    .side-menu.collapsed .side-menu-header p {
        display: block !important;
    }
    
    .side-menu .side-menu-item {
        justify-content: flex-start !important;
        padding: 16px 25px !important;
        gap: 15px !important;
    }

    .dashboard {
        margin-right: 0 !important;
        margin-left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 10px;
        padding-top: 70px;
        flex: none;
        box-sizing: border-box;
        background: #f5f6fa;
    }

    body,
    body.has-side-menu,
    body:has(.side-menu) {
        display: block !important;
        background: #f5f6fa !important;
    }

    .header,
    .date-filter-section,
    .section,
    .stats-grid {
        width: 100%;
        box-sizing: border-box;
    }

    .menu-toggle {
        display: none;
    }
}

/* ============================================
   Table Responsive Wrapper
   ============================================ */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 600px;
}

/* ============================================
   Tabs Component
   ============================================ */

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-weight: 500;
    transition: all 0.3s;
    color: #666;
    font-size: 0.95em;
}

.tab-btn:hover {
    background: #f8f9fa;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-weight: bold;
}

/* ============================================
   Toolbar Component
   ============================================ */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.toolbar h2 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

/* ============================================
   Content Section
   ============================================ */

.content-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .tabs {
        flex-direction: row;
        gap: 5px;
        padding: 5px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 0.85em;
        flex: 0 0 auto;
        min-width: 120px;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        padding: 15px;
    }
    
    .toolbar h2 {
        font-size: 1.2em;
    }
    
    .content-section {
        padding: 15px;
        overflow-x: auto;
    }
    
    .content-section table {
        font-size: 0.85em;
        min-width: 100%;
    }
    
    .content-section table th,
    .content-section table td {
        padding: 8px 5px;
        white-space: nowrap;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 0.8em;
    }
}
    
    .toolbar h2 {
        font-size: 1.2em;
        text-align: center;
    }
}

/* ============================================
   Marketer Code Display
   ============================================ */

.marketer-code {
    color: var(--primary);
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 10px;
    padding: 8px 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    display: inline-block;
    font-family: monospace;
}

/* ============================================
   Campaign Grid and Cards
   ============================================ */

.campaign-grid {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
}

.campaign-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    flex-shrink: 0;
    width: 350px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.campaign-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.campaign-card.clickable {
    cursor: pointer;
}

.campaign-card.clickable * {
    pointer-events: none;
}

.campaign-header {
    padding: 15px;
    color: white;
    position: relative;
}

.campaign-header h3 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: bold;
}

.product-name {
    font-size: 0.85em;
    opacity: 0.9;
    margin-bottom: 8px;
}

.campaign-status {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.campaign-stats {
    display: flex;
    justify-content: space-around;
    padding: 12px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.campaign-stat {
    text-align: center;
    flex: 1;
}

.campaign-stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

.campaign-stat-label {
    font-size: 0.75em;
    color: #666;
}

.campaign-card-footer {
    padding: 10px 15px;
    text-align: center;
    background: white;
    border-top: 1px solid #f0f0f0;
}

.view-details {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.85em;
}

.create-campaign-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    color: white;
}

.create-campaign-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.create-campaign-card .icon {
    font-size: 2.5em;
    margin-bottom: 8px;
}

.create-campaign-card .text {
    font-size: 1em;
    font-weight: bold;
}

.campaign-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.campaign-empty-state .empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.campaign-empty-state h3 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.campaign-empty-state p {
    color: #666;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .campaign-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 100%;
        overflow-x: visible;
        padding: 0 10px;
    }
    
    .campaign-card {
        max-width: 100%;
        width: 100% !important;
        min-width: 0;
        flex-shrink: unset;
    }
    
    .create-campaign-card {
        width: 100%;
        min-width: 0;
        margin: 0 -10px;
        padding: 0 10px;
    }
    
    .campaign-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .campaign-stat {
        padding: 10px;
        background: white;
        border-radius: 8px;
    }
}

/* ============================================
   Profile Page Styles
   ============================================ */

.profile-section {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.profile-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    margin: 0 auto 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.profile-header h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 8px;
    font-weight: bold;
}

.profile-header p {
    color: #666;
    font-size: 1em;
    margin: 0;
}

.profile-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.profile-info .info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 20px;
    background: white;
    border-radius: 15px;
    border: 3px solid #667eea;
    transition: all 0.3s;
    text-align: center;
    min-height: 120px;
}

.profile-info .info-item:hover {
    background: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.profile-info .info-item label {
    color: #999;
    font-weight: 500;
    font-size: 0.9em;
    margin: 0 0 10px 0;
    display: block;
}

.profile-info .info-item .value {
    color: #333;
    font-size: 1.1em;
    font-weight: bold;
    margin: 0;
    word-break: break-word;
}

@media (max-width: 768px) {
    .profile-section {
        padding: 25px 20px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2em;
    }
    
    .profile-header h2 {
        font-size: 1.5em;
    }
    
    .profile-info {
        grid-template-columns: 1fr;
    }
    
    .profile-info .info-item {
        padding: 20px 15px;
        min-height: 100px;
    }
}

/* ============================================
   Campaign Details Page Styles
   ============================================ */

.page-header {
    background: white;
    padding: 18px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.campaign-title {
    color: #333;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
}

.campaign-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.campaign-product {
    color: #666;
    font-size: 1.1em;
}

.campaign-status-badge {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    background: #e8f5e9;
    color: #2e7d32;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.section-title {
    color: #333;
    font-size: 1.1em;
    font-weight: bold;
    margin: 0;
}

.section-body {
    padding-top: 10px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.detail-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 3px solid var(--primary);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    color: #666;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 8px;
}

.detail-value {
    color: #333;
    font-size: 1em;
}

.detail-value.price {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-value .sale {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2em;
}

.detail-value .original {
    color: #999;
    text-decoration: line-through;
    font-size: 1em;
}

.color-preview {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: inline-block;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.link-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 3px solid var(--primary);
}

.link-label {
    color: #333;
    font-weight: bold;
    font-size: 0.95em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-row {
    display: flex;
    flex-direction: row-reverse;
    gap: 8px;
    align-items: stretch;
}

.link-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9em;
    font-family: 'Tajawal', monospace;
    background: white;
    direction: ltr;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.link-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-copy {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Tajawal', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.share-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Tajawal', sans-serif;
}

.share-btn.share-whatsapp {
    background: #25D366;
    color: white;
}

.share-btn.share-whatsapp:hover {
    background: #20BA5A;
    transform: translateY(-2px);
}

.share-btn.share-facebook {
    background: #1877F2;
    color: white;
}

.share-btn.share-facebook:hover {
    background: #166FE5;
    transform: translateY(-2px);
}

.share-btn.share-telegram {
    background: #0088cc;
    color: white;
}

.share-btn.share-telegram:hover {
    background: #0077B5;
    transform: translateY(-2px);
}

/* Stat card styles for campaign details - matching admin card sizes exactly */
.main-content .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 15px !important;
}

@media (min-width: 768px) {
    .main-content .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 992px) {
    .main-content .stats-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

.main-content .stats-grid .stat-card,
.stats-grid .stat-card {
    padding: 12px !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    text-align: center !important;
    background: white !important;
}

.main-content .stats-grid .stat-icon,
.stats-grid .stat-icon {
    font-size: 1.2em !important;
    margin-bottom: 5px !important;
    display: block !important;
}

.main-content .stats-grid .stat-value,
.stats-grid .stat-value {
    font-size: 1.6em !important;
    margin-bottom: 4px !important;
    line-height: 1.2 !important;
    font-weight: bold !important;
}

.main-content .stats-grid .stat-label,
.stats-grid .stat-label {
    font-size: 0.75em !important;
    color: #666 !important;
    margin-top: 0 !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

@media (max-width: 768px) {
    .page-header {
        padding: 20px;
    }
    
    .campaign-title {
        font-size: 1.6em;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .share-row {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
    }
}

/* ============================================
   Professional Campaign Details Display
   ============================================ */

.campaign-details-professional {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.details-section {
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

.section-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.details-section .details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.details-section .detail-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    transition: all 0.2s;
}

.details-section .detail-item:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.details-section .detail-label {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.details-section .detail-value {
    font-size: 0.95em;
    color: #333;
    font-weight: 500;
    word-wrap: break-word;
}

.details-section .detail-item.full-width {
    grid-column: 1 / -1;
}

/* Product Description Box */
.product-description-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-right: 4px solid var(--primary, #667eea);
    line-height: 1.7;
}

.product-description-box p {
    margin: 6px 0;
    color: #444;
    font-size: 0.9em;
}

.product-description-box p:first-child {
    margin-top: 0;
}

.product-description-box p:last-child {
    margin-bottom: 0;
}

/* Images Container */
.images-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.image-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
}

.image-item.full-width {
    width: 100%;
}

.image-label {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.image-wrapper {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.image-wrapper .detail-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
    aspect-ratio: 1;
    background: #f0f0f0;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary, #667eea);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Form Image Preview Elements */
.image-preview {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 6px;
}

.gallery-preview {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.gallery-preview-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.text-muted {
    color: #666;
}

.text-sm {
    font-size: 0.85em;
    display: block;
    margin-top: 5px;
}

/* Features Professional Display */
.features-grid-professional {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.feature-card-professional {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 24px;
    border-radius: 12px;
    border: 2px solid #e8e8e8;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.feature-card-professional:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--primary, #667eea);
}

.feature-icon-large {
    font-size: 2.5em;
    margin-bottom: 12px;
    display: block;
}

.feature-title-large {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.feature-desc-large {
    font-size: 0.95em;
    color: #666;
    line-height: 1.6;
}

/* Single card for all features */
.features-single-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 24px;
    border-radius: 12px;
    border: 2px solid #e8e8e8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.feature-item-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e8e8e8;
}

.feature-item-inline:last-child {
    border-bottom: none;
}

.feature-icon-inline {
    font-size: 1.8em;
    min-width: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-title-inline {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.feature-desc-inline {
    font-size: 0.95em;
    color: #666;
    margin-right: auto;
    text-align: right;
}

/* Color Preview Large */
.color-preview-large {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1em;
}

.color-dot-large {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

/* Price Highlight */
.price-highlight {
    font-size: 1.3em;
}

.sale-price {
    color: var(--primary, #667eea);
    font-weight: bold;
    font-size: 1.2em;
}

.discount-percentage {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.2em;
}

/* Responsive adjustments for professional details */
@media (max-width: 768px) {
    .campaign-details-professional {
        gap: 20px;
    }
    
    .details-section {
        padding: 16px;
    }
    
    .details-section .details-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid-professional {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .features-single-card {
        padding: 16px;
    }
    
    .feature-item-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 0;
    }
    
    .feature-icon-inline {
        min-width: auto;
    }
    
    .feature-title-inline {
        width: 100%;
    }
    
    .feature-desc-inline {
        width: 100%;
        margin-right: 0;
        text-align: right;
    }
}

/* ============================================
   Enhanced Campaign Page Styles
   ============================================ */

/* Professional Gradient Backgrounds */
body.page-campaign {
    background: #f5f7fa;
}

/* Enhanced Hero Section */
.hero {
    background: linear-gradient(135deg, var(--campaign-primary, #F68E1D) 0%, var(--campaign-secondary, #F54F22) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 60%;
    height: 200%;
    background: rgba(255, 255, 255, 0.05);
    transform: rotate(-15deg);
    pointer-events: none;
}

.hero h1 {
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-features {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

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

/* Enhanced Features Section */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--campaign-primary, #F68E1D), var(--campaign-secondary, #F54F22));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
}

.feature-desc {
    font-size: 1em;
    color: #7f8c8d;
    line-height: 1.7;
}

/* Enhanced Price Section */
.price-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.price-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 60%;
    height: 200%;
    background: rgba(255, 255, 255, 0.05);
    transform: rotate(15deg);
}

.price-section .container {
    position: relative;
    z-index: 1;
}

.old-price {
    font-size: 1.8em;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: line-through;
    margin-bottom: 10px;
}

.new-price {
    font-size: 3.5em;
    color: white;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.discount-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1.3em;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Enhanced Form Section */
.form-section {
    background: #fff;
    padding: 60px 20px;
}

.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--campaign-primary, #F68E1D);
}

.form-title {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.form-control {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.1em;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--campaign-primary, #F68E1D);
    box-shadow: 0 0 0 4px rgba(246, 142, 29, 0.1);
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    color: #bbb;
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-control:focus + .input-icon {
    color: var(--campaign-primary, #F68E1D);
    transform: translateY(-50%) scale(1.1);
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--campaign-primary, #F68E1D) 0%, var(--campaign-secondary, #F54F22) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.4em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
    box-shadow: 0 6px 20px rgba(246, 142, 29, 0.3);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(246, 142, 29, 0.4);
}

.submit-btn:active {
    transform: translateY(-1px);
}

/* Enhanced Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.footer-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.footer-icon {
    font-size: 2.5em;
}

/* Mobile Responsiveness for Campaign Page */
@media (max-width: 768px) {
    .countdown {
        font-size: 1em;
        padding: 12px;
    }
    
    .hero h1 {
        font-size: 2em;
    }
    
    .hero-subtitle {
        font-size: 1.1em;
    }
    
    .hero-features {
        font-size: 0.95em;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 25px 20px;
    }
    
    .old-price {
        font-size: 1.4em;
    }
    
    .new-price {
        font-size: 2.5em;
    }
    
    .discount-badge {
        font-size: 1.1em;
        padding: 10px 25px;
    }
    
    .form-container {
        padding: 30px 20px;
    }
    
    .form-title {
        font-size: 1.6em;
    }
    
    .form-control {
        padding: 14px 45px 14px 18px;
        font-size: 1em;
    }
    
    .submit-btn {
        font-size: 1.2em;
        padding: 16px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .footer-item {
        padding: 15px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-image-section {
        padding: 30px 0;
    }
    
    .gallery-section {
        padding: 35px 0;
    }
    
    .features {
        padding: 35px 0;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.6em;
    }
    
    .new-price {
        font-size: 2em;
    }
    
    .form-control {
        font-size: 0.95em;
    }
    
    .submit-btn {
        font-size: 1.1em;
    }
}

/* Mobile styles for money operations */
@media (max-width: 768px) {
    .money-operations-row {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .money-operations-row .section {
        margin-bottom: 0;
    }
    
    .money-operations-row .form {
        width: 100% !important;
    }
    
    .money-operations-row .form-group {
        margin-bottom: 15px;
    }
    
    .money-operations-row .form-group label {
        margin-bottom: 8px;
        font-size: 0.95em;
    }
    
    .money-operations-row .form-control,
    .money-operations-row .form-group input,
    .money-operations-row .form-group textarea,
    .money-operations-row .form-group select {
        font-size: 1em;
        padding: 12px 15px;
        width: 100% !important;
    }
}

/* Mobile styles for wallet date filters */
@media (max-width: 768px) {
    .filter-panel {
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
    }
    
    .filter-panel label {
        font-size: 0.9em !important;
        margin-bottom: 5px;
        width: 100%;
        text-align: center;
    }
    
    .filter-panel input[type="date"] {
        width: 160px !important;
        font-size: 0.9em !important;
    }
    
    .filter-panel span {
        font-size: 0.9em !important;
    }
}

/* ============================================
   Marketer Quick Info Cards
   ============================================ */

.quick-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.info-card .info-icon {
    font-size: 2em;
    text-align: center;
    margin-bottom: 10px;
}

.info-card h3 {
    color: #333;
    font-size: 1em;
    margin-bottom: 12px;
    text-align: center;
    font-weight: bold;
}

.info-card .info-content {
    font-size: 0.85em;
}

.info-admin {
    border-top: 3px solid #667eea;
}

.info-wallet {
    border-top: 3px solid #4CAF50;
}

.info-performance {
    border-top: 3px solid #ff9800;
}

.info-tips {
    border-top: 3px solid #2196F3;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.info-value {
    color: #333;
    font-weight: 600;
    text-align: left;
}

.info-value a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.info-value a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.wallet-balance {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 10px;
    color: white;
    margin-bottom: 10px;
}

.balance-label {
    display: block;
    font-size: 0.85em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.balance-amount {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
}

.perf-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.perf-stat:last-child {
    margin-bottom: 0;
}

.perf-label {
    color: #666;
    font-size: 0.9em;
}

.perf-value {
    color: #333;
    font-size: 1.2em;
    font-weight: bold;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    padding: 8px 0;
    padding-right: 20px;
    position: relative;
    color: #555;
    line-height: 1.5;
}

.tips-list li:before {
    content: '✓';
    position: absolute;
    right: 0;
    color: #4CAF50;
    font-weight: bold;
}

@media (max-width: 768px) {
    .quick-info-grid {
        grid-template-columns: 1fr;
    }
    
    .info-card .info-icon {
        font-size: 1.8em;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-value {
        text-align: right;
    }
}

/* ============================================
   Thank You Page Styles
   ============================================ */
.thanks-container {
    max-width: 600px;
    margin: 50px auto;
    padding: 30px;
    text-align: center;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.success-icon {
    margin-bottom: 20px;
}

.checkmark {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4CAF50 0%, #2e7d32 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: white;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.thanks-container h1 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.order-number {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
}

.order-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.order-id {
    font-size: 1.3em;
    font-weight: bold;
    color: #4CAF50;
    font-family: monospace;
}

.thanks-container .message {
    line-height: 1.6;
    color: #555;
    margin: 20px 0;
    font-size: 0.95em;
}

.steps {
    text-align: right;
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.steps h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.step-number {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #4CAF50 0%, #2e7d32 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    text-align: right;
    color: #555;
    font-size: 0.9em;
}

.contact-info {
    margin: 30px 0;
    padding: 20px;
    background: #e3f2fd;
    border-radius: 10px;
}

.contact-info h3 {
    margin-bottom: 15px;
    color: #1976d2;
}

.contact-item {
    margin: 10px 0;
    color: #555;
    font-size: 0.95em;
}

.contact-item a {
    color: #1976d2;
    text-decoration: none;
    font-weight: bold;
}

.contact-item a:hover {
    text-decoration: underline;
}

.buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.social-share {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.social-share h3 {
    margin-bottom: 15px;
    color: #333;
}

.social-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-btn:hover {
    transform: scale(1.1);
}

.social-btn.whatsapp {
    background: #25D366;
    color: white;
}

.social-btn.facebook {
    background: #1877f2;
    color: white;
}

.social-btn.telegram {
    background: #0088cc;
    color: white;
}

@media print {
    .buttons, .social-share {
        display: none;
    }
}

@media (max-width: 768px) {
    .thanks-container {
        margin: 20px;
        padding: 20px;
    }
    
    .thanks-container h1 {
        font-size: 1.5em;
    }
    
    .buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* ============================================
   Wallet Screen Enhancements
   ============================================ */

#walletSection .secondary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

#walletSection .stat-card {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
    transition: all 0.3s ease;
    cursor: default;
}

#walletSection .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

#walletSection .stat-card h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8em;
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#walletSection .stat-value {
    font-size: 1.6em;
    font-weight: bold;
    color: white;
    margin-bottom: 6px;
}

#walletSection .stat-change {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

#walletSection .stat-change.neutral {
    color: rgba(255, 255, 255, 0.8);
}

/* Content Grid for Money Operations */
#walletSection .content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

#walletSection .section {
    background: white;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

#walletSection .section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #e8e8e8;
}

#walletSection .section h2 {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: 12px 15px;
    margin: -12px -15px 12px -15px;
    border-bottom: 2px solid #f0f0f0;
    border-radius: 10px 10px 0 0;
    font-size: 0.95em;
    color: #333;
}

/* Distinct colors for each form section */
#requestMoneyForm ~ h2 {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

#walletSection .section:has(#requestMoneyForm) h2 {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
    padding-left: 12px;
}

#walletSection .section:has(#transferMoneyForm) h2 {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
    border-left: 4px solid #22c55e;
    padding-left: 12px;
}

#walletSection .section:has(#expenseForm) h2 {
    background: linear-gradient(135deg, #fed7aa 0%, #fbcf8f 100%);
    color: #92400e;
    border-left: 4px solid #f97316;
    padding-left: 12px;
}

#walletSection .section:has(#transactionsTable) h2 {
    background: linear-gradient(135deg, #e9d5ff 0%, #ddd6fe 100%);
    color: #6b21a8;
    border-left: 4px solid #a855f7;
    padding-left: 12px;
}

#walletSection .form-group {
    margin-bottom: 14px;
}

#walletSection .form-label {
    display: block;
    font-weight: 600;
    font-size: 0.85em;
    color: #333;
    margin-bottom: 6px;
    text-transform: capitalize;
}

#walletSection .form-control {
    padding: 8px 12px;
    font-size: 0.9em;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#walletSection .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

#walletSection .btn {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.9em;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#walletSection .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border: none;
}

#walletSection .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.35);
}

#walletSection .btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    color: white;
    border: none;
}

#walletSection .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(34, 197, 94, 0.35);
}

#walletSection .btn-warning {
    background: linear-gradient(135deg, #f97316 0%, #b45309 100%);
    color: white;
    border: none;
}

#walletSection .btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(249, 115, 22, 0.35);
}

#walletSection .btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

#walletSection .btn-secondary:hover {
    background: #eeeeee;
    border-color: #bbb;
}

/* Block button for full width */
#walletSection .btn-block {
    width: 100%;
    display: block;
}

/* Filter Panel Enhancement */
#walletSection .filter-panel {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
}

#walletSection .filter-panel .form-control {
    background: white;
    border: 1px solid #ddd;
}

/* Table Styling */
#walletSection table {
    border-collapse: collapse;
}

#walletSection table thead {
    background: linear-gradient(135deg, #e9d5ff 0%, #ddd6fe 100%);
}

#walletSection table th {
    padding: 14px 12px;
    font-weight: 700;
    color: #6b21a8;
    text-align: right;
    font-size: 0.95em;
}

#walletSection table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.95em;
}

#walletSection table tbody tr {
    transition: background-color 0.2s ease;
}

#walletSection table tbody tr:hover {
    background: #f3f0ff;
}

#walletSection table tbody tr:last-child td {
    border-bottom: none;
}

/* Pagination Container */
#walletSection .pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 12px;
    background: #f3f0ff;
    border-radius: 8px;
    flex-wrap: wrap;
}

#walletSection .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

#walletSection .pagination .btn {
    padding: 6px 12px;
    border: 2px solid #e5d4ff;
    background: white;
    color: #6b21a8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.9em;
}

#walletSection .pagination .btn:hover {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: white;
    border-color: #a855f7;
}

#walletSection .pagination span {
    padding: 0 12px;
    color: #6b21a8;
    font-weight: 600;
    font-size: 0.9em;
}

#walletSection .pagination span:last-of-type {
    color: #666;
    font-weight: normal;
}

/* Responsive Adjustments for Wallet */
@media (max-width: 1024px) {
    #walletSection .content-grid {
        grid-template-columns: 1fr;
    }
    
    #walletSection .filter-panel {
        flex-direction: column;
        width: 100%;
    }
    
    #walletSection .filter-panel .form-group {
        width: 100%;
    }
}

@media (max-width: 768px) {
    #walletSection .secondary-stats {
        grid-template-columns: 1fr;
    }
    
    #walletSection .stat-card {
        padding: 12px;
    }
    
    #walletSection .stat-value {
        font-size: 1.4em;
    }
    
    #walletSection .section h2 {
        font-size: 0.9em;
        padding: 10px 12px;
    }
    
    #walletSection table {
        font-size: 0.75em;
    }
    
    #walletSection table th,
    #walletSection table td {
        padding: 8px 6px;
    }
    
    #walletSection .form-control {
        padding: 6px 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    #walletSection .btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }
    
    #walletSection .filter-panel {
        width: 100%;
    }
}

/* ============================================
   Fade-in Animation for Content Sections
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* ============================================
   Calculation Guide Modal Responsive
   ============================================ */
@media (max-width: 768px) {
    #calculationGuideModal .modal-content {
        max-width: 95% !important;
        padding: 15px !important;
        margin: 10px;
    }
    
    #calculationGuideModal .modal-header h2 {
        font-size: 1.1em;
    }
    
    #calculationGuideModal .modal-body {
        max-height: 65vh !important;
        padding: 10px !important;
    }
    
    #calculationGuideModal table {
        font-size: 0.8em !important;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    #calculationGuideModal th,
    #calculationGuideModal td {
        padding: 8px 6px !important;
        font-size: 0.85em !important;
    }
    
    #calculationGuideModal .modal-body > div {
        font-size: 0.85em;
    }
    
    #calculationGuideModal .modal-body > div > div {
        padding: 10px !important;
    }
}

@media (max-width: 576px) {
    #calculationGuideModal .modal-content {
        max-width: 98% !important;
        padding: 10px !important;
        margin: 5px;
    }
    
    #calculationGuideModal .modal-header {
        padding: 10px !important;
    }
    
    #calculationGuideModal .modal-header h2 {
        font-size: 0.95em;
    }
    
    #calculationGuideModal .modal-body {
        max-height: 60vh !important;
        padding: 8px !important;
    }
    
    #calculationGuideModal table {
        font-size: 0.7em !important;
    }
    
    #calculationGuideModal th,
    #calculationGuideModal td {
        padding: 6px 4px !important;
        font-size: 0.75em !important;
    }
    
    #calculationGuideModal .modal-body > div {
        font-size: 0.75em;
        margin-top: 15px !important;
    }
    
    #calculationGuideModal .modal-body > div > div {
        padding: 8px !important;
        line-height: 1.6 !important;
    }
    
    #calculationGuideModal .modal-close {
        font-size: 1.5em;
        padding: 5px 10px;
    }
}
/* Calculation Guide Modal Styles */
.calculation-guide-modal {
    max-width: 900px;
}

.calculation-guide-modal .modal-body {
    max-height: 80vh;
    overflow-y: auto;
}

.calc-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
}

.calc-guide-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    font-size: 0.95em;
    table-layout: auto;
}

.calc-guide-table thead {
    background: #667eea;
    color: white;
}

.calc-guide-table th {
    padding: 12px;
    border: 1px solid #dee2e6;
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.calc-guide-table td {
    padding: 10px;
    border: 1px solid #dee2e6;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.calc-guide-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

/* Nested calculation table */
.calc-nested-table-wrapper {
    overflow-x: auto;
    margin-top: 10px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.calc-nested-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    table-layout: auto;
}

.calc-nested-table tr:first-child {
    background: #f0f4ff;
}

.calc-nested-table tr:nth-child(even) {
    background: #fafafa;
}

.calc-nested-table td {
    padding: 8px;
    border: 1px solid #ddd;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.calc-nested-table td:first-child {
    font-weight: normal;
    min-width: 100px;
}

.calc-nested-table td:nth-child(2) {
    text-align: center;
    white-space: nowrap;
    min-width: 80px;
}

.calc-nested-table .formula {
    direction: ltr;
    text-align: left;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    min-width: 200px;
}

/* Performance Zones */
.performance-zones {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.zone {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}

.zone-excellent {
    border-right: 5px solid #4caf50;
}

.zone-good {
    border-right: 5px solid #ffc107;
}

.zone-average {
    border-right: 5px solid #f44336;
}

.zone-poor {
    border-right: 5px solid #424242;
}

.zone-norank {
    border-right: 5px solid #9e9e9e;
}

.zone-badge {
    background: #4caf50;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
}

.zone-good .zone-badge {
    background: #ffc107;
    color: #000;
}

.zone-average .zone-badge {
    background: #f44336;
    color: white;
}

.zone-poor .zone-badge {
    background: #424242;
    color: white;
}

.zone-norank .zone-badge {
    background: #9e9e9e;
    color: white;
}

.zone-info {
    flex: 1;
}

.zone-info strong {
    font-size: 1.05em;
    display: block;
    margin-bottom: 3px;
}

.zone-excellent .zone-info strong {
    color: #2e7d32;
}

.zone-good .zone-info strong {
    color: #f57c00;
}

.zone-average .zone-info strong {
    color: #c62828;
}

.zone-poor .zone-info strong {
    color: #212121;
}

.zone-norank .zone-info strong {
    color: #616161;
}

.zone-desc {
    color: #666;
    font-size: 0.9em;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .calculation-guide-modal {
        max-width: 98%;
        margin: 10px auto;
    }

    .calculation-guide-modal .modal-body {
        max-height: calc(100vh - 180px);
        padding: 12px;
        overflow-y: auto;
    }

    .calc-guide-table {
        font-size: 1em;
    }

    .calc-guide-table th,
    .calc-guide-table td {
        padding: 12px 8px;
        line-height: 1.5;
    }

    .calc-guide-table td:first-child {
        width: 25%;
        min-width: 80px;
    }

    .calc-nested-table-wrapper {
        margin-left: 0;
        margin-right: 0;
        padding: 0;
        overflow-x: visible;
    }

    .calc-nested-table {
        font-size: 0.9em;
        min-width: auto;
        table-layout: fixed;
    }

    .calc-nested-table td {
        padding: 8px 4px;
        line-height: 1.3;
    }

    .calc-nested-table td:first-child {
        min-width: auto;
        width: 35%;
    }

    .calc-nested-table td:nth-child(2) {
        min-width: auto;
        width: 25%;
        white-space: normal;
    }

    .calc-nested-table .formula {
        min-width: auto;
        width: 40%;
        font-size: 0.8em;
        white-space: normal;
        word-break: break-all;
    }

    .performance-zones {
        gap: 10px;
    }

    .zone {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 10px;
    }

    .zone-badge {
        min-width: 70px;
        padding: 5px 10px;
        font-size: 0.9em;
    }

    .zone-info strong {
        font-size: 1em;
    }

    .zone-desc {
        font-size: 0.85em;
        line-height: 1.3;
    }
}

@media (max-width: 576px) {
    .calculation-guide-modal {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }

    .calculation-guide-modal .modal-body {
        max-height: calc(100vh - 160px);
        padding: 8px;
        overflow-y: auto;
    }

    .calc-guide-table {
        font-size: 0.9em;
    }

    .calc-guide-table th,
    .calc-guide-table td {
        padding: 8px 5px;
        line-height: 1.4;
    }

    .calc-guide-table td:first-child {
        width: 30%;
        min-width: 70px;
    }

    .calc-nested-table-wrapper {
        margin-left: 0;
        margin-right: 0;
        padding: 0;
        overflow-x: visible;
    }

    .calc-nested-table {
        font-size: 0.85em;
        min-width: auto;
        table-layout: fixed;
    }

    .calc-nested-table td {
        padding: 6px 3px;
        line-height: 1.2;
    }

    .calc-nested-table td:first-child {
        min-width: auto;
        width: 35%;
    }

    .calc-nested-table td:nth-child(2) {
        min-width: auto;
        width: 25%;
        white-space: normal;
        font-size: 0.9em;
    }

    .calc-nested-table .formula {
        min-width: auto;
        width: 40%;
        font-size: 0.75em;
        white-space: normal;
        word-break: break-all;
        line-height: 1.2;
    }

    .zone {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px;
        gap: 8px;
    }

    .zone-badge {
        min-width: 65px;
        padding: 4px 10px;
        font-size: 0.85em;
    }

    .zone-info strong {
        font-size: 0.95em;
    }

    .zone-desc {
        font-size: 0.8em;
        line-height: 1.2;
    }
}
/* Product Filter Enhancements */
#performanceProductFilter:hover {
    border-color: #2980b9;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
    transform: translateY(-1px);
}

#performanceProductFilter:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

#performanceProductFilter option {
    padding: 10px;
    font-weight: 600;
}
