/* ============================================================
   Nestor DNS — WooCommerce My Account Styles
   Version: 2.1.0
   فقط برای صفحه /my-account/dns-management/
   سایت هدر و sidebar خودش را دارد — این فقط محتوا است
============================================================ */

/* Reset برای جلوگیری از تداخل با استایل‌های WooCommerce/تم */
.ndns-account,
.ndns-account *,
.ndns-account *::before,
.ndns-account *::after {
    box-sizing: border-box;
}
.ndns-account p { margin-top: 0; }
.ndns-account h4,
.ndns-account h5 { margin: 0; }
.ndns-account a { text-decoration: none; }
.ndns-account button { font-family: inherit; cursor: pointer; }

.ndns-account {
    direction: rtl;
    font-family: inherit;
    max-width: 860px;
    padding: 4px 0;
}

/* ---- Alert پیام ذخیره ---- */
.ndns-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.ndns-alert--success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}
.ndns-alert--error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* ---- اطلاعیه ادمین ---- */
.ndns-notice {
    border: 1.5px solid #2fdf84;
    border-right: 5px solid #2fdf84;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f0fff8, #e6fff4);
    box-shadow: 0 2px 12px rgba(47,223,132,0.1);
}
.ndns-notice__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(47,223,132,0.08);
    border-bottom: 1px solid rgba(47,223,132,0.2);
}
.ndns-notice__icon {
    width: 30px; height: 30px;
    background: #2fdf84;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ndns-notice__title { font-weight: 700; color: #1a7a4a; font-size: 0.95rem; }
.ndns-notice__body  { padding: 14px 16px; }
.ndns-notice__text  { color: #1e4d35; font-size: 0.9rem; line-height: 1.8; margin: 0 0 12px; }
.ndns-notice__box {
    display: flex; gap: 8px;
    background: #fff;
    border: 1px solid rgba(47,223,132,0.4);
    border-radius: 7px;
    padding: 10px 12px;
    font-size: 0.875rem;
    color: #1e4d35;
    line-height: 1.7;
    margin-bottom: 14px;
}
.ndns-tg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg,#0088cc,#006fa8);
    color: #fff !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 28px;
    border-radius: 50px;
    box-shadow: 0 4px 14px rgba(0,136,204,0.3);
}
.ndns-tg-btn:hover { opacity: 0.9; text-decoration: none !important; }

/* ---- کارت اطلاعات سرویس ---- */
.ndns-info-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.ndns-info-card__row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.ndns-info-card__item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 150px;
}
.ndns-info-card__label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ndns-info-card__val {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ndns-info-card__val--warn { color: #dc2626; }
.ndns-ip-mono { font-family: 'Courier New', monospace; direction: ltr; }

.ndns-days-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.ndns-days-badge--warn {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.ndns-renew-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.875rem;
    color: #92400e;
}
.ndns-renew-bar__btn {
    display: inline-flex;
    align-items: center;
    background: #0f172a;
    color: #fff !important;
    text-decoration: none !important;
    padding: 7px 18px;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.15s;
}
.ndns-renew-bar__btn:hover { background: #1e293b; }

/* ---- بخش‌های عمومی (Section) ---- */
.ndns-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.ndns-section__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.975rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px;
}
.ndns-section__title svg { color: #2fdf84; flex-shrink: 0; }

/* ---- لیست DNS ---- */
.ndns-dns-list { display: flex; flex-direction: column; gap: 8px; }
.ndns-dns-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    padding: 10px 14px;
    transition: border-color 0.15s;
}
.ndns-dns-row:hover { border-color: #86efac; }
.ndns-dns-row__info { display: flex; flex-direction: column; gap: 2px; }
.ndns-dns-row__label { font-size: 0.7rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; }
.ndns-dns-row__ip { font-family: 'Courier New', monospace; font-size: 1rem; font-weight: 700; color: #1e293b; direction: ltr; }
.ndns-dns-hint { font-size: 0.8rem; color: #64748b; margin: 10px 0 0; }

/* ---- هشدار VPN ---- */
.ndns-vpn-hint {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-right: 4px solid #f59e0b;
    border-radius: 7px;
    padding: 11px 14px;
    font-size: 0.875rem;
    color: #78350f;
    margin-bottom: 16px;
    line-height: 1.6;
}
.ndns-vpn-hint svg { color: #f59e0b; flex-shrink: 0; margin-top: 2px; }

/* ---- فرم IP ---- */
.ndns-form-group { margin-bottom: 14px; }
.ndns-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.ndns-input-row { display: flex; gap: 8px; align-items: center; }
.ndns-input {
    flex: 1;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    padding: 10px 14px;
    font-size: 0.975rem;
    font-family: 'Courier New', monospace;
    color: #1e293b;
    direction: ltr;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.ndns-input:focus {
    border-color: #2fdf84;
    box-shadow: 0 0 0 3px rgba(47,223,132,0.15);
}
.ndns-form-hint { font-size: 0.775rem; color: #94a3b8; margin: 5px 0 0; }

.ndns-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.ndns-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-decoration: none;
}
.ndns-btn--primary {
    background: #2fdf84;
    color: #fff;
    box-shadow: 0 2px 8px rgba(47,223,132,0.3);
}
.ndns-btn--primary:hover { background: #22c55e; }
.ndns-btn--secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.ndns-btn--secondary:hover { background: #e2e8f0; }
.ndns-btn:disabled { opacity: 0.6; pointer-events: none; }

.ndns-detect-msg {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-weight: 600;
}
.ndns-detect-msg--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.ndns-detect-msg--error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecada; }
.ndns-detect-msg--info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---- Collapsible ---- */
.ndns-collapsible { padding: 0; }
.ndns-collapsible__btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.975rem;
    font-weight: 700;
    color: #1e293b;
}
.ndns-collapsible__btn:hover { background: #f8fafc; border-radius: 10px 10px 0 0; }
.ndns-collapsible__title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ndns-collapsible__title svg { color: #2fdf84; }
.ndns-collapsible__arrow { transition: transform 0.2s; color: #94a3b8; flex-shrink: 0; }
.ndns-collapsible__body { padding: 0 20px 18px; border-top: 1px solid #f1f5f9; }

/* ---- آموزش‌ها ---- */
.ndns-tutorials { display: flex; flex-direction: column; gap: 16px; padding-top: 14px; }
.ndns-tutorial-item__title { font-size: 0.9rem; font-weight: 700; color: #1e293b; margin: 0 0 6px; }
.ndns-tutorial-item__desc  { font-size: 0.8rem; color: #64748b; margin: 0 0 10px; }
.ndns-video-wrap {
    position: relative;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
}
.ndns-video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---- FAQ ---- */
.ndns-faq { margin-top: 16px; padding-top: 14px; border-top: 1px solid #f1f5f9; }
.ndns-faq__title { font-size: 0.875rem; font-weight: 700; color: #475569; margin: 0 0 10px; }
.ndns-faq__item { margin-bottom: 10px; }
.ndns-faq__item strong { font-size: 0.85rem; color: #1e293b; display: block; margin-bottom: 3px; }
.ndns-faq__item p { font-size: 0.8rem; color: #64748b; margin: 0; line-height: 1.6; }

/* ---- گرید بازی‌ها ---- */
.ndns-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    padding-top: 14px;
}
.ndns-game-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
}
.ndns-game-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(47,223,132,0.15);
    border-color: #86efac;
}
.ndns-game-item__icon {
    width: 52px; height: 52px;
    border-radius: 10px;
    overflow: hidden;
}
.ndns-game-item__icon img { width: 100%; height: 100%; object-fit: cover; }
.ndns-game-item__icon--fallback {
    background: linear-gradient(135deg, #2fdf84, #1e8e3e);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.ndns-game-item__icon--fallback i { font-size: 22px; }
.ndns-game-item__name {
    font-size: 0.7rem;
    font-weight: 700;
    color: #374151;
    text-align: center;
    line-height: 1.3;
}

/* ---- منوی My Account — آیکون DNS ---- */
.woocommerce-MyAccount-navigation-link--dns-management a::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    vertical-align: middle;
}

/* ---- موبایل ---- */
@media (max-width: 600px) {
    .ndns-info-card__row { flex-direction: column; gap: 12px; }
    .ndns-info-card__item { min-width: unset; }
    .ndns-form-actions { flex-direction: column; }
    .ndns-btn { width: 100%; justify-content: center; }
    .ndns-dns-row__ip { font-size: 0.875rem; }
    .ndns-games-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
}
