/* ============================================
   HERO BANNER
   ============================================ */
.dashboard-hero {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #0056b3 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.15);
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.dashboard-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-direction: row;
}

.dashboard-hero-icon {
    font-size: 3rem;
    opacity: 0.9;
    flex-shrink: 0;
    order: 1;
}

.dashboard-hero-text {
    order: 2;
}

.dashboard-hero-text h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.dashboard-hero-text p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.95;
}

/* Hero RTL Fix - Icon on right, text on left */
html[dir="rtl"] .dashboard-hero-content {
    flex-direction: row;
}

html[dir="rtl"] .dashboard-hero-icon {
    order: 2;
}

html[dir="rtl"] .dashboard-hero-text {
    order: 1;
    text-align: right;
}

html[dir="rtl"] .dashboard-hero::before {
    right: auto;
    left: -10%;
}

html[dir="rtl"] .dashboard-hero::after {
    left: auto;
    right: -5%;
}

/* ============================================
   RIGHT COLUMN WATERMARK GRAPHIC
   ============================================ */

.dashboard-right-watermark {
    position: sticky;
    top: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 500px;
    opacity: 0.08;
    pointer-events: none;
    user-select: none;
}

.watermark-icon-large {
    font-size: 200px;
    color: var(--brand-primary);
    margin-bottom: 20px;
    animation: float 6s ease-in-out infinite;
}

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

html[dir="rtl"] .dashboard-right-watermark {
    transform: scaleX(-1);
}

@media (max-width: 1024px) {
    .dashboard-right-watermark {
        display: none;
    }
}


/* w2e/public/client/assets/client.css - Multi-brand responsive client area styles */

:root {
    --client-primary: #007bff;
    --client-secondary: #6c757d;
    --client-success: #28a745;
    --client-info: #17a2b8;
    --client-warning: #ffc107;
    --client-danger: #dc3545;
    --client-light: #f8f9fa;
    --client-dark: #343a40;
    --client-white: #ffffff;
    
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease-in-out;
}

html[lang="en"] {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html[lang="he"] {
    font-family: 'Heebo', 'Assistant', 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

html[dir="rtl"] .me-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

html[dir="rtl"] .ms-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.client-header {
    background: white;
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
}

.header-logo-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-logo {
    max-height: 40px;
    width: auto;
    display: block;
}

.header-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
}

.brand-name-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-primary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.header-lang {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.lang-btn {
    padding: 6px 10px;
    background: white;
    border: 1px solid #dee2e6;
    color: #6c757d;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-block;
    white-space: nowrap;
}

.lang-btn:hover {
    background: #f8f9fa;
    color: var(--brand-primary);
    border-color: #adb5bd;
}

.lang-btn.active {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.lang-sep {
    color: #dee2e6;
    font-size: 12px;
}

.user-name {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-name i {
    font-size: 18px;
    color: var(--brand-primary);
    flex-shrink: 0;
}

.btn-logout {
    padding: 8px 14px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-logout:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

.btn-logout i {
    font-size: 16px;
}

.client-tabs {
    background: var(--brand-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0;
    position: sticky;
    top: 65px;
    z-index: 99;
}

.tabs-container {
    display: flex;
    gap: 0;
    padding: 0 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs-container::-webkit-scrollbar {
    height: 3px;
}

.tabs-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.tab-link {
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.tab-link.active {
    color: white;
    border-bottom-color: white;
    background: rgba(255, 255, 255, 0.15);
}

.tab-link i.bi {
    font-size: 16px;
    vertical-align: middle;
}

.tab-link .tab-label {
    display: inline;
    vertical-align: middle;
}

.tab-link .tab-external-icon {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 2px;
}

.tab-link.tab-link-external {
    opacity: 0.7;
}

.tab-link.tab-link-external:hover {
    opacity: 1;
}

.client-main-content {
    background: linear-gradient(135deg, #dce4f0 0%, #c3cfe2 100%);
    min-height: calc(100vh - 130px);
    padding: 1.5rem 1rem;
}

.client-main-content .container-fluid {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   CARDS & COMPONENTS
   ============================================ */

.client-card {
    background: var(--client-white);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: none;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease-out;
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

.client-card .card-header {
    background-color: var(--client-light);
    border-bottom: 1px solid #dee2e6;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--brand-primary);
}

html[dir="rtl"] .client-card .card-header {
    border-left: none;
    border-right: 4px solid var(--brand-primary);
}

.client-card .card-body {
    padding: 1.5rem;
}

.btn-client-primary {
    background-color: var(--client-primary);
    border-color: var(--client-primary);
    color: var(--client-white);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-client-primary:hover,
.btn-client-primary:focus {
    background-color: #0056b3;
    border-color: #0056b3;
    color: var(--client-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-connected {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--client-success);
}

.status-connected::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--client-success);
    border-radius: 50%;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.status-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--client-danger);
}

.status-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--client-info);
}

.alert-client {
    border-radius: var(--border-radius);
    border: none;
    padding: 12px 16px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-client i {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-client-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
    border-left: none;
}

.alert-client-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--client-danger);
    border-left: none;
}

.alert-client-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: none;
}

.alert-client-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--client-info);
    border-left: none;
}

html[dir="rtl"] .alert-client-success,
html[dir="rtl"] .alert-client-danger,
html[dir="rtl"] .alert-client-warning,
html[dir="rtl"] .alert-client-info {
    border-left: none;
    border-right: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .header-bar {
        gap: 0.75rem;
        padding: 0 0.75rem;
    }
    
    .tabs-container {
        padding: 0 0.75rem;
    }
    
    .tab-link {
        padding: 10px 12px;
        font-size: 13px;
        gap: 4px;
    }
}

@media (max-width: 768px) {
    .header-bar {
        gap: 0.5rem;
        padding: 0 0.5rem;
        grid-template-columns: auto 1fr auto;
    }
    
    .brand-name-text {
        font-size: 16px;
    }
    
    .header-controls {
        gap: 0.5rem;
    }
    
    .header-lang {
        gap: 4px;
    }
    
    .lang-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .lang-sep {
        font-size: 10px;
    }
    
    .user-name {
        display: none;
    }
    
    .btn-logout {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .btn-logout span {
        display: none;
    }
    
    .btn-logout i {
        font-size: 14px;
    }
    
    .tabs-container {
        padding: 0 0.5rem;
    }
    
    .tab-link {
        padding: 10px 12px;
        font-size: 0;
        gap: 0;
    }
    
    .tab-link i.bi {
        font-size: 16px;
    }
    
    .tab-label {
        display: none;
    }
    
    .tab-external-icon {
        display: none !important;
    }
    
    .client-main-content {
        padding: 1rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .header-logo {
        max-height: 32px;
    }
    
    .brand-name-text {
        font-size: 14px;
    }
    
    .header-controls {
        gap: 0.4rem;
    }
    
    .lang-btn {
        padding: 4px 6px;
        font-size: 10px;
    }
    
    .btn-logout {
        padding: 5px 8px;
    }
    
    .tab-link {
        padding: 8px 10px;
        font-size: 0;
    }
    
    .tab-link i.bi {
        font-size: 14px;
    }
    
    .client-main-content {
        min-height: calc(100vh - 120px);
        padding: 1rem;
    }
}

/* ============================================
   SETTINGS PAGE SPECIFIC STYLES
   ============================================ */

/* Settings section cards - enhanced styling */
.client-card[style*="position: sticky"] {
    top: 220px;
    z-index: 50;
}

/* Disabled form controls (read-only style) */
select:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    background-color: #f0f0f0 !important;
}

/* Read-only field display boxes */
.settings-readonly-field {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    color: #2c3e50;
    border: 1px solid #e9ecef;
    min-height: 40px;
    display: flex;
    align-items: center;
}

/* Settings label styling */
.settings-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toggle switch styling */
.settings-toggle-input {
    width: 20px;
    height: 20px;
    cursor: not-allowed;
}

/* Badge styling for statuses */
.status-badge {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.status-badge-success {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.status-badge-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.status-badge-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Info box styling */
.settings-info-box {
    background: #f8f9fa;
    padding: 14px;
    border-radius: 8px;
    border-left: 4px solid var(--brand-primary);
    margin-bottom: 20px;
}

html[dir="rtl"] .settings-info-box {
    border-left: none;
    border-right: 4px solid var(--brand-primary);
}

.settings-info-box strong {
    display: block;
    margin-bottom: 4px;
    color: #2c3e50;
    font-size: 14px;
}

.settings-info-box small {
    color: #6c757d;
}

/* Contact list display */
.contact-list-item {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

.contact-list-item:last-child {
    border-bottom: none;
}

.contact-list-item-phone {
    font-weight: 500;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.contact-list-item-description {
    color: #6c757d;
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

/* Progress bar styling */
.settings-progress-bar {
    height: 10px;
    border-radius: 10px;
    background: #e9ecef;
}

.settings-progress-bar .progress-bar {
    background: linear-gradient(90deg, var(--brand-primary), #0056b3);
    border-radius: 10px;
}

/* Two-column grid for fields */
.settings-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Three-column grid for contact lists */
.settings-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Phone copy button styling */
.btn-copy-phone {
    padding: 10px 12px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    font-size: 13px;
    transition: all 0.2s ease;
}

.btn-copy-phone:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

/* Preference items */
.preference-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e9ecef;
}

.preference-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.preference-item-label {
    flex: 1;
}

.preference-item-label strong {
    display: block;
    margin-bottom: 4px;
    color: #2c3e50;
}

.preference-item-label small {
    color: #6c757d;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .settings-grid-2col {
        grid-template-columns: 1fr;
    }
    
    .settings-grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .client-card[style*="position: sticky"] {
        position: relative;
        top: auto;
    }
}

@media (max-width: 768px) {
    .settings-grid-2col,
    .settings-grid-3col {
        grid-template-columns: 1fr;
    }
    
    .preference-item {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .preference-item-label small {
        margin-top: 6px;
    }
    
    .btn-copy-phone {
        width: 100%;
    }
}

/* Watermark adjustments for settings */
.dashboard-right-watermark {
    animation: float 8s ease-in-out infinite;
}

/* Section header styling */
.client-card .card-header h5 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.client-card .card-header h6 {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

/* Field separators */
.settings-section-divider {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Status color helpers */
.text-active {
    color: #198754;
}

.text-inactive {
    color: #6c757d;
}

.text-expiring {
    color: #856404;
}

.text-expired {
    color: #dc3545;
}
/**
 * WAHA Modal RTL/LTR Fix
 * Add this to w2e/public/client/assets/client.css
 */

/* Modal header layout fix for RTL/LTR */
.waha-modal-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

/* Title takes remaining space */
.waha-modal-header .modal-title {
    flex: 1;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.5;
}

/* Close button - no margins, just positioned */
.waha-modal-header .btn-close {
    flex-shrink: 0;
}

/* LTR: normal order */
[dir="ltr"] .waha-modal-header {
    flex-direction: row;
}

[dir="ltr"] .waha-modal-header .modal-title {
    text-align: left;
    order: 1;
}

[dir="ltr"] .waha-modal-header .btn-close {
    order: 2;
    margin-left: 1rem;
}

/* RTL: reverse order visually */
[dir="rtl"] .waha-modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .waha-modal-header .modal-title {
    text-align: right;
    order: 2;
}

[dir="rtl"] .waha-modal-header .btn-close {
    order: 1;
    margin-right: 1rem;
}

/* Generic Bootstrap .modal-header .btn-close RTL fix (C483, billing.php's
   cancel/renew/resume/reactivate/switch/card-iframe modals) — Bootstrap's
   own .btn-close rule hardcodes margin-left:auto, which pins the X to the
   LTR-trailing (right) side even under dir="rtl", where it should be on the
   left. Same fix approach as .waha-modal-header above, generalized to any
   plain Bootstrap modal-header. */
[dir="rtl"] .modal-header .btn-close {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .form-check .form-check-label {
    margin-right: 0.25em;
}

.form-check-input {
    border-color: #6c757d;
}

/* C488: modal close button belongs on the left in RTL (Bootstrap's LTR stylesheet leaves it beside the title). */
html[dir="rtl"] .modal-header .btn-close {
    margin: -0.5rem auto -0.5rem -0.5rem;
    order: 2;
}
html[dir="rtl"] .modal-header .modal-title { margin-right: 0; }
