:root {
    --primary: #6366f1; /* indigo */
    --primary-2: #8b5cf6; /* violet */
    --dark: #4f46e5;
    --accent: #ec4899; /* pink */
    --bg: #f6f7fb; /* light page */
    --surface: #ffffff; /* cards */
    --surface-2: #f3f4fb; /* subtle tint */
    --green: #10b981;
    --text: #1e2233;
    --muted: #6b7280;
    --border: #ececf3;
    --gold-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); /* brand gradient */
    --radius: 16px;
    --shadow: 0 8px 30px rgba(17, 24, 39, 0.07);
    --glow: 0 0 0 1px rgba(99, 102, 241, 0.15), 0 14px 34px rgba(99, 102, 241, 0.16);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    text-decoration: none;
}

::selection {
    background: rgba(99, 102, 241, 0.18);
    color: var(--dark);
}

nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 0 var(--border), 0 6px 24px rgba(17, 24, 39, 0.04);
    top: 0;
    z-index: 100;
    position: sticky;
}

/*.logo {*/
/*    font-size: 1.4rem;*/
/*    font-weight: 800;*/
/*    color: var(--primary);*/
/*    letter-spacing: 0.5px;*/
/*}*/

.logo{
    display:flex;
    align-items:center;
    gap:12px;
    text-decoration:none;
    font-size:1.8rem;
    font-weight:800;
    color:#fff;
}


.logo span {
    color: var(--accent);
}

.logo img{
    width:48px;
    height:48px;
    object-fit:contain;
    border-radius:10px;
}


.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-admin {
    background: var(--gold-grad);
    color: #fff !important;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.hero {
    position: relative;
    background: radial-gradient(1100px 420px at 50% -140px, rgba(236, 72, 153, 0.35), transparent 65%),
    linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
    padding: 4rem 1rem 5rem;
    text-align: center;
    color: #fff;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.92;
    margin-bottom: 2rem;
}

.hero-sm {
    padding: 2.5rem 1rem 3.5rem;
}

.search-wrap {
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 12px 34px rgba(17, 24, 39, 0.18);
}

.search-wrap input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: var(--text);
    font-family: inherit;
}

.search-wrap input::placeholder {
    color: #9aa0ac;
}

.search-wrap button {
    padding: 1rem 1.8rem;
    background: var(--gold-grad);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
}

.wave {
    margin-top: -2px;
    line-height: 0;
}

.wave svg {
    display: block;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-sm {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.breadcrumb {
    padding: 15px;
    font-size: 1.6rem;
    border-radius: 12px;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    padding: 0;
    margin: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb a {
    color: var(--primary);
}

.breadcrumb a:hover {
    text-decoration: none;
}

.breadcrumb li:last-child span {
    color: var(--text);
    font-weight: 600;
}

.breadcrumb .sep {
    color: #cbd0da;
    font-size: 4rem;
    margin: 0 2px;
}

@media (max-width: 480px) {
    .breadcrumb {
        font-size: 0.8rem;
        padding: 0.75rem 0;
    }

    .breadcrumb ol {
        gap: 0.2rem;
    }
}

.cats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1.5rem 0;
}

.cat {
    padding: 0.55rem 1.3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 30px;
    color: var(--muted);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.cat:hover, .cat.active {
    background: var(--gold-grad);
    color: #fff;
    border-color: transparent;
}

.stats {
    display: flex;
    gap: 1.5rem;
    margin: -2.5rem auto 2rem;
    position: relative;
    z-index: 2;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    flex: 1;
}

.stat .num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

.stat .lbl {
    font-size: 0.8rem;
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.store-card {
    display: block;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: .2s;
}

.store-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--glow);
}

.store-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: #f0f1f6;
}

.store-body {
    padding: 15px;
}

.store-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text);
}

.store-desc {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 10px;
}

.store-count {
    font-size: 20px;
    color: var(--green);
    font-weight: 600;
}

.card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.edit-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
}

.sc-header {
    background: var(--gold-grad);
    padding: 1.5rem;
    text-align: center;
    color: #fff;
}

.sc-logo {
    font-size: 2.5rem;
    margin-bottom: 0.4rem;
}

.sc-name {
    font-weight: 700;
    font-size: 2rem;
}

.sc-body {
    padding: 1rem 1.2rem;
}

.sc-desc {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
}

.sc-count {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.coupon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: stretch; /* يخلي كل الكروت في نفس الصف بنفس الارتفاع */

    padding-bottom: 3rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--glow);
}

.card-header {
    background: dodgerblue;
    padding: 1rem 1.5rem;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 30px;
}

.card-header .sn {
    font-weight: 700;
    color: #fff;
}

.badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.card-body {
    padding: 1.2rem 1.5rem;
}

.card-desc {
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 2;
    margin-bottom: 1rem;
}

.card-expiry {
    font-size: 1.6rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.card-expiry span {
    color: var(--accent);
}

.code-section {
    display: flex;
    gap: 0.6rem;
}

.code-box {
    flex: 1;
    background: rgba(99, 102, 241, 0.07);
    border: 2px dashed var(--primary);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    letter-spacing: 2px;
}

.copy-btn {
    padding: 0.7rem 1.2rem;
    background: var(--gold-grad);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    font-family: inherit;
    transition: filter 0.2s;
}

.copy-btn:hover {
    filter: brightness(1.06);
}

.copy-btn.copied {
    background: var(--green);
}

.card-footer {
    padding: 0.8rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--muted);
}

.verified {
    color: var(--green);
    font-weight: bold;
}

.country-grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.country-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    display: block;
    color: var(--text);
    transition: transform 0.2s, border-color 0.2s;
}

.country-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
}

.country-flag {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.country-name {
    font-weight: 700;
    color: var(--primary);
}

.seo-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.seo-box h2 {
    color: var(--primary);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.seo-box p {
    color: var(--muted);
    font-size: 0.95rem;
}

.seo-article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin: 2rem 0;
    line-height: 1.9;
}

.seo-article h2 {
    color: var(--primary);
    font-size: 1.2rem;
    margin: 1.5rem 0 0.7rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--surface-2);
}

.seo-article h2:first-child {
    margin-top: 0;
}

.seo-article h3 {
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.seo-article p {
    color: #555;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.seo-article ol, .seo-article ul {
    padding-right: 1.5rem;
    margin-bottom: 1rem;
    color: #555;
    font-size: 0.95rem;
}

.seo-article li {
    margin-bottom: 0.4rem;
}

.seo-article strong {
    color: var(--primary);
}

.faq-item {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    border-right: 3px solid var(--primary);
}

.blog-grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding-bottom: 3rem;
}

.blog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: block;
    color: var(--text);
    transition: transform 0.2s, border-color 0.2s;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
}

.blog-body {
    padding: 1.5rem;
}

.blog-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.blog-desc {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.blog-date {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.8rem;
}

.admin-wrap {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.admin-wrap-lg {
    max-width: 950px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.admin-card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.2rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    transition: border 0.2s, box-shadow 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.form-row {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 1rem;
}

.btn {
    padding: 0.9rem 2rem;
    background: var(--gold-grad);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: inline-block;
    font-family: inherit;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.28);
    transition: filter 0.2s, transform 0.2s;
}

.btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 8px;
    color: var(--primary);
    box-shadow: none;
}

.btn-ghost {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--gold-grad);
    color: #fff;
    filter: none;
}

.btn-danger {
    background: #fff0f4;
    color: #c0002a;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
}

.btn-danger:hover {
    background: #c0002a;
    color: white;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    background: var(--surface-2);
    color: var(--primary);
    padding: 0.8rem 1rem;
    text-align: right;
    white-space: nowrap;
}

.admin-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: #fafbff;
}

.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.alert-ok {
    background: #e7fbf3;
    color: #058a63;
}

.alert-err {
    background: #fff0f4;
    color: #c0002a;
}

.dashboard-grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.dash-link {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 1.2rem;
    border-radius: 12px;
    text-align: center;
    display: block;
    font-weight: bold;
    transition: all 0.2s;
}

.dash-link:hover {
    background: var(--gold-grad);
    color: #fff;
}

.empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--muted);
}

.empty .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.stat-link{
      display: flex;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.stat-link .stat{
    transition: .2s;
    width: 100%;
}

.stat-link:hover .stat{
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
    background-color: white;
    color: cyan;
}

.stat-link:visited{
    color: inherit;
}


footer {
    background: #fff;
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

@media (max-width: 600px) {

    .hero h1 {
        font-size: 1.6rem;
    }

    .stats {
        gap: 0.75rem;
    }
    .coupon-grid{
            grid-template-columns: 1fr;

    }
    .form-row {
        grid-template-columns:1fr;
    }

    nav {
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    nav {
        padding: 2rem;
        flex-wrap: wrap;
        /*position: relative;*/
    }

    .nav-links {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
        margin-top: 0.5rem;
        padding: 0.5rem 0;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        display: inline-block !important;
        white-space: nowrap;
        padding: 0.4rem 0.8rem;
        font-size: 1.1rem;
    }

    .nav-admin {
        padding: 0.4rem 0.8rem !important;
    }
}