/* WashinUp Premium CSS Design System */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* These values will be overridden dynamically by settings in header.php */
    --primary: #3b82f6;
    --primary-rgb: 59, 130, 246;
    --secondary: #1d4ed8;
    --secondary-rgb: 29, 78, 216;
    --bg-main: #0f172a;
    --text-main: #f8fafc;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
}

[dir="rtl"] {
    --font-family: 'Cairo', sans-serif;
}

[dir="ltr"] {
    --font-family: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    position: relative;
}

/* Ambient Background Lights */
body::before {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    top: -200px;
    left: -200px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    bottom: -200px;
    right: -200px;
    background: radial-gradient(circle, rgba(var(--secondary-rgb), 0.1) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* App Layout Grid */
.app-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

[dir="rtl"] .app-wrapper {
    grid-template-columns: 260px 1fr;
}

/* Sidebar styling */
.sidebar {
    background: rgba(15, 23, 42, 0.85);
    border-inline-end: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
}

.sidebar .brand {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 35px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-menu a:hover, 
.sidebar-menu li.active a {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 3px 0 0 var(--primary);
}

[dir="rtl"] .sidebar-menu a:hover, 
[dir="rtl"] .sidebar-menu li.active a {
    box-shadow: inset -3px 0 0 var(--primary);
}

.sidebar-menu a i {
    margin-inline-end: 12px;
    font-size: 1.1rem;
}

/* Header */
header.app-header {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.branch-selector select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

/* User controls */
.lang-toggle, .notifications-bell, .user-profile {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    position: relative;
}

.lang-toggle:hover, .notifications-bell:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content Area */
main.app-main {
    padding: 40px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Glass Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(16px);
    margin-bottom: 30px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Grid boxes for dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-info p {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-icon {
    font-size: 2rem;
    color: var(--primary);
    opacity: 0.8;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.form-control, select, textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

select option {
    background-color: #0f172a;
    color: #ffffff;
}

.form-control:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.25);
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

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

/* Table Style */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: start;
}

table.data-table th {
    background: rgba(15, 23, 42, 0.5);
    padding: 16px;
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

table.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: #e2e8f0;
}

table.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Unpaid Glow Notification & Flashing Alert */
.unpaid-glow {
    position: relative;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    animation: glow-pulse 1.5s infinite alternate;
}

.unpaid-flash {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger);
    margin-inline-start: 8px;
    animation: flash-red 0.8s infinite alternate;
}

@keyframes glow-pulse {
    from {
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.3);
    }
    to {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
    }
}

@keyframes flash-red {
    from {
        opacity: 0.1;
        box-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }
    to {
        opacity: 1;
        box-shadow: 0 0 8px rgba(239, 68, 68, 1);
    }
}

/* Support Chat UI */
.ticket-messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    max-height: 400px;
    overflow-y: auto;
    padding-inline-end: 10px;
}

.message-bubble {
    padding: 15px 20px;
    border-radius: 16px;
    max-width: 75%;
}

.message-bubble.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

[dir="rtl"] .message-bubble.sent {
    border-bottom-right-radius: 16px;
    border-bottom-left-radius: 4px;
}

.message-bubble.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

[dir="rtl"] .message-bubble.received {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 4px;
}

.message-meta {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    margin-top: 5px;
    display: block;
}

/* Landing Page public */
.navbar-public {
    height: 80px;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
}

.navbar-public .logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-logo-img {
    height: 60px;
    max-height: 60px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

.sidebar-logo-img {
    max-height: 50px;
    width: auto;
    object-fit: contain;
    margin-bottom: 5px;
}

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

.branch-hero-banner {
    width: 100%;
    height: 350px;
    border-radius: 24px;
    background-size: cover;
    background-position: center;
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.branch-hero-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.4) 0%, rgba(15, 23, 42, 0.9) 100%);
}

.banner-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px;
}

.banner-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.banner-content p {
    color: #cbd5e1;
    font-size: 1.1rem;
}

.alert-toast {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
}

.hero-section {
    padding: 80px 0;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-section h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section p {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 40px;
}

.partners-section {
    margin-top: 60px;
}

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

.partner-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.partner-card:hover {
    transform: scale(1.03);
    border-color: var(--primary);
}

/* Responsive Grid Helpers */
.public-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.layout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.layout-grid-reverse {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: start;
}

.mobile-menu-toggle {
    display: none;
}

.mobile-menu-close {
    display: none;
}

/* Responsive Styles */
@media(max-width: 992px) {
    .app-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;
        width: 280px;
        background: #0b0f19;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.6);
        height: 100vh;
    }
    
    [dir="rtl"] .sidebar {
        left: auto;
        right: 0;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.6);
    }
    
    .sidebar.active {
        display: flex !important;
        animation: slideIn 0.3s ease;
    }
    
    .mobile-menu-toggle {
        display: inline-flex;
    }
    
    .mobile-menu-close {
        display: inline-flex;
        background: transparent;
        border: none;
        color: #94a3b8;
        font-size: 1.5rem;
        cursor: pointer;
        position: absolute;
        top: 20px;
        right: 20px;
    }
    
    [dir="rtl"] .mobile-menu-close {
        right: auto;
        left: 20px;
    }
    
    header.app-header {
        padding: 0 20px;
    }
    
    main.app-main {
        padding: 20px;
    }
    
    .layout-grid, .layout-grid-reverse, .public-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

@media(max-width: 768px) {
    .navbar-public {
        height: auto;
        min-height: 80px;
        padding: 15px 20px;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .navbar-public .header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .branch-hero-banner {
        height: 250px;
    }
    
    .banner-content h2 {
        font-size: 1.8rem;
    }
    
    .navbar-logo-img {
        height: 45px;
        max-height: 45px;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

[dir="rtl"] @keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

