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

:root {
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --brand-primary: #4533F5; /* Wagic Indigo */
    --brand-hover: #3322D4;
    --brand-light: #ECEBFF;
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fef2f2;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-hover);
}

/* --- LAYOUT GRID --- */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    color: var(--text-main);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 4px;
}

.sidebar-brand h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-primary);
    letter-spacing: -0.5px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-menu a {
    color: var(--text-muted);
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-menu li.active a,
.sidebar-menu a:hover {
    color: var(--brand-primary);
    background-color: var(--brand-light);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-info-widget {
    font-size: 14px;
}

.user-business-name {
    font-weight: 600;
    display: block;
}

.user-owner-name {
    color: #94a3b8;
}

/* --- MAIN WORKSPACE --- */
.main-content {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* --- CARDS & PANELS --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-card h5 {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-align: left !important;
    direction: ltr !important;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    text-align: left !important;
}

.panel-card {
    background-color: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.panel-card h3 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(100deg, var(--brand-primary) 0%, #00C8E0 110%);
    color: #ffffff;
    box-shadow: 0 8px 24px -8px rgba(69, 51, 245, 0.45);
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -8px rgba(69, 51, 245, 0.55);
    background: linear-gradient(100deg, var(--brand-hover) 0%, #00b4cc 110%);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-main);
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

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

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

.btn-secondary-sm {
    padding: 6px 12px;
    font-size: 12px;
    background-color: #f1f5f9;
    color: var(--text-main);
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary-sm {
    padding: 6px 12px;
    font-size: 12px;
    background-color: var(--brand-primary);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-danger-sm {
    padding: 6px 12px;
    font-size: 12px;
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fee2e2;
    border-radius: 4px;
    cursor: pointer;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    outline: none;
    transition: border 0.2s ease;
}

.form-control:focus {
    border-color: var(--brand-primary);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-group-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.form-group-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* --- BOTS LIST & SPLIT WORKSPACE --- */
.bots-page-container {
    display: block;
}

/* --- BOT SWITCHER DROPDOWN --- */
.bot-switcher-dropdown {
    position: relative;
    display: inline-block;
}

.bot-switcher-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bot-switcher-trigger:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 4px 12px rgba(69, 51, 245, 0.08);
    transform: translateY(-1px);
}

.bot-switcher-trigger:active {
    transform: translateY(0);
}

.bot-switcher-trigger .bot-icon {
    font-size: 16px;
}

.bot-switcher-trigger .chevron-icon {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.bot-switcher-dropdown.open .bot-switcher-trigger .chevron-icon {
    transform: rotate(180deg);
}

.bot-switcher-dropdown.open .bot-switcher-trigger {
    border-color: var(--brand-primary);
    box-shadow: 0 4px 12px rgba(69, 51, 245, 0.08);
}

.bot-switcher-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 99;
    width: 250px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    display: none;
    transform-origin: top left;
    animation: dropdown-pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* RTL context layout alignment */
[dir="rtl"] .bot-switcher-menu {
    left: auto;
    right: 0;
    transform-origin: top right;
}

.bot-switcher-dropdown.open .bot-switcher-menu {
    display: block;
}

@keyframes dropdown-pop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bot-switcher-menu ul {
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
}

.bot-switcher-menu li {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}

.bot-switcher-menu li:hover {
    background-color: var(--bg-primary);
    color: var(--brand-primary);
}

.bot-switcher-menu li.active {
    font-weight: 600;
    color: var(--brand-primary);
    background-color: var(--brand-light);
}

.bot-switcher-menu li.active::after {
    content: "✓";
    font-size: 14px;
    color: var(--brand-primary);
    font-weight: bold;
}

.bot-switcher-menu .dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 8px 0;
}

.bot-switcher-menu .dropdown-add-btn {
    display: block;
    width: calc(100% - 16px);
    margin: 4px 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--brand-primary);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

[dir="rtl"] .bot-switcher-menu .dropdown-add-btn {
    text-align: right;
}

.bot-switcher-menu .dropdown-add-btn:hover {
    background-color: var(--brand-light);
}

.bots-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    align-self: start;
}

.bots-sidebar h4 {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
}

.bots-sidebar ul {
    list-style: none;
}

.bots-sidebar li {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.bots-sidebar li:hover,
.bots-sidebar li.active {
    background-color: var(--brand-light);
    color: var(--brand-hover);
    font-weight: 500;
}

/* --- BOT ITEM CARD --- */
.bot-item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.bot-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.bot-card-header h4 {
    margin-right: auto;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.active {
    background-color: #10b981;
}

.status-dot.inactive {
    background-color: #ef4444;
}

.status-text {
    font-size: 12px;
    color: var(--text-muted);
}

.bot-card-body {
    margin-bottom: 16px;
    font-size: 13px;
}

.bot-card-footer {
    display: flex;
    gap: 8px;
}

/* --- KNOWLEDGE BASE ITEMS --- */
.kb-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
}

.kb-file-info {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- LEAD CAPTURE FIELDS LIST --- */
.lead-field-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
}

.field-drag-icon {
    color: var(--text-muted);
    cursor: grab;
}

.field-label-text {
    margin-right: auto;
    font-size: 14px;
}

/* --- TESTING PLAYGROUND CHAT --- */
.tester-chat-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    height: 400px;
}

.tester-chat-header {
    background-color: #f8fafc;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tester-chat-messages {
    flex-grow: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tester-chat-messages .message {
    display: flex;
    max-width: 80%;
}

.tester-chat-messages .message.user {
    align-self: flex-end;
}

.tester-chat-messages .message.assistant {
    align-self: flex-start;
}

.tester-chat-messages .message-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
}

.tester-chat-messages .message.user .message-content {
    background-color: var(--brand-primary);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.tester-chat-messages .message.assistant .message-content {
    background-color: #f1f5f9;
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.tester-chat-messages .message.thinking .message-content {
    color: var(--text-muted);
    font-style: italic;
}

.tester-chat-input-bar {
    display: flex;
    border-top: 1px solid var(--border-color);
}

.tester-chat-input-bar input {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-size: 14px;
}

/* Tester lead form inside chat message container */
.tester-lead-form-block {
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-md);
    margin-top: 10px;
    align-self: flex-start;
    width: 280px;
}

.tester-lead-form-block h5 {
    margin-bottom: 8px;
}

.tester-lead-form-block p {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.form-group-sm {
    margin-bottom: 8px;
}

.form-group-sm label {
    display: block;
    font-size: 11px;
    margin-bottom: 2px;
}

.form-control-sm {
    width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    outline: none;
}

.tester-form-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

/* --- LEADS TABLES & FILTERS --- */
.leads-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.leads-table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.leads-table th {
    background-color: #f8fafc;
    padding: 14px 20px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.leads-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.lead-row.contacted {
    opacity: 0.7;
}

.lead-row.new {
    border-left: 3px solid var(--brand-primary);
}

/* --- MODALS --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: modal-fade-in 0.2s ease-out;
}

.modal-dialog {
    background-color: #ffffff;
    width: 500px;
    max-width: 90%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modal-pop-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-pop-up {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(15px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    background-color: #f8fafc;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close-btn {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 20px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background-color: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.refine-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 250px;
}

/* --- PLAN PRICING SELECTION CARDS --- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.plan-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.plan-card.current {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}

.plan-card.current::before {
    content: "Active";
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--brand-primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.plan-card h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

.plan-card .price {
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 12px;
}

.plan-card ul {
    list-style: none;
    text-align: left;
    margin-bottom: 24px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* --- AUTH PAGE CONTAINER --- */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #F8F9FB;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto;
    height: 120%;
    background:
        radial-gradient(45% 55% at 15% 25%, rgba(69, 51, 245, 0.08), transparent 70%),
        radial-gradient(40% 50% at 85% 15%, rgba(0, 200, 224, 0.08), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.auth-card {
    background-color: #ffffff;
    width: 420px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16,22,42,.05), 0 12px 32px -12px rgba(16,22,42,.12);
    padding: 34px;
    border: 1px solid rgba(16, 22, 42, 0.08);
    position: relative;
    z-index: 1;
}

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

.auth-header h2 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 8px;
    font-size: 26px;
    letter-spacing: -0.5px;
}

.auth-footer-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
}

/* --- ONBOARDING CARD --- */
.onboarding-card {
    padding: 50px 40px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.onboarding-icon {
    font-size: 72px;
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

.onboarding-desc {
    font-size: 15px;
    margin-bottom: 35px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-align: left;
}

.onboarding-steps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
    text-align: left;
}

.onboarding-step-item {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.onboarding-step-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.step-icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.onboarding-step-item strong {
    font-size: 15px;
    display: block;
    margin-bottom: 6px;
    color: var(--text-main);
    font-weight: 600;
}

.onboarding-step-item span {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    display: block;
}

.onboarding-form-wrapper {
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    padding: 30px;
    max-width: 540px;
    margin: 0 auto;
    text-align: left;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.onboarding-form-wrapper h4 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.onboarding-form-wrapper form {
    display: flex;
    gap: 12px;
}

.onboarding-form-wrapper input {
    padding: 12px 16px;
    font-size: 14px;
    flex-grow: 1;
}

.onboarding-form-wrapper button {
    padding: 0 28px;
    white-space: nowrap;
}

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

/* --- CONFIG TAB NAVIGATION --- */
.bot-config-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-main);
    background-color: var(--brand-light);
}

.tab-btn.active {
    color: var(--brand-primary);
    background-color: var(--brand-light);
    font-weight: 600;
}

.tab-content-panel {
    display: none;
}

.tab-content-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.tab-nav-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.tab-nav-footer .btn {
    font-size: 13px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
}

.next-tab-btn {
    background-color: var(--brand-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    margin-left: auto;
}

.next-tab-btn:hover {
    background-color: var(--brand-hover);
}

.prev-tab-btn {
    background-color: #f1f5f9;
    color: var(--text-main);
    border: 1px solid #cbd5e1;
    cursor: pointer;
}

.prev-tab-btn:hover {
    background-color: #e2e8f0;
}

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

/* --- PASSWORD INPUT WRAPPER & VISIBILITY TOGGLE --- */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper .form-control {
    padding-right: 44px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 4px;
    margin: 0;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: var(--brand-primary);
}

.password-toggle-btn .eye-icon {
    width: 20px;
    height: 20px;
}

/* RTL overrides for password toggler */
[dir="rtl"] .password-input-wrapper .form-control {
    padding-right: 12px;
    padding-left: 44px;
}

[dir="rtl"] .password-toggle-btn {
    right: auto;
    left: 12px;
}

/* --- PASSWORD COMPLEXITY CHECKLIST --- */
.password-requirements {
    margin-top: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: fadeIn 0.2s ease;
}

.req-item {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.req-item .bullet {
    font-weight: bold;
    font-size: 14px;
    width: 12px;
    text-align: center;
}

.req-item.invalid {
    color: #ef4444; /* red-500 */
}

.req-item.invalid .bullet {
    color: #ef4444;
}

.req-item.valid {
    color: #10b981; /* emerald-500 */
}

.req-item.valid .bullet {
    color: #10b981;
}

/* --- CUSTOM TOAST CONTAINER & TOAST MESSAGES --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.toast-message {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--brand-primary);
    pointer-events: auto;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.2s, opacity 0.2s;
}

.toast-message.success {
    border-left-color: #10b981;
}

.toast-message.error {
    border-left-color: #ef4444;
}

.toast-message.warning {
    border-left-color: #f59e0b;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- PREMIUM LIGHT GLASSMORPHISM FOR AUTHENTICATION --- */
.auth-container {
    background-color: #f8fafc;
}

.auth-container::before {
    background:
        radial-gradient(55% 55% at 20% 30%, rgba(69, 51, 245, 0.05), transparent 70%),
        radial-gradient(50% 50% at 80% 20%, rgba(0, 200, 224, 0.05), transparent 70%);
}

.auth-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.auth-card .text-muted {
    color: #64748b !important;
}

.auth-card .form-control {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.auth-card .form-control::placeholder {
    color: #94a3b8;
}

.auth-card .form-control:focus {
    background-color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(69, 51, 245, 0.15);
}

.auth-card label {
    color: #334155;
}

.auth-card .auth-footer-text {
    color: #64748b;
}

.auth-card .auth-footer-text a {
    color: var(--brand-primary);
    font-weight: 600;
}

.auth-card .password-requirements {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

[dir="rtl"] select.form-control {
    background-position: left 14px center;
    padding-right: 14px;
    padding-left: 40px;
}

/* --- MOBILE RESPONSIVE UPGRADE & DRAWER MENU --- */
.mobile-topbar {
    display: none;
    height: 60px;
    background-color: var(--bg-card);
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 950;
    box-shadow: var(--shadow-sm);
}

.mobile-logo {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: var(--brand-primary);
    font-size: 18px;
    letter-spacing: -0.5px;
}

.hamburger-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger-btn svg {
    width: 24px;
    height: 24px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 998;
    animation: fadeIn 0.2s ease;
}

@media (max-width: 768px) {
    .mobile-topbar {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        padding: 80px 20px 20px 20px; /* 60px topbar height + 20px content spacing */
    }
    
    .stat-card-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card-grid > .panel-card {
        grid-column: span 1 !important;
    }
    
    .auth-card {
        width: 100%;
        max-width: 420px;
        padding: 24px 20px;
    }
    
    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
    
    /* Onboarding Responsive Styling */
    .onboarding-card {
        padding: 30px 16px;
    }
    
    .onboarding-steps-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .onboarding-form-wrapper {
        padding: 20px;
    }
    
    .onboarding-form-wrapper form {
        flex-direction: column;
        gap: 12px;
    }
    
    .onboarding-form-wrapper button {
        padding: 12px 28px;
        width: 100%;
    }
    
    .refine-comparison-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .refine-comparison-grid textarea {
        height: 140px;
    }
}

/* --- TOGGLE SWITCH STYLING --- */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.switch-toggle input:checked + .switch-slider {
  background-color: var(--brand-primary);
}

.switch-toggle input:focus + .switch-slider {
  box-shadow: 0 0 1px var(--brand-primary);
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(22px);
}

/* --- PREMIUM CUSTOM MODAL POPUPS --- */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.18);
    width: 90%;
    max-width: 420px;
    padding: 24px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

.custom-modal-overlay.active .custom-modal-container {
    transform: scale(1);
}

.custom-modal-header {
    margin-bottom: 16px;
}

.custom-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.custom-modal-body {
    margin-bottom: 24px;
    font-size: 14.5px;
    color: #475569;
    line-height: 1.5;
}

.custom-modal-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 14px;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    margin-top: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-modal-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.custom-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* --- QUICK PICK FIELD CHIPS --- */
.quick-pick-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12.5px;
    user-select: none;
}

.quick-pick-chip:hover {
    border-color: var(--brand-primary);
    background: #f8f7ff;
}

.quick-pick-chip.active {
    border-color: var(--brand-primary);
    background: var(--brand-light);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.quick-pick-chip .qp-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.quick-pick-chip .qp-label {
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-pick-chip.active .qp-label {
    color: var(--brand-primary);
    font-weight: 600;
}

/* --- SHARE & EMBED PREMIUM STYLING --- */
.share-embed-card {
    padding: 32px !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid #f1f5f9 !important;
}

.share-embed-card-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0f172a;
    margin-bottom: 24px !important;
}

.deploy-card-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deploy-card-section .section-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.deploy-card-section .section-icon {
    font-size: 18px;
    padding: 8px;
    background: #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    flex-shrink: 0;
}

.deploy-card-section .section-header-text h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.deploy-card-section .section-header-text p {
    margin: 0;
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.5;
}

/* Link and Code Display Groups */
.link-display-group,
.embed-display-group {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.link-display-group:focus-within,
.embed-display-group:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.link-url-box {
    flex: 1;
    overflow-x: auto;
    font-family: monospace;
    font-size: 13.5px;
    font-weight: 600;
    padding: 4px 0;
}

.link-url-box a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.15s;
}

.link-url-box a:hover {
    color: #3730a3;
    text-decoration: underline;
}

/* Copy Buttons */
.btn-copy {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s !important;
    white-space: nowrap !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    height: 38px !important;
}

.btn-copy:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* Customize Link Section */
.customize-link-wrapper {
    margin-top: 8px;
}

.btn-customize-toggle {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    font-size: 13px !important;
    color: var(--brand-primary) !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: color 0.15s;
    text-decoration: none !important;
}

.btn-customize-toggle:hover {
    color: #3730a3 !important;
    text-decoration: underline !important;
}

.customize-slug-panel {
    margin-top: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.customize-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.url-prefix {
    font-family: monospace;
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

.slug-input-field {
    flex: 1;
    font-size: 14px !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    font-family: monospace;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 38px !important;
    box-sizing: border-box !important;
}

.slug-input-field:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08) !important;
}

.btn-save-slug {
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15) !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-save-slug:hover {
    background: #4338ca !important;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25) !important;
}

.field-help-text {
    font-size: 12px;
    color: #64748b;
    margin: 8px 0 0 0;
    line-height: 1.5;
}

.section-separator {
    border: 0;
    border-top: 1px solid #f1f5f9;
    margin: 28px 0;
}

/* Embed Textarea Styling */
.embed-textarea {
    flex: 1;
    border: none;
    background: none;
    resize: none;
    font-family: monospace;
    font-size: 12.5px;
    color: #334155;
    outline: none;
    min-height: 48px;
    padding: 0;
    line-height: 1.5;
    overflow-y: auto;
}

/* Responsive / Mobile layout overrides */
@media (max-width: 768px) {
    .share-embed-card {
        padding: 20px !important;
    }
    
    .link-display-group {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 14px !important;
    }
    
    .link-url-box {
        width: 100% !important;
        overflow-x: auto !important;
        padding-bottom: 8px !important;
        border-bottom: 1px dashed #e2e8f0 !important;
        text-align: center !important;
    }
    
    .embed-display-group {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 14px !important;
    }
    
    .embed-textarea {
        min-height: 64px !important;
        border-bottom: 1px dashed #e2e8f0 !important;
        padding-bottom: 8px !important;
    }
    
    .btn-copy {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .customize-input-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    
    .url-prefix {
        font-size: 13px !important;
        color: #475569 !important;
        margin-bottom: -4px !important;
        text-align: left !important;
    }
    
    .btn-save-slug {
        width: 100% !important;
        justify-content: center !important;
    }
}
