/* ═══════════════════════════════════════════════════════
   Rapide DNS - User Panel Styles
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    --rdns-primary:    #6366f1;
    --rdns-primary-d:  #4f46e5;
    --rdns-success:    #22c55e;
    --rdns-warning:    #f59e0b;
    --rdns-danger:     #ef4444;
    --rdns-bg:         #f8fafc;
    --rdns-card:       #ffffff;
    --rdns-border:     #e2e8f0;
    --rdns-text:       #1e293b;
    --rdns-muted:      #64748b;
    --rdns-radius:     14px;
    --rdns-shadow:     0 4px 24px rgba(0,0,0,.07);
}

.rdns-panel * { box-sizing: border-box; margin: 0; padding: 0; }
.rdns-panel {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl; color: var(--rdns-text);
    background: var(--rdns-bg); padding: 28px;
    border-radius: var(--rdns-radius);
    max-width: 1400px; margin: 0 auto;
}

/* ─── Login Prompt ─── */
.rdns-login-prompt {
    text-align: center; padding: 60px 20px;
    background: #fff; border-radius: var(--rdns-radius);
    box-shadow: var(--rdns-shadow);
}
.rdns-login-icon { font-size: 48px; margin-bottom: 16px; }
.rdns-login-prompt h3 { font-size: 20px; margin-bottom: 8px; }
.rdns-login-prompt p { color: var(--rdns-muted); margin-bottom: 20px; }

/* ─── Payment Toast ─── */
.rdns-payment-toast {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 16px 18px; border-radius: 12px; margin-bottom: 16px;
    position: relative; animation: rdnsSlideIn .4s ease;
}
.rdns-toast-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.rdns-toast-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.rdns-toast-icon    { font-size: 24px; flex-shrink: 0; }
.rdns-toast-close   {
    position: absolute; top: 10px; left: 12px;
    background: none; border: none; font-size: 20px;
    cursor: pointer; color: inherit; opacity: .6;
}
.rdns-toast-close:hover { opacity: 1; }

/* ─── Notices ─── */
.rdns-notices { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.rdns-notice {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; border-radius: 10px; position: relative;
    animation: rdnsSlideIn .3s ease;
}
.rdns-notice-info    { background: #eff6ff; border-right: 4px solid #3b82f6; color: #1e40af; }
.rdns-notice-warning { background: #fffbeb; border-right: 4px solid #f59e0b; color: #92400e; }
.rdns-notice-success { background: #f0fdf4; border-right: 4px solid #22c55e; color: #166534; }
.rdns-notice-danger  { background: #fef2f2; border-right: 4px solid #ef4444; color: #991b1b; }
.rdns-notice-icon    { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.rdns-notice-body strong { display: block; font-size: 14px; margin-bottom: 4px; }
.rdns-notice-body p  { font-size: 13px; opacity: .85; }
.rdns-notice-close   {
    position: absolute; top: 10px; left: 12px;
    background: none; border: none; font-size: 18px;
    cursor: pointer; color: inherit; opacity: .5;
}
.rdns-notice-close:hover { opacity: 1; }

/* ─── Header ─── */
.rdns-header {
    position: relative; border-radius: var(--rdns-radius);
    overflow: hidden; margin-bottom: 20px;
    box-shadow: var(--rdns-shadow);
}
.rdns-header-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
}
.rdns-header-content {
    position: relative; display: flex; align-items: center;
    gap: 16px; padding: 24px 28px; flex-wrap: wrap;
}
.rdns-avatar-img { border-radius: 50%; border: 3px solid rgba(255,255,255,.4); }
.rdns-welcome { font-size: 20px; font-weight: 700; color: #fff; }
.rdns-email   { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 4px; }
.rdns-sub-badge {
    margin-right: auto; padding: 8px 16px; border-radius: 20px;
    font-size: 13px; font-weight: 600;
}
.rdns-sub-badge.active   { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.rdns-sub-badge.inactive { background: rgba(0,0,0,.2); color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.1); }

/* ─── Main Grid ─── */
.rdns-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px; margin-bottom: 20px;
}
@media (max-width: 700px) { .rdns-grid { grid-template-columns: 1fr; } }

/* ─── Cards ─── */
.rdns-card {
    background: var(--rdns-card); border-radius: var(--rdns-radius);
    box-shadow: var(--rdns-shadow); overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.rdns-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,.1); }
.rdns-card-inactive { opacity: .7; }
.rdns-card-locked   { position: relative; }
.rdns-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 18px; border-bottom: 1px solid var(--rdns-border);
    background: #fafbfc;
}
.rdns-card-icon { font-size: 20px; }
.rdns-card-header h3 { font-size: 15px; font-weight: 600; flex: 1; }
.rdns-lock-badge {
    font-size: 11px; background: #fef3c7; color: #92400e;
    padding: 3px 8px; border-radius: 10px; font-weight: 600;
}
.rdns-card-body { padding: 18px; }

/* ─── Countdown ─── */
.rdns-countdown {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-bottom: 16px;
}
.rdns-countdown-item { text-align: center; }
.rdns-countdown-num {
    display: block; font-size: 36px; font-weight: 800;
    color: var(--rdns-primary); line-height: 1;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.rdns-countdown-label { font-size: 11px; color: var(--rdns-muted); margin-top: 4px; }
.rdns-countdown-sep { font-size: 28px; font-weight: 700; color: var(--rdns-primary); opacity: .4; margin-bottom: 14px; }

/* ─── Progress Bar ─── */
.rdns-sub-progress {
    height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden;
}
.rdns-progress-bar {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    transition: width .5s ease;
}

/* ─── No Sub ─── */
.rdns-no-sub { text-align: center; padding: 10px 0; }
.rdns-no-sub-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.rdns-no-sub p { color: var(--rdns-muted); font-size: 14px; margin-bottom: 12px; }

/* ─── IP Section ─── */
.rdns-current-ip {
    display: flex; align-items: center; gap: 8px;
    background: #f0fdf4; border: 1px solid #bbf7d0;
    padding: 10px 14px; border-radius: 8px; margin-bottom: 14px;
}
.rdns-ip-label { font-size: 12px; color: #166534; font-weight: 600; }
.rdns-ip-code  { font-size: 14px; font-weight: 700; color: #166534; direction: ltr; }
.rdns-ip-detect { margin-bottom: 14px; }
.rdns-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.rdns-ip-input-wrap { display: flex; gap: 8px; }
.rdns-hint { font-size: 12px; color: var(--rdns-muted); margin-top: 6px; }

/* ─── Inputs ─── */
.rdns-input {
    flex: 1; padding: 10px 14px; border: 1.5px solid var(--rdns-border);
    border-radius: 8px; font-size: 14px; font-family: inherit;
    color: var(--rdns-text); background: #fff; transition: border-color .2s;
    direction: ltr; text-align: left;
}
.rdns-input:focus { outline: none; border-color: var(--rdns-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.rdns-input:disabled { background: #f8fafc; cursor: not-allowed; opacity: .6; }

/* ─── Buttons ─── */
.rdns-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 8px; font-size: 14px;
    font-weight: 600; font-family: inherit; cursor: pointer;
    border: none; text-decoration: none; transition: all .2s;
}
.rdns-btn:disabled { opacity: .5; cursor: not-allowed; }
.rdns-btn-primary  { background: var(--rdns-primary); color: #fff; }
.rdns-btn-primary:hover:not(:disabled) { background: var(--rdns-primary-d); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.3); }
.rdns-btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid var(--rdns-border); }
.rdns-btn-secondary:hover { background: #e2e8f0; }
.rdns-btn-ghost { background: transparent; color: var(--rdns-primary); border: 1.5px solid var(--rdns-primary); }
.rdns-btn-ghost:hover:not(:disabled) { background: var(--rdns-primary); color: #fff; }
.rdns-btn-telegram { background: #0088cc; color: #fff; }
.rdns-btn-telegram:hover { background: #0077b5; color: #fff; }
.rdns-btn-full { width: 100%; }
.rdns-btn-sm   { padding: 7px 12px; font-size: 12px; }
.rdns-btn-icon { font-size: 16px; }

/* ─── Result Message ─── */
.rdns-result {
    margin-top: 12px; padding: 10px 14px; border-radius: 8px;
    font-size: 13px; font-weight: 500;
}
.rdns-result.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.rdns-result.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ─── Sections ─── */
.rdns-section {
    background: var(--rdns-card); border-radius: var(--rdns-radius);
    box-shadow: var(--rdns-shadow); margin-bottom: 20px; overflow: hidden;
    position: relative;
}
.rdns-section-header {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px; border-bottom: 1px solid var(--rdns-border);
    background: #fafbfc;
}
.rdns-section-icon { font-size: 20px; }
.rdns-section-header h3 { font-size: 16px; font-weight: 700; flex: 1; }

/* ─── DNS Grid ─── */
.rdns-dns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    padding: 20px;
}
.rdns-dns-card {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    transition: transform .25s, box-shadow .25s;
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
}
.rdns-dns-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0,0,0,.13);
}

/* بالای کارت - رنگی */
.rdns-dns-card-top {
    padding: 20px 18px 18px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.rdns-dns-card-top::after {
    content: '';
    position: absolute;
    bottom: -20px; right: -20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
}
.rdns-dns-card-top::before {
    content: '';
    position: absolute;
    top: -15px; left: -15px;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.rdns-dns-card-icon {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
    position: relative;
    z-index: 1;
}
.rdns-dns-card-name {
    font-size: 17px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}
.rdns-dns-card-desc {
    font-size: 12px;
    opacity: .8;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

/* بدنه کارت */
.rdns-dns-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rdns-dns-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px 12px;
}
.rdns-dns-entry-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}
.rdns-dns-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rdns-dns-entry-val {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
}
.rdns-dns-ip {
    font-size: 15px;
    font-weight: 800;
    direction: ltr;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0;
    letter-spacing: .5px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.rdns-dns-hidden {
    -webkit-text-fill-color: #94a3b8;
    background: none;
    color: #94a3b8;
    letter-spacing: 2px;
    font-weight: 700;
}
.rdns-copy-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.rdns-copy-pill:hover {
    background: var(--rdns-primary);
    border-color: var(--rdns-primary);
    color: #fff;
}
.rdns-copy-icon { font-size: 12px; }
.rdns-copy-text { font-size: 11px; }

/* ─── Blur Overlay ─── */
.rdns-blurred { filter: blur(5px); pointer-events: none; user-select: none; }
.rdns-blur-overlay {
    position: absolute; inset: 0; display: flex;
    align-items: center; justify-content: center;
    background: rgba(248,250,252,.7); backdrop-filter: blur(2px);
    z-index: 10;
}
.rdns-blur-msg { text-align: center; padding: 30px; }
.rdns-blur-msg span { font-size: 36px; display: block; margin-bottom: 12px; }
.rdns-blur-msg p { font-size: 15px; color: var(--rdns-text); margin-bottom: 16px; font-weight: 600; }

/* ─── Plans Grid ─── */
.rdns-plans-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px; padding: 20px;
}
.rdns-plan-card {
    border: 2px solid var(--rdns-border); border-radius: 14px;
    overflow: hidden; position: relative; transition: all .3s;
    background: #fff;
}
.rdns-plan-card:hover { border-color: var(--rdns-primary); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(99,102,241,.15); }
.rdns-plan-featured { border-color: var(--rdns-primary); box-shadow: 0 8px 24px rgba(99,102,241,.2); }
.rdns-plan-badge {
    position: absolute; top: 12px; left: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff; font-size: 11px; font-weight: 700;
    padding: 4px 10px; border-radius: 20px;
}
.rdns-plan-header {
    padding: 24px 20px; text-align: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}
.rdns-plan-featured .rdns-plan-header { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.rdns-plan-name   { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.rdns-plan-price  { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin-bottom: 6px; }
.rdns-plan-amount { font-size: 28px; font-weight: 800; }
.rdns-plan-currency { font-size: 14px; opacity: .8; }
.rdns-plan-days   { font-size: 13px; opacity: .8; background: rgba(255,255,255,.15); display: inline-block; padding: 3px 12px; border-radius: 20px; }
.rdns-plan-body   { padding: 16px 20px; }
.rdns-plan-desc   { font-size: 13px; color: var(--rdns-muted); margin-bottom: 12px; }
.rdns-plan-features { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.rdns-plan-features li { font-size: 13px; color: #374151; }
.rdns-plan-footer { padding: 0 20px 20px; }

/* ─── Orders Table ─── */
.rdns-orders-table-wrap { padding: 16px; overflow-x: auto; }
.rdns-orders-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rdns-orders-table th {
    background: #f1f5f9; padding: 10px 12px; text-align: right;
    font-weight: 600; color: #475569; border-bottom: 2px solid var(--rdns-border);
    white-space: nowrap;
}
.rdns-orders-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.rdns-orders-table tr:hover td { background: #f8fafc; }
.rdns-orders-table code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 11px; direction: ltr; display: inline-block; }

/* ─── Badges ─── */
.rdns-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.rdns-badge-success { background: #dcfce7; color: #166534; }
.rdns-badge-warning { background: #fef9c3; color: #854d0e; }
.rdns-badge-danger  { background: #fee2e2; color: #991b1b; }
.rdns-badge-info    { background: #dbeafe; color: #1e40af; }

/* ─── Support ─── */
.rdns-support-section { background: linear-gradient(135deg, #0088cc10, #0088cc05); }
.rdns-support-card {
    display: flex; align-items: center; gap: 20px;
    padding: 24px; flex-wrap: wrap;
}
.rdns-support-icon { font-size: 40px; flex-shrink: 0; }
.rdns-support-info { flex: 1; }
.rdns-support-info h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.rdns-support-info p  { font-size: 13px; color: var(--rdns-muted); }

/* ─── Modal ─── */
.rdns-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.rdns-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); }
.rdns-modal-box {
    position: relative; background: #fff; border-radius: 16px;
    width: 90%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: rdnsModalIn .3s ease;
}
.rdns-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--rdns-border);
}
.rdns-modal-header h3 { font-size: 16px; font-weight: 700; }
.rdns-modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--rdns-muted); }
.rdns-modal-body  { padding: 20px; font-size: 14px; line-height: 1.7; }
.rdns-modal-hint  { font-size: 12px; color: var(--rdns-muted); margin-top: 8px; }
.rdns-modal-footer { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--rdns-border); justify-content: flex-end; }

/* ─── Loading Overlay ─── */
.rdns-loading-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(255,255,255,.9); backdrop-filter: blur(4px);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.rdns-spinner {
    width: 48px; height: 48px; border: 4px solid #e2e8f0;
    border-top-color: var(--rdns-primary); border-radius: 50%;
    animation: rdnsSpin 1s linear infinite;
}
.rdns-loading-overlay p { font-size: 15px; color: var(--rdns-muted); font-weight: 500; }

/* ─── Empty ─── */
.rdns-empty { text-align: center; color: var(--rdns-muted); padding: 30px; font-size: 14px; }

/* ─── Animations ─── */
@keyframes rdnsSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes rdnsModalIn {
    from { opacity: 0; transform: scale(.9); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes rdnsSpin {
    to { transform: rotate(360deg); }
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    .rdns-panel { padding: 12px; }
    .rdns-header-content { padding: 16px; }
    .rdns-welcome { font-size: 16px; }
    .rdns-countdown-num { font-size: 28px; }
    .rdns-plans-grid { grid-template-columns: 1fr; }
    .rdns-dns-grid { grid-template-columns: 1fr; }
    .rdns-support-card { flex-direction: column; text-align: center; }
    .rdns-sub-badge { margin-right: 0; }
}
