/**
 * Campaignity V2 - Beautiful Settings Styles
 * Enhanced, cute, and modern settings page design
 */

.content .settings {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    padding: 32px 36px 48px;
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
    overflow: hidden;
    box-sizing: border-box;
}

/* ─── Enhanced Navigation ─── */
.st-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 216px;
    flex-shrink: 0;
    padding: 8px;
    position: sticky;
    top: 24px;
    background: var(--surface-0);
    border: 1px solid var(--border-colors);
    border-radius: 18px;
}

.st-nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    border-radius: 11px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s var(--hover-transition), color 0.2s var(--hover-transition);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
}

.st-nav-link:hover {
    background: var(--surface-1);
    color: var(--text-primary);
    transform: none;
}

.st-nav-link.active {
    position: relative;
    background: rgba(249, 115, 22, 0.1);
    color: var(--campaignity-orange);
    border-color: rgba(249, 115, 22, 0.16);
    font-weight: 600;
}

.st-nav-link.active::before {
    content: '';
    width: 3px;
    height: 18px;
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 0 3px 3px 0;
    background: var(--campaignity-orange);
}

.st-nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* ─── Main Content Area ─── */
.st-main {
    flex: 1;
    align-self: flex-start;
    min-width: 0;
    min-height: 0;
    height: 100%;
    margin-top: 0;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

.st-section {
    display: none;
    animation: fadeInUp 0.4s var(--hover-transition);
}

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

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

/* ─── Beautiful Cards ─── */
.st-rows-card {
    background: var(--surface-0);
    border-radius: 18px;
    border: 1px solid var(--border-colors);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    padding: 8px 24px;
}

/* ─── Enhanced Rows ─── */
.st-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-colors);
}

.st-row:last-child{
    border-bottom: none;
}
.logout i{
    width: 20px;
    height: 20px;
}
.st-row-label {
    flex: 1;
    min-width: 0;
}

.st-row-label span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.st-row-label small {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.st-row-control {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* ─── Beautiful Inputs ─── */
.st-row-control input[type="text"],
.st-row-control input[type="email"],
.st-row-control input[type="number"],
.st-row-control select {
    padding: 11px 13px;
    border: 1px solid var(--border-colors);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface-1);
    transition: all 0.2s var(--hover-transition);
    min-width: 200px;
}

.st-row-control input:focus,
.st-row-control select:focus {
    outline: none;
    border-color: var(--campaignity-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    background: var(--surface-0);
}

/* ─── Enhanced Toggles ─── */
.st-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

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

.st-toggle-track {
    position: absolute;
    inset: 0;
    background: var(--surface-2);
    border-radius: 28px;
    transition: all 0.3s var(--bounce-transition);
    border: 2px solid var(--border-colors);
}

.st-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s var(--bounce-transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.st-toggle input:checked + .st-toggle-track {
    background: var(--campaignity-orange);
    border-color: transparent;
}

.st-toggle input:checked + .st-toggle-track .st-toggle-thumb {
    transform: translateX(24px);
}

/* ─── Beautiful Buttons ─── */
.st-btn-primary {
    padding: 11px 20px;
    background: var(--campaignity-orange);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s var(--bounce-transition);
    box-shadow: none;
}

.st-btn-primary:hover {
    transform: none;
    background: var(--campaignity-orange-dark);
    box-shadow: none;
}

.st-btn-primary:active {
    transform: translateY(0);
}

.st-btn-outline {
    padding: 11px 20px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-colors);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s var(--hover-transition);
}

.st-btn-outline:hover {
    border-color: var(--campaignity-orange);
    color: white !important;
    background: rgba(249, 115, 22, 0.05);
}

.st-btn-ghost {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s var(--hover-transition);
}

.st-btn-ghost:hover {
    background: var(--surface-1);
    color: var(--text-primary);
}

.st-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s var(--hover-transition);
    text-decoration: none;
}

.st-link-btn:hover {
    transform: translateX(4px);
    background-color: var(--surface-0);
}

.st-link-btn.danger {
    color: var(--critical);
    /* padding: 5px; */
}

.st-link-btn.danger:hover {
    color: var(--critical) !important;
    /* background: rgba(239, 68, 68, 0.1); */
}

/* ─── Enhanced Status Indicators ─── */
.st-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--idle);
    display: inline-block;
    margin-right: 8px;
}

.st-status-dot.on {
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.st-channel-status {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--surface-1);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ─── Beautiful Alert Type Buttons ─── */
.st-alert-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.st-alert-type {
    padding: 8px 16px;
    background: var(--surface-1);
    border: 2px solid var(--border-colors);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s var(--hover-transition);
}

.st-alert-type:hover {
    border-color: var(--campaignity-orange);
    color: var(--text-primary);
}

.st-alert-type.active {
    background: rgba(249, 115, 22, 0.1);
    border-color: var(--campaignity-orange);
    color: var(--campaignity-orange);
}

/* ─── Enhanced Time Inputs ─── */
.st-time-pair {
    display: flex;
    align-items: center;
    gap: 12px;
}

.st-time-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.st-time-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.st-time-field input {
    padding: 8px 12px;
    border: 2px solid var(--border-colors);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--surface-1);
}

.st-time-sep {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ─── Beautiful Theme Picker ─── */
.st-theme-picker {
    display: flex;
    gap: 7px;
}

.st-theme-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    background: var(--surface-1);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    color: #44445A;
    font-family: inherit;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    min-width: 72px;
}

.content .settings .st-theme-opt:hover { 
    border-color: rgba(255,255,255,0.2); 
    color: #A0A0C0; 
}

.content .settings .st-theme-opt.active {
    border-color: #F97316;
    color: #F97316;
    background: rgba(249,115,22,0.08);
}

/* Swatch preview */
.content .settings .st-theme-swatch {
    width: 48px;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid rgba(255,255,255,0.1);
}

.content .settings .st-theme-swatch span { display: block; }

/* Dark swatch */
.content .settings .st-theme-swatch--dark span:nth-child(1) { background: #0A0A0A; }
.content .settings .st-theme-swatch--dark span:nth-child(2) { background: #1A1A1A; }

/* Light swatch */
.content .settings .st-theme-swatch--light span:nth-child(1) { background: #F8F9FC; }
.content .settings .st-theme-swatch--light span:nth-child(2) { background: #FFFFFF; }

/* System swatch - split diagonal */
.content .settings .st-theme-swatch--system {
    position: relative;
    grid-template-columns: 1fr;
    background: linear-gradient(135deg, #0A0A0A 50%, #F8F9FC 50%);
}
.content .settings .st-theme-swatch--system span { display: none; }

/* Light mode theme picker overrides */
body.theme-light .content .settings .st-theme-opt { 
    border-color: rgba(0,0,0,0.1) !important; 
    color: #667085 !important; 
}
body.theme-light .content .settings .st-theme-opt:hover { 
    border-color: rgba(0,0,0,0.2) !important; 
    color: #344054 !important; 
}
body.theme-light .content .settings .st-theme-opt.active { 
    border-color: #F97316 !important; 
    color: #F97316 !important; 
    background: rgba(249,115,22,0.07) !important; 
}
body.theme-light .content .settings .st-theme-swatch { 
    border-color: rgba(0,0,0,0.1) !important; 
}

/* ─── Enhanced Integration Cards ─── */
.st-int-row {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-colors);
}

.st-int-row:last-child {
    border-bottom: none;
}

.st-int-row .st-row-label {
    display: flex;
    align-items: center;
    gap: 16px;
}

.st-int-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-int-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.st-int-row .dets {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.st-coming-soon {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-1);
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

/* ─── Enhanced Plan Badge ─── */
.st-plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--campaignity-orange);
    color: white !important;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: none;
}

/* ─── Enhanced Modal ─── */
.st-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--highest-order);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--hover-transition);
}

.st-modal.show {
    opacity: 1;
    visibility: visible;
}

.st-modal-box {
    background: var(--surface-0);
    border-radius: 18px;
    border: 1px solid var(--border-colors);
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 90%;
    transform: scale(0.95);
    transition: transform 0.3s var(--bounce-transition);
}

.st-modal.show .st-modal-box {
    transform: scale(1);
}

.st-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-colors);
}

.st-modal-head h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Sora', sans-serif;
}

.st-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s var(--hover-transition);
}

.st-modal-close:hover {
    background: var(--surface-1);
    color: var(--text-primary);
}

.st-modal-body {
    padding: 24px;
}

.st-modal-field {
    margin-bottom: 16px;
}

.st-modal-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.st-modal-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-colors);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    background: var(--surface-1);
    transition: all 0.2s var(--hover-transition);
}

.st-modal-field input:focus {
    outline: none;
    border-color: var(--campaignity-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.st-webhook-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.st-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--border-colors);
}

/* ─── Separator ─── */
.st-sep {
    height: 1px;
    background: var(--border-colors);
    margin: 24px 0;
}

/* ─── Value Display ─── */
.st-val {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.st-val-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 8px;
}

/* ─── Feature List ─── */
.st-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.st-feature-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.st-feature-list li::before {
    content: '✓';
    color: #10B981;
    font-weight: 700;
}

/* ─── Special Row Types ─── */
.st-row-action {
    opacity: 0;
    pointer-events: none;
    position: fixed;
    left: 50%;
    bottom: 20px;
    z-index: 1000;
    width: min(1280px, calc(100vw - 40px));
    transform: translateX(-50%);
    box-sizing: border-box;
    background: var(--surface-0);
    border: 1px solid var(--border-colors);
    border-radius: 18px;
    margin: 0;
    padding: 8px 24px;
    box-shadow: var(--shadow-sm);
    transition: opacity 0.2s ease;
}
.st-row-action.is-visible{
    opacity: 1;
    pointer-events: all;
    animation: st-save-shake 0.45s ease;
}

@keyframes st-save-shake {
    0%, 100% { transform: translateX(-50%); }
    25% { transform: translateX(calc(-50% - 5px)); }
    50% { transform: translateX(calc(-50% + 5px)); }
    75% { transform: translateX(calc(-50% - 3px)); }
}
.st-row-action .st-row-control {
    gap: 12px;
}
.st-row-action .st-row-label {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    padding-left: 10px;
}
.content .settings .st-row-action .st-row-control {
    padding-right: 10px;
    justify-content: flex-end;
}

.st-row-link-row {
    background: transparent;
}

/* ─── Responsive Design ─── */
@media (max-width: 768px) {
    .settings {
        flex-direction: column;
        padding: 16px;
    }

    .st-nav {
        width: 100% !important;
        /* flex-direction: row; */
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .st-nav-link {
        white-space: nowrap;
        padding: 10px 16px;
    }

    /* .st-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    } */

    .st-row-control {
        width: 100%;
        justify-content: flex-start;
    }

    .st-row-control input,
    .st-row-control select {
        width: 100%;
        min-width: unset;
    }

    .st-rows-card {
        padding: 16px;
    }

    .st-row-action {
        width: calc(100vw - 24px);
        bottom: 12px;
        padding: 8px 16px;
    }
}