/* ========================================
   IQLink DNS — Domain List Page
   ======================================== */

/* (page header banner styled via theme's .iqh-page-tagline) */

/* Empty state */
.iqh-dnslist-empty {
    text-align: center;
    padding: 48px 20px;
}

.iqh-dnslist-empty i {
    font-size: 36px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.iqh-dnslist-empty p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 16px;
}

/* Table — inherits DataTables + theme table-list styling */
#tableDnsList > tbody > tr > td {
    vertical-align: middle;
}

/* Badges */
.iqh-dnslist-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.iqh-dnslist-badge i {
    font-size: 10px;
}

.iqh-dnslist-badge--iqlink {
    background: #dbeafe;
    color: #1d4ed8;
}

.iqh-dnslist-badge--hosting {
    background: #e0e7ff;
    color: #4338ca;
}

.iqh-dnslist-badge--none {
    background: #f1f5f9;
    color: #94a3b8;
}

.iqh-dnslist-badge--inactive {
    background: #fef2f2;
    color: #dc2626;
}

/* NS column */
.iqh-dnslist-ns {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* Status */
.iqh-dnslist-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.iqh-dnslist-status--ok {
    color: #16a34a;
}

.iqh-dnslist-status--warn {
    color: #d97706;
}

.iqh-dnslist-status--neutral {
    color: #94a3b8;
}

/* Actions */
.iqh-dnslist-actions {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

.iqh-dnslist-actions .btn {
    font-size: 12px;
    padding: 4px 10px;
}

/* Mobile cards (hidden on desktop) */
.iqh-dnslist-cards {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .iqh-dnslist-panel {
        border: none;
        box-shadow: none;
    }

    .iqh-dnslist-panel .table-responsive {
        display: none;
    }

    .iqh-dnslist-cards {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .iqh-dnslist-card {
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 6px;
        overflow: hidden;
    }

    .iqh-dnslist-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px;
        border-bottom: 1px solid #eee;
    }

    .iqh-dnslist-card-domain {
        font-size: 14px;
        color: #1b2a4a;
    }

    .iqh-dnslist-card-body {
        padding: 10px 14px;
    }

    .iqh-dnslist-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
    }

    .iqh-dnslist-card-label {
        font-size: 12px;
        color: #94a3b8;
    }

    .iqh-dnslist-card-footer {
        padding: 10px 14px;
        border-top: 1px solid #eee;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
}

/* ========================================
   Small Confirm Modal
   ======================================== */
.iqh-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease;
}

.iqh-modal-overlay.iqh-modal-visible {
    opacity: 1;
}

.iqh-modal {
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.92) translateY(10px);
    transition: transform .2s ease;
}

.iqh-modal-visible .iqh-modal {
    transform: scale(1) translateY(0);
}

.iqh-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 22px;
}

.iqh-modal-icon--activate {
    background: #dbeafe;
    color: #2563eb;
}

.iqh-modal-icon--ns {
    background: #fef3c7;
    color: #d97706;
}

.iqh-modal-icon--error {
    background: #fee2e2;
    color: #dc2626;
}

.iqh-modal-title {
    font-size: 17px;
    font-weight: 600;
    color: #1b2a4a;
    margin: 0 0 8px;
}

.iqh-modal-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 24px;
}

.iqh-modal-desc strong {
    color: #334155;
    font-family: monospace;
}

.iqh-modal-warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
    color: #92400e;
    text-align: left;
    line-height: 1.6;
    margin-bottom: 12px;
}

.iqh-modal-warning i {
    color: #d97706;
    margin-right: 4px;
}

.iqh-modal-warning strong {
    font-family: inherit;
    color: #92400e;
}

.iqh-modal-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.iqh-modal-btns .btn {
    min-width: 100px;
    font-size: 13px;
    padding: 8px 20px;
    border-radius: 6px;
}

/* ========================================
   DNS Editor Panel (large modal)
   ======================================== */
.iqh-dns-editor-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10600;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease;
}

.iqh-dns-editor-overlay.iqh-dns-editor-visible {
    opacity: 1;
}

.iqh-dns-editor-panel {
    background: #fff;
    border-radius: 12px;
    width: 92%;
    max-width: 1200px;
    height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(10px);
    transition: transform .2s ease;
    overflow: hidden;
}

.iqh-dns-editor-visible .iqh-dns-editor-panel {
    transform: scale(1) translateY(0);
}

.iqh-dns-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    flex-shrink: 0;
}

.iqh-dns-editor-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.iqh-dns-editor-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1b2a4a;
    margin: 0;
}

.iqh-dns-editor-header h3 i {
    color: #2563eb;
    margin-right: 8px;
}

.iqh-dns-editor-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

.iqh-dns-editor-close:hover {
    color: #1b2a4a;
}

/* ── Tab navigation ── */
.iqh-dns-editor-tabs {
    display: flex;
    padding: 0 24px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    gap: 0;
}

.iqh-dns-editor-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all .15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.iqh-dns-editor-tab:hover {
    color: #1b2a4a;
    background: #f8fafc;
}

.iqh-dns-editor-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.iqh-dns-editor-tab i {
    font-size: 12px;
}

.iqh-dns-editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.iqh-dns-editor-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* DNS Editor — Add form */
.iqh-dns-add-form {
    margin-bottom: 16px;
}

.iqh-dns-add-form .panel {
    margin-bottom: 0;
}

/* DNS Editor — Toast notifications */
.iqh-dns-toast {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: iqhDnsToastIn .2s ease;
}

.iqh-dns-toast-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.iqh-dns-toast-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

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

/* DNS Editor — Records table */
.iqh-dns-table {
    margin: 0;
}

.iqh-dns-content-cell {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
}

.iqh-dns-actions-cell {
    white-space: nowrap;
    text-align: right;
}

.iqh-dns-actions-cell .btn + .btn {
    margin-left: 4px;
}

.iqh-dns-row-protected {
    opacity: 0.5;
}

.iqh-dns-row-editing {
    background: #fefce8 !important;
}

.iqh-dns-row-editing .form-control {
    height: 30px;
    padding: 4px 8px;
    font-size: 13px;
}

/* ========================================
   DNS Templates (inside editor)
   ======================================== */
.iqh-tpl-header {
    margin-bottom: 20px;
}

.iqh-tpl-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1b2a4a;
    margin: 0 0 6px;
}

.iqh-tpl-header h4 i {
    color: #8b5cf6;
    margin-right: 8px;
}

/* Template cards grid */
.iqh-tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.iqh-tpl-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
}

.iqh-tpl-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.iqh-tpl-card-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 48px;
    text-align: center;
}

.iqh-tpl-card-body {
    flex: 1;
    min-width: 0;
}

.iqh-tpl-card-body h5 {
    font-size: 14px;
    font-weight: 600;
    color: #1b2a4a;
    margin: 0 0 4px;
}

.iqh-tpl-card-body p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.iqh-tpl-card .iqh-tpl-apply-btn {
    flex-shrink: 0;
}
/* Active template indicator */.iqh-tpl-card--active:hover { border-left-color: #16a34a; }.iqh-tpl-card {
    position: relative;
    overflow: hidden;
}
.iqh-tpl-active-corner {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 28px;
    height: 28px;
    background: #22c55e;
    border-radius: 0 7px 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}
.iqh-tpl-card--active {
    border-left: 3px solid #22c55e;
}/* Template sections */
.iqh-tpl-section {
    margin-bottom: 24px;
}
.iqh-tpl-section:last-child {
    margin-bottom: 0;
}
.iqh-tpl-section-header {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    padding: 0 0 10px;
    margin-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
}
.iqh-tpl-section-header i {
    margin-right: 8px;
    color: #6366f1;
}

/* Template detail panel */
.iqh-tpl-detail {
    margin-top: 10px;
}

.iqh-tpl-detail .panel {
    margin-bottom: 0;
}

/* ========================================
   Email Wizard (inside editor)
   ======================================== */
.iqh-wiz-header {
    margin-bottom: 20px;
}

.iqh-wiz-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1b2a4a;
    margin: 0 0 6px;
}

.iqh-wiz-header h4 i {
    color: #2563eb;
    margin-right: 8px;
}

/* Wizard preview panel - sticky on desktop */
.iqh-wiz-preview-panel {
    position: sticky;
    top: 0;
}

/* Wizard record preview items */
.iqh-wiz-record {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.iqh-wiz-record:last-child {
    border-bottom: none;
}

.iqh-wiz-record-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.iqh-wiz-record-value code {
    font-size: 12px;
    word-break: break-all;
    color: #334155;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
}

/* ========================================
   DNS Editor — responsive
   ======================================== */
@media (max-width: 768px) {
    .iqh-dns-editor-panel {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .iqh-dns-editor-header {
        padding: 14px 16px 10px;
    }

    .iqh-dns-editor-tabs {
        padding: 0 16px;
        overflow-x: auto;
    }

    .iqh-dns-editor-tab {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .iqh-dns-editor-content {
        padding: 14px 16px;
    }

    .iqh-dns-content-cell {
        max-width: 180px;
    }

    .iqh-tpl-grid {
        grid-template-columns: 1fr;
    }

    .iqh-tpl-card {
        flex-wrap: wrap;
    }

    .iqh-tpl-card .iqh-tpl-apply-btn {
        width: 100%;
    }
}

/* ========================================
   Dark mode
   ======================================== */
html[data-theme="dark"] .iqh-dnslist-header h2 {
    color: #e2e8f0;
}

html[data-theme="dark"] .iqh-dnslist-subtitle {
    color: #94a3b8;
}

html[data-theme="dark"] .iqh-dnslist-domain strong {
    color: #e2e8f0;
}

html[data-theme="dark"] .iqh-dnslist-badge--iqlink {
    background: #1e3a5f;
    color: #60a5fa;
}

html[data-theme="dark"] .iqh-dnslist-badge--hosting {
    background: #272555;
    color: #818cf8;
}

html[data-theme="dark"] .iqh-dnslist-badge--none {
    background: #1e2132;
    color: #64748b;
}

html[data-theme="dark"] .iqh-dnslist-badge--inactive {
    background: #2d1b1b;
    color: #f87171;
}

html[data-theme="dark"] .iqh-dnslist-ns {
    color: #94a3b8;
}

html[data-theme="dark"] .iqh-dnslist-status--ok {
    color: #4ade80;
}

html[data-theme="dark"] .iqh-dnslist-status--warn {
    color: #fbbf24;
}

html[data-theme="dark"] .iqh-dnslist-status--neutral {
    color: #64748b;
}

/* Dark mode — mobile cards */
html[data-theme="dark"] .iqh-dnslist-card {
    background: #1a1d2e;
    border-color: #2a2d3e;
}

html[data-theme="dark"] .iqh-dnslist-card-header {
    border-bottom-color: #222539;
}

html[data-theme="dark"] .iqh-dnslist-card-domain {
    color: #e2e8f0;
}

html[data-theme="dark"] .iqh-dnslist-card-label {
    color: #64748b;
}

html[data-theme="dark"] .iqh-dnslist-card-footer {
    border-top-color: #222539;
}

/* Dark mode — small modal */
html[data-theme="dark"] .iqh-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .iqh-modal {
    background: #1a1d2e;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .iqh-modal-title {
    color: #e2e8f0;
}

html[data-theme="dark"] .iqh-modal-desc {
    color: #94a3b8;
}

html[data-theme="dark"] .iqh-modal-desc strong {
    color: #cbd5e1;
}

html[data-theme="dark"] .iqh-modal-icon--activate {
    background: #1e3a5f;
    color: #60a5fa;
}

html[data-theme="dark"] .iqh-modal-icon--ns {
    background: #451a03;
    color: #fbbf24;
}

html[data-theme="dark"] .iqh-modal-warning {
    background: #451a03;
    border-color: #78350f;
    color: #fbbf24;
}

html[data-theme="dark"] .iqh-modal-warning strong {
    color: #fbbf24;
}

html[data-theme="dark"] .iqh-modal-icon--error {
    background: #450a0a;
    color: #f87171;
}

/* NS Warning Banner (in editor) */
.iqh-dns-editor-ns-warn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 13px;
    line-height: 1.6;
}

.iqh-dns-editor-ns-warn > i {
    color: #d97706;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

html[data-theme="dark"] .iqh-dns-editor-ns-warn {
    background: #451a03;
    border-color: #78350f;
    color: #fbbf24;
}

html[data-theme="dark"] .iqh-dns-editor-ns-warn > i {
    color: #fbbf24;
}

/* Dark mode — DNS Editor */
html[data-theme="dark"] .iqh-dns-editor-overlay {
    background: rgba(0, 0, 0, 0.65);
}

html[data-theme="dark"] .iqh-dns-editor-panel {
    background: #1a1d2e;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .iqh-dns-editor-header {
    border-bottom: none;
}

html[data-theme="dark"] .iqh-dns-editor-header h3 {
    color: #e2e8f0;
}

html[data-theme="dark"] .iqh-dns-editor-close {
    color: #64748b;
}

html[data-theme="dark"] .iqh-dns-editor-close:hover {
    color: #e2e8f0;
}

/* Dark mode — tabs */
html[data-theme="dark"] .iqh-dns-editor-tabs {
    border-bottom-color: #2a2d3e;
}

html[data-theme="dark"] .iqh-dns-editor-tab {
    color: #94a3b8;
}

html[data-theme="dark"] .iqh-dns-editor-tab:hover {
    color: #e2e8f0;
    background: #222539;
}

html[data-theme="dark"] .iqh-dns-editor-tab.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

html[data-theme="dark"] .iqh-dns-row-editing {
    background: #2a2500 !important;
}

html[data-theme="dark"] .iqh-dns-toast-success {
    background: #052e16;
    border-color: #166534;
    color: #4ade80;
}

html[data-theme="dark"] .iqh-dns-toast-error {
    background: #450a0a;
    border-color: #991b1b;
    color: #f87171;
}

html[data-theme="dark"] .iqh-dns-content-cell {
    color: #94a3b8;
}

/* Dark mode — template cards */
html[data-theme="dark"] .iqh-tpl-header h4 {
    color: #e2e8f0;
}

html[data-theme="dark"] .iqh-tpl-card {
    background: #222539;
    border-color: #2a2d3e;
}

html[data-theme="dark"] .iqh-tpl-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

html[data-theme="dark"] .iqh-tpl-card-body h5 {
    color: #e2e8f0;
}

html[data-theme="dark"] .iqh-tpl-card-body p {
    color: #94a3b8;
}
html[data-theme="dark"] .iqh-tpl-card--active { border-left-color: #22c55e; }html[data-theme="dark"] .iqh-tpl-card--active:hover { border-left-color: #16a34a; }html[data-theme="dark"] .iqh-tpl-active-corner { background: #16a34a; }html[data-theme="dark"] .iqh-tpl-section-header { color: #cbd5e1; border-bottom-color: #2a2d3e; }
html[data-theme="dark"] .iqh-tpl-section-header i { color: #818cf8; }

/* Dark mode — wizard */
html[data-theme="dark"] .iqh-wiz-header h4 {
    color: #e2e8f0;
}

html[data-theme="dark"] .iqh-wiz-record {
    border-bottom-color: #2a2d3e;
}

html[data-theme="dark"] .iqh-wiz-record-value code {
    background: #222539;
    color: #cbd5e1;
}
