/* ===== متغيرات إضافية للتصميم الجديد ===== */
:root {
    --dash-panel: #151f32;
    --dash-border: rgba(255, 255, 255, .12);
    --dash-header-bg: #000000;
}

/* الثيم الفاتح — Dashboard overrides */
[data-theme="light"] {
    --dash-panel: #FFFFFF;
    --dash-border: rgba(0, 0, 0, .10);
    --dash-header-bg: #FFFFFF;
}

/* ===== Header  ===== */
.new-header {
    background: var(--dash-header-bg);
    border-bottom: 1px solid var(--dash-border);
    position: sticky;
    top: 0;
    z-index: 100;
    /* allow absolute children */
    isolation: isolate;
}

.header-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    min-height: 64px;
}

/* الشعار ديناميكي — يتكيّف مع ارتفاع الهيدر */
.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-logo img {
    height: auto;
    max-height: 48px;
    width: auto;
    display: block;
    object-fit: contain;
    transition: max-height 0.2s ease;
}

.header-nav {
    display: flex;
    gap: 8px;
}

.header-nav a {
    font-weight: 600 !important;
    font-size: 14px !important;
    color: var(--text-muted) !important;
    padding: 7px 14px !important;
    border-radius: 10px !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    opacity: 1 !important;
}

.header-nav a:hover {
    color: var(--text) !important;
    background: var(--card-bg, rgba(255,255,255,0.06)) !important;
    border-color: var(--border-color, rgba(255,255,255,0.12)) !important;
}

.header-nav a.active {
    color: var(--text) !important;
    background: var(--card-bg, rgba(255,255,255,0.08)) !important;
    border-color: var(--border-color, rgba(255,255,255,0.15)) !important;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ===== Hero Section ===== */
.dashboard-hero {
    text-align: center;
    padding: 60px 0 40px;
}

.dashboard-hero h1 {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 10px;
    color: var(--text);
}

/* ===== Main Layout  ===== */
.dashboard-content {
    max-width: 800px;
    margin: 0 auto 60px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Cards Style ===== */
.dash-card {
    background: var(--dash-panel);
    border: 1px solid var(--dash-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.dash-card .card-header{
  background: transparent !important;
}

/* ===== List Items inside Cards ===== */
.dash-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dash-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px;
    border-radius: 10px;
    transition: 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.dash-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.item-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
}

[data-theme="light"] .item-icon {
    background: rgba(0, 0, 0, 0.05);
}

.item-text {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-muted);
}

.item-arrow {
    color: var(--text-muted);
    opacity: 0.5;
    font-size: 14px;
}

/* ===== Plan Card Specifics ===== */
.plan-status-badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-light);
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 10px;
}

.plan-name-large {
    font-size: 28px;
    font-weight: 900;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    display: block;
}

.plan-date {
    color: var(--text-muted);
    font-size: 14px;
}

.progress-container {
    margin-top: 20px;
}

.progress-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

[data-theme="light"] .progress-bar-bg {
    background: rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-accent);
    width: 75%;
    border-radius: 10px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Buttons ===== */
.btn-card {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--dash-border);
    color: var(--text);
    border-radius: 10px;
    font-weight: 700;
    margin-top: 10px;
    text-align: center;
    display: block;
    text-decoration: none;
}

.btn-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary-card {
    background: var(--gradient-accent);
    border: none;
    color: white;
}

.btn-primary-card:hover {
    opacity: 0.9;
    color: #151f32 !important;
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-primary-card:hover {
    opacity: 0.9;
    color: #fff !important;
    transform: translateY(-2px);
}

/* ===== Action Bar (يجمع Theme + User + Hamburger) ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
}

/* ===== زر الهامبرغر للجوال في الداشبورد ===== */
.dash-mobile-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--dash-border);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.dash-mobile-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ===== قائمة الجوال للداشبورد ===== */
.dash-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--dash-header-bg);
    border-top: 1px solid var(--dash-border);
    border-bottom: 1px solid var(--dash-border);
    box-shadow: 0 8px 24px rgba(0,0,0,.30);
    z-index: 200;
    animation: slideDown 0.22s ease;
}

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

.dash-mobile-menu.is-open {
    display: block;
}

.dash-mobile-links {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-mobile-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
}

.dash-mobile-links a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.12);
}

.dash-mobile-links a i {
    width: 18px;
    text-align: center;
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}

/* Light theme */
[data-theme="light"] .dash-mobile-links a {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.07);
    color: var(--text-muted);
}

[data-theme="light"] .dash-mobile-links a:hover {
    background: rgba(0, 0, 0, 0.07);
    color: var(--text);
}

/* ===== خيارات الثيم واللغة في قائمة الجوال ===== */
.dash-mobile-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .dash-mobile-bottom-actions {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.dash-mobile-action-btn {
    flex: 1;
    min-width: calc(50% - 4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--card-bg, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.07));
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.dash-mobile-action-btn:hover,
.dash-mobile-action-btn.active {
    background: var(--primary-accent-bg, rgba(255, 255, 255, 0.08));
    border-color: var(--primary-accent-border, rgba(255, 255, 255, 0.12));
    color: var(--text);
}

[data-theme="light"] .dash-mobile-action-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .dash-mobile-action-btn:hover,
[data-theme="light"] .dash-mobile-action-btn.active {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .header-nav {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .header-nav {
        display: none;
    }

    .dash-mobile-btn {
        display: flex;
    }

    a.btn-login-icon {
        display: none !important;
    }

    .dashboard-content {
        padding: 0 15px;
    }

    .plan-name-large {
        font-size: 22px;
    }

    .dashboard-hero {
        padding: 40px 0 24px;
    }

    .dashboard-hero h1 {
        font-size: 26px;
    }
}

/* الجوال — شاشات صغيرة */
@media (max-width: 480px) {
    .header-container {
        padding: 8px 14px;
        min-height: 54px;
    }

    /* الشعار يتكيّف ديناميكياً مع ارتفاع الهيدر على الجوال */
    .header-logo img {
        max-height: 36px;
    }

    .new-header .lang-name,
    .new-header .lang-chevron {
        display: none !important;
    }

    .new-header .tam-lang-btn {
        padding: 0 10px;
        gap: 0;
        min-width: 38px;
        justify-content: center;
    }

    .dashboard-content {
        padding: 0 12px;
    }

    .dashboard-hero {
        padding: 30px 0 18px;
    }

    .dashboard-hero h1 {
        font-size: 22px;
    }

    .dash-card {
        padding: 18px 16px;
    }

    .plan-name-large {
        font-size: 20px;
    }

    .plan-status-badge {
        font-size: 12px;
    }

    .dash-mobile-links {
        padding: 10px 12px;
    }
}

/* شاشات صغيرة جداً */
@media (max-width: 360px) {
    .header-container {
        padding: 6px 10px;
        min-height: 48px;
    }

    .header-logo img {
        max-height: 30px;
    }

    .new-header .tam-theme-switcher {
        display: none !important;
    }

    .dash-card {
        padding: 16px 12px;
    }
}

/* ===== Premium Coming Soon Modal Styles ===== */
.tam-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.tam-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.tam-modal-content {
    position: relative;
    max-width: 460px;
    width: 100%;
    background: linear-gradient(135deg, rgba(21, 31, 50, 0.92) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(59, 130, 246, 0.15);
    padding: 32px;
    z-index: 10;
    text-align: center;
    color: #ffffff;
    box-sizing: border-box;
    animation: tamModalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tam-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tam-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: rotate(90deg);
}

/* Glowing Icon styling */
.glowing-icon-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glowing-icon-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
    animation: tamPulse 2.5s infinite ease-in-out;
}

.extension-glowing-icon {
    font-size: 42px;
    color: #3b82f6;
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.6));
    animation: tamFloat 3s infinite ease-in-out;
}

.tam-modal-title {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tam-modal-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    padding: 0 10px;
}

/* Feature checklist style */
.modal-features {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: right; /* RTL compatible */
}

html[dir="ltr"] .modal-features {
    text-align: left;
}

.modal-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #cbd5e1;
}

.modal-feature-item i {
    color: #10b981; /* Green color for positive visual checks */
    font-size: 14px;
}

.btn-modal-dismiss {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.btn-modal-dismiss:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.55);
}

/* Animations definition */
@keyframes tamModalPop {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes tamPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 0.35; }
}

@keyframes tamFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===== Light Theme Overrides for Coming Soon Modal ===== */
[data-theme="light"] .tam-modal-backdrop {
    background: rgba(15, 23, 42, 0.45);
}

[data-theme="light"] .tam-modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
    border-color: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15), 0 0 30px rgba(59, 130, 246, 0.08);
}

[data-theme="light"] .tam-modal-close {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.06);
    color: #64748b;
}

[data-theme="light"] .tam-modal-close:hover {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

[data-theme="light"] .tam-modal-title {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .tam-modal-desc {
    color: #475569;
}

[data-theme="light"] .modal-features {
    background: rgba(15, 23, 42, 0.02);
    border-color: rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .modal-feature-item {
    color: #334155;
}


/* ===== Beautiful Premium Dashboard Pagination (RTL & LTR Compatible) ===== */
.dash-pagination {
    margin-top: 30px;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--dash-border);
}

.dash-pagination nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    direction: inherit; /* Dynamic LTR/RTL support */
}

/* RTL Arrow Flipping - semantic direction adjustment */
html[dir="rtl"] .dash-pagination svg {
    transform: scaleX(-1);
    transform-origin: center;
}

/* Mobile & Desktop layouts wrapper */
.dash-pagination nav > div:first-child {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

@media (min-width: 640px) {
    .dash-pagination nav > div:first-child {
        display: none !important;
    }
}

.dash-pagination nav > div:last-child {
    display: none;
}

@media (min-width: 640px) {
    .dash-pagination nav > div:last-child {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 20px;
        flex-direction: row; /* Flex direction flows naturally with parent direction (LTR or RTL) */
    }
}

/* Results text styling */
.dash-pagination p {
    font-size: 13.5px;
    color: var(--text-muted2);
    margin: 0;
    font-weight: 500;
}

.dash-pagination p span {
    font-weight: 700;
    color: var(--text);
}

/* Clean up Laravel default Tailwind wrappers */
.dash-pagination nav span[aria-current="page"],
.dash-pagination nav span[aria-disabled="true"] {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
}

/* Make button group container a transparent gap-wrapper instead of joined block */
.dash-pagination .inline-flex {
    display: inline-flex !important;
    gap: 8px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    border-radius: 0px !important;
    padding: 0 !important;
}

/* Styles for individual floating pill buttons */
.dash-pagination nav a,
.dash-pagination nav span[aria-current="page"] > span,
.dash-pagination nav span[aria-disabled="true"] > span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 38px !important;
    height: 38px !important;
    padding: 0 14px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--dash-border) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    margin: 0 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

[data-theme="light"] .dash-pagination nav a,
[data-theme="light"] .dash-pagination nav span[aria-current="page"] > span,
[data-theme="light"] .dash-pagination nav span[aria-disabled="true"] > span {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
    color: #475569 !important;
}

/* SVG Arrow inside buttons */
.dash-pagination svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: inline-block;
    transition: transform 0.25s ease;
}

/* Hover state for links */
.dash-pagination nav a:hover {
    background: rgba(33, 130, 223, 0.12) !important;
    border-color: var(--primary-accent-border, rgba(59, 130, 246, 0.3)) !important;
    color: var(--primary-accent, #3b82f6) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(33, 130, 223, 0.15) !important;
}

[data-theme="light"] .dash-pagination nav a:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
    color: #3b82f6 !important;
}

/* Active page (Vibrant Premium Blue Gradient) */
.dash-pagination nav span[aria-current="page"] > span {
    background: var(--gradient-accent, linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%)) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35) !important;
}

/* Disabled buttons */
.dash-pagination nav span[aria-disabled="true"] > span {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    background: rgba(255, 255, 255, 0.01) !important;
    border-color: var(--dash-border) !important;
    box-shadow: none !important;
    pointer-events: none;
}

[data-theme="light"] .dash-pagination nav span[aria-disabled="true"] > span {
    background: rgba(0, 0, 0, 0.01) !important;
    border-color: rgba(0, 0, 0, 0.04) !important;
}

/* Mobile specific styling overrides */
@media (max-width: 639px) {
    .dash-pagination nav > div:first-child a,
    .dash-pagination nav > div:first-child span {
        flex: 1;
        text-align: center;
        border: 1px solid var(--dash-border) !important;
        border-radius: 12px !important;
        margin: 0 4px !important;
        background: rgba(255, 255, 255, 0.04) !important;
        height: 40px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    }

    [data-theme="light"] .dash-pagination nav > div:first-child a,
    [data-theme="light"] .dash-pagination nav > div:first-child span {
        background: rgba(255, 255, 255, 0.8) !important;
        border-color: rgba(0, 0, 0, 0.08) !important;
        color: #475569 !important;
    }
}
