/* ============================================================
   Daralmuheet Management — Frontend Styles
   ============================================================ */

/* ---- Plans Grid ---- */
.dm-plans-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    padding: 20px 0;
    direction: rtl;
}

.dm-plan-card {
    background: #ffffff;
    border: 2px solid #e8e8e8;
    border-radius: 16px;
    padding: 32px 28px;
    width: 280px;
    text-align: center;
    position: relative;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dm-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,103,108,.12);
}
.dm-plan-featured {
    border-color: #00676C;
    box-shadow: 0 4px 24px rgba(0,103,108,.18);
}

.dm-plan-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #00676C;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

.dm-plan-category { font-size: 13px; color: #00676C; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.dm-plan-name     { font-size: 26px; font-weight: 700; color: #1a1a1a; margin: 4px 0; }

.dm-plan-price { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.dm-plan-amount   { font-size: 48px; font-weight: 800; color: #00676C; }
.dm-plan-currency { font-size: 14px; color: #888; }

.dm-plan-features { list-style: none; padding: 0; margin: 12px 0; text-align: right; }
.dm-plan-features li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dm-plan-features li::before { content: '✓'; color: #00676C; font-weight: 700; }

.dm-plan-btn {
    display: block;
    margin-top: 16px;
    padding: 13px 20px;
    background: #f0f0f0;
    color: #333;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background .2s, color .2s;
}
.dm-plan-btn:hover           { background: #ddd; color: #111; }
.dm-plan-btn-featured        { background: #00676C; color: #fff; }
.dm-plan-btn-featured:hover  { background: #004f53; color: #fff; }

.dm-plan-subscribed {
    display: block;
    margin-top: 16px;
    padding: 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

/* ---- My Subscription ---- */
.dm-my-subscription { direction: rtl; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; max-width: 720px; }

.dm-sub-active-card {
    background: #fff;
    border: 2px solid #00676C;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 28px;
}
.dm-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}
.dm-sub-plan-name { font-size: 22px; font-weight: 700; color: #1a1a1a; margin-left: 10px; }
.dm-sub-price     { font-size: 18px; font-weight: 600; color: #00676C; }

.dm-sub-meta {
    display: flex;
    gap: 24px;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #555;
}

.dm-sub-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.dm-btn-cancel-own {
    background: none;
    border: 2px solid #e44;
    color: #e44;
    padding: 9px 20px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s, color .2s;
}
.dm-btn-cancel-own:hover { background: #e44; color: #fff; }

.dm-btn-upgrade, .dm-btn-subscribe {
    display: inline-block;
    background: #00676C;
    color: #fff;
    padding: 10px 22px;
    border-radius: 7px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s;
}
.dm-btn-upgrade:hover, .dm-btn-subscribe:hover { background: #004f53; color: #fff; }

.dm-no-sub {
    text-align: center;
    padding: 40px;
    background: #fafafa;
    border-radius: 12px;
    margin-bottom: 28px;
}
.dm-no-sub p { font-size: 16px; color: #666; margin-bottom: 16px; }

/* ---- Subscription History Table ---- */
.dm-sub-history h3 { color: #00676C; margin-bottom: 12px; }
.dm-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.dm-history-table th, .dm-history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    text-align: right;
}
.dm-history-table th { background: #f5f5f5; color: #555; font-weight: 600; }
.dm-history-table tr:last-child td { border-bottom: none; }

/* ---- Shared: badges ---- */
.dm-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.dm-badge-active    { background: #e8f5e9; color: #2e7d32; }
.dm-badge-pending   { background: #fff8e1; color: #f57f17; }
.dm-badge-cancelled { background: #fce4ec; color: #c62828; }
.dm-badge-expired   { background: #f5f5f5; color: #777; }

/* ---- Messages ---- */
.dm-msg { padding: 10px 14px; border-radius: 6px; font-weight: 600; margin-top: 10px; }
.dm-msg.success { background: #e8f5e9; color: #2e7d32; }
.dm-msg.error   { background: #fce4ec; color: #c62828; }

.dm-login-msg { padding: 20px; background: #f9f9f9; border-radius: 8px; text-align: center; }

/* ============================================================
   Header — Account Nav Dropdown
   ============================================================ */

.dm-nav-hidden { display: none !important; }

/* Hide sign-in / register nav items for logged-in users (class added server-side) */
.logged-in .dm-auth-nav-item { display: none !important; }

/* Hide the Elementor button widgets for sign-in (6f54a0b) and join-now (98714bd)
   when the user is already logged in */
body.logged-in .elementor-element-6f54a0b,
body.logged-in .elementor-element-98714bd { display: none !important; }

/* Also hide their shared wrapper container when logged in */
body.logged-in .elementor-element-5de1995 { display: none !important; }

.dm-nav-account-item {
    position: relative;
    list-style: none;
}

.dm-nav-acct-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.dm-nav-initial {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1C8187;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}

.dm-nav-acct-btn:hover .dm-nav-initial {
    background: #cc3366;
}

.dm-nav-chevron {
    font-size: 9px;
    color: #555;
}

.dm-nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 8px 0;
    z-index: 9999;
    direction: rtl;
    text-align: right;
}
.dm-nav-dropdown.dm-nav-dd-open { display: block; }

.dm-nav-dd-name {
    padding: 8px 16px 6px;
    font-size: 13px;
    font-weight: 700;
    color: #293E61;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}

.dm-nav-dropdown a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background .15s;
}
.dm-nav-dropdown a:hover { background: #f5f5f5; color: #1C8187; }

.dm-nav-dd-logout { color: #c0392b !important; margin-top: 4px; border-top: 1px solid #f0f0f0; }
.dm-nav-dd-logout:hover { background: #fff0f0 !important; color: #c0392b !important; }

/* ============================================================
   My Account Page
   ============================================================ */

/* Hide the theme's default page <h1> title on the account page — the hero already shows the user name */
.page-id-148 .entry-title,
.page-id-148 h1.page-title,
.page-id-148 .elementor-page-title { display: none !important; }

.dm-account-page {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Arial, sans-serif;
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 0 140px;
    color: #1a1a1a;
}

.dm-account-page[dir="rtl"] { direction: rtl; text-align: right; }
.dm-account-page[dir="ltr"] { direction: ltr; text-align: left; }

/* ── Hero ── */
.dm-acct-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, #1C8187 0%, #293E61 100%);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 32px;
    color: #fff;
    flex-wrap: wrap;
}

.dm-acct-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    border: 3px solid rgba(255,255,255,.5);
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.dm-acct-hero-info { flex: 1; min-width: 0; }

.dm-acct-name {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.dm-acct-email-txt {
    font-size: 14px;
    color: rgba(255,255,255,.8);
}

.dm-acct-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
    white-space: nowrap;
    margin-right: auto;
}
.dm-acct-logout-btn:hover {
    background: rgba(255,255,255,.25);
    color: #fff;
}

/* ── Tabs ── */
.dm-acct-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 28px;
}

.dm-acct-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    transition: color .2s, border-color .2s;
    white-space: nowrap;
}
.dm-acct-tab:hover         { color: #1C8187; }
.dm-acct-tab.active        { color: #1C8187; border-bottom-color: #1C8187; }
.dm-acct-tab svg           { opacity: .7; }
.dm-acct-tab.active svg    { opacity: 1; }

/* ── Panels ── */
.dm-acct-panel { display: none; }
.dm-acct-panel.active { display: block; }

/* ── Shared buttons ── */
.dm-acct-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s;
    white-space: nowrap;
}
.dm-acct-btn-primary {
    background: #1C8187;
    color: #fff;
}
.dm-acct-btn-primary:hover {
    background: #155f63;
    color: #fff;
}
.dm-acct-btn-outline {
    background: transparent;
    color: #293E61;
    border-color: #293E61;
}
.dm-acct-btn-outline:hover {
    background: #293E61;
    color: #fff;
}
.dm-acct-btn-danger {
    background: transparent;
    color: #c0392b;
    border-color: #c0392b;
}
.dm-acct-btn-danger:hover {
    background: #c0392b;
    color: #fff;
}

/* ── Subscription panel ── */
.dm-acct-sub-card {
    background: #fff;
    border: 2px solid #1C8187;
    border-radius: 14px;
    padding: 28px 32px;
}

.dm-acct-sub-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.dm-acct-sub-top-left { display: flex; align-items: center; gap: 10px; }

.dm-acct-sub-plan {
    font-size: 22px;
    font-weight: 700;
    color: #293E61;
    margin: 0;
}

.dm-acct-sub-price {
    font-size: 32px;
    font-weight: 800;
    color: #1C8187;
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.dm-acct-sub-currency { font-size: 14px; font-weight: 600; color: #1C8187; }
.dm-acct-sub-period   { font-size: 13px; font-weight: 400; color: #888; }

.dm-acct-sub-dates {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    background: #f7fbfb;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.dm-acct-date-chip {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dm-acct-date-lbl {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.dm-acct-date-val {
    font-size: 15px;
    font-weight: 700;
    color: #293E61;
}
.dm-acct-date-warn { color: #e67e22; }

.dm-acct-sub-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* No subscription state */
.dm-acct-no-sub {
    text-align: center;
    padding: 60px 32px;
    background: #fafafa;
    border-radius: 14px;
    border: 2px dashed #e0e0e0;
}
.dm-acct-no-sub-icon { margin-bottom: 16px; opacity: .7; }
.dm-acct-no-sub h3 { font-size: 20px; font-weight: 700; color: #293E61; margin: 0 0 8px; }
.dm-acct-no-sub p  { color: #777; margin-bottom: 24px; }

/* ── Payments panel ── */
.dm-acct-empty-state {
    text-align: center;
    padding: 50px;
    color: #888;
}
.dm-acct-empty-state svg { display: block; margin: 0 auto 16px; opacity: .5; }

.dm-acct-table-scroll { overflow-x: auto; }

.dm-acct-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 500px;
}
.dm-acct-table thead th {
    background: #f4fafa;
    color: #293E61;
    font-weight: 700;
    padding: 12px 14px;
    text-align: right;
    border-bottom: 2px solid #e8f4f4;
}
.dm-acct-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    vertical-align: middle;
}
.dm-acct-table tbody tr:last-child td { border-bottom: none; }
.dm-acct-table tbody tr:hover td { background: #fafafa; }
.dm-acct-td-id { color: #999; font-size: 13px; }

/* ── Profile panel ── */
.dm-acct-profile-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 32px;
}

.dm-acct-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 600px) {
    .dm-acct-field-row { grid-template-columns: 1fr; }
}

.dm-acct-field { display: flex; flex-direction: column; gap: 6px; }
.dm-acct-field label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}
.dm-acct-field input[type="text"],
.dm-acct-field input[type="email"],
.dm-acct-field input[type="tel"] {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    color: #1a1a1a;
    transition: border-color .2s;
    background: #fff;
    direction: rtl;
}
.dm-acct-field input:focus {
    border-color: #1C8187;
    outline: none;
    box-shadow: 0 0 0 3px rgba(28,129,135,.1);
}
.dm-input-readonly {
    background: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed;
}
.dm-field-hint { font-size: 12px; color: #999; }

.dm-acct-change-pass-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #1C8187;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 4px;
}
.dm-acct-change-pass-link:hover { color: #155f63; text-decoration: underline; }

.dm-acct-profile-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
}

/* LTR override for English */
[dir="ltr"].dm-account-page .dm-acct-logout-btn { margin-right: 0; margin-left: auto; }
[dir="ltr"].dm-account-page .dm-acct-tabs       { direction: ltr; }
[dir="ltr"].dm-account-page .dm-acct-sub-dates  { direction: ltr; }
[dir="ltr"].dm-account-page .dm-acct-table      { direction: ltr; }
[dir="ltr"].dm-account-page .dm-acct-table th,
[dir="ltr"].dm-account-page .dm-acct-table td   { text-align: left; }
[dir="ltr"].dm-account-page .dm-acct-field-row  { direction: ltr; }
[dir="ltr"].dm-account-page .dm-acct-field input { direction: ltr; text-align: left; }
[dir="ltr"].dm-account-page .dm-acct-hero       { direction: ltr; }
[dir="ltr"].dm-account-page .dm-acct-hero-info  { text-align: left; }
[dir="ltr"].dm-account-page .dm-acct-sub-top    { direction: ltr; }
[dir="ltr"].dm-account-page .dm-acct-sub-actions { direction: ltr; justify-content: flex-start; }
[dir="ltr"].dm-account-page .dm-acct-profile-footer { direction: ltr; }

/* Responsive */
@media (max-width: 640px) {
    .dm-acct-hero { padding: 20px; }
    .dm-acct-name { font-size: 18px; }
    .dm-acct-tab  { padding: 10px 12px; font-size: 13px; }
    .dm-acct-sub-card { padding: 20px; }
    .dm-acct-profile-card { padding: 20px; }
}

/* ============================================================
   Subscription Checkout Page (/subscribe/)
   ============================================================ */
.dm-subscribe-checkout {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 20px 60px;
    direction: rtl;
}

/* Override WC checkout heading */
.dm-subscribe-checkout h3 {
    color: #293E61;
    font-size: 18px;
    border-bottom: 2px solid #e8f4f4;
    padding-bottom: 10px;
    margin-bottom: 18px;
}

/* Style WC form fields to match brand */
.dm-subscribe-checkout .woocommerce-checkout .form-row input,
.dm-subscribe-checkout .woocommerce-checkout .form-row select,
.dm-subscribe-checkout .woocommerce-checkout .form-row textarea {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color .2s;
}
.dm-subscribe-checkout .woocommerce-checkout .form-row input:focus,
.dm-subscribe-checkout .woocommerce-checkout .form-row select:focus {
    border-color: #1C8187;
    outline: none;
}

/* Place order button */
.dm-subscribe-checkout #place_order {
    background: #1C8187;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    padding: 15px 40px;
    width: 100%;
    cursor: pointer;
    transition: background .2s;
}
.dm-subscribe-checkout #place_order:hover {
    background: #155f63;
}

/* Order review table */
.dm-subscribe-checkout .woocommerce-checkout-review-order-table {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8f4f4;
}
.dm-subscribe-checkout .woocommerce-checkout-review-order-table thead th {
    background: #f4fafa;
    color: #293E61;
    font-weight: 700;
    padding: 12px 16px;
}
.dm-subscribe-checkout .woocommerce-checkout-review-order-table .order-total th,
.dm-subscribe-checkout .woocommerce-checkout-review-order-table .order-total td {
    color: #1C8187;
    font-size: 18px;
    font-weight: 800;
}
