/* ===================================================
   EID SALAMI — Global Styles (Mobile-First)
   =================================================== */

/* ── Google Fonts ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── CSS Custom Properties ────────────────────── */
:root {
    --green: #1A6B3A;
    --green-light: #2E9B5A;
    --green-dark: #0F4D28;
    --gold: #D4A017;
    --gold-light: #F5D76E;
    --dark: #0D1F12;
    --dark-card: #132A18;
    --cream: #FDF6E3;
    --cream-dark: #F0E6C8;
    --white: #FFFFFF;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-500: #6C757D;
    --gray-700: #495057;
    --gray-900: #212529;
    --danger: #E94560;
    --success: #28A745;
    --info: #17A2B8;

    --font-heading: 'Amiri', serif;
    --font-body: 'Nunito', sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 50%;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.2);
    --shadow-gold: 0 4px 30px rgba(212, 160, 23, 0.25);

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ─────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--cream);
    background: var(--dark);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--gold-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Utility ──────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.text-center {
    text-align: center;
}

.text-gold {
    color: var(--gold);
}

.text-green {
    color: var(--green-light);
}

.text-muted {
    color: var(--gray-500);
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

/* ── Buttons ──────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(26, 107, 58, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(26, 107, 58, 0.5);
    color: var(--white);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), #E6B422);
    color: var(--dark);
    box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 35px rgba(212, 160, 23, 0.4);
    color: var(--dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
}

.btn-outline:hover {
    background: var(--gold);
    color: var(--dark);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.15rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-full);
    font-size: 1.2rem;
}

/* ── Form Controls ────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cream);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--cream);
    background: rgba(255, 255, 255, 0.07);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition);
}

.form-control:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15);
}

.form-control::placeholder {
    color: rgba(253, 246, 227, 0.4);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23D4A017' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ── Flash Messages ───────────────────────────── */
.flash {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 600;
    animation: slideDown 0.4s ease;
}

.flash-success {
    background: rgba(40, 167, 69, 0.2);
    border-left: 4px solid var(--success);
    color: #A3DFBB;
}

.flash-error {
    background: rgba(233, 69, 96, 0.2);
    border-left: 4px solid var(--danger);
    color: #F5A3B3;
}

.flash-info {
    background: rgba(23, 162, 184, 0.2);
    border-left: 4px solid var(--info);
    color: #7EDCE8;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Navigation ───────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(13, 31, 18, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(212, 160, 23, 0.15);
    padding: 0 16px;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    height: 64px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
}

.navbar-logo span {
    color: var(--green-light);
}

.navbar-logo .logo-icon {
    font-size: 1.8rem;
}

.navbar-links {
    display: none;
    list-style: none;
    gap: 8px;
}

.navbar-links a {
    display: block;
    padding: 8px 16px;
    color: var(--cream);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.navbar-links a:hover,
.navbar-links a.active {
    color: var(--gold);
    background: rgba(212, 160, 23, 0.1);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hide action buttons on mobile — they go in mobile nav instead */
.navbar-actions .btn {
    display: none;
}

@media (min-width: 768px) {
    .navbar-actions .btn {
        display: inline-flex;
    }
}

/* Mobile menu toggle */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--cream);
    border-radius: 2px;
    transition: all var(--transition);
}

/* Mobile nav */
.mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 31, 18, 0.98);
    backdrop-filter: blur(20px);
    padding: 24px;
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

.mobile-nav.open {
    display: block;
}

.mobile-nav a {
    display: block;
    padding: 16px 0;
    color: var(--cream);
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-nav a:hover {
    color: var(--gold);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ── Cards Grid (used in dashboard, leaderboard, etc.) ── */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* ── Stat Cards ───────────────────────────────── */
.stat-card {
    background: linear-gradient(135deg, rgba(26, 107, 58, 0.15), rgba(26, 107, 58, 0.05));
    border: 1px solid rgba(212, 160, 23, 0.12);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-gold);
    border-color: rgba(212, 160, 23, 0.3);
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Table ────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
}

.table thead th {
    background: rgba(26, 107, 58, 0.15);
    color: var(--gold);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background var(--transition);
}

.table tbody tr:hover {
    background: rgba(26, 107, 58, 0.08);
}

/* ── Badge / Status Chips ─────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-gold {
    background: rgba(212, 160, 23, 0.2);
    color: var(--gold-light);
}

.badge-green {
    background: rgba(40, 167, 69, 0.2);
    color: #A3DFBB;
}

.badge-danger {
    background: rgba(233, 69, 96, 0.2);
    color: #F5A3B3;
}

.badge-info {
    background: rgba(23, 162, 184, 0.2);
    color: #7EDCE8;
}

.status-sent {
    color: var(--info);
}

.status-opened {
    color: var(--gold);
}

.status-accepted {
    color: var(--success);
}

.status-expired {
    color: var(--gray-500);
}

/* ── Auth Pages ───────────────────────────────── */
.auth-page {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(26, 107, 58, 0.15), transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 160, 23, 0.08), transparent 50%),
        var(--dark);
}

.auth-page main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 164px);
    padding: 24px 16px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    background: rgba(19, 42, 24, 0.8);
    border: 1px solid rgba(212, 160, 23, 0.15);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    font-size: 1.6rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 8px;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* Auth responsive — tablet+ */
@media (min-width: 480px) {
    .auth-card {
        padding: 40px 36px;
    }

    .auth-card h1 {
        font-size: 1.8rem;
    }
}

/* ── Page Header ──────────────────────────────── */
.page-header {
    padding: 32px 0 24px;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 8px;
}

.page-header p {
    color: var(--gray-500);
}

/* ── Footer ───────────────────────────────────── */
.footer {
    margin-top: 60px;
    padding: 32px 16px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    color: var(--gray-500);
}

.footer a {
    color: var(--gold);
}

/* ── Loading Spinner ──────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Share Buttons Panel ──────────────────────── */
.share-panel {
    display: none;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px;
    background: rgba(19, 42, 24, 0.6);
    border: 1px solid rgba(212, 160, 23, 0.15);
    border-radius: var(--radius-lg);
    margin-top: 20px;
    animation: slideDown 0.4s ease;
}

.share-panel.show {
    display: flex;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    text-decoration: none;
    transition: all var(--transition);
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-2px);
    color: white;
}

.share-btn-whatsapp {
    background: #25D366;
}

.share-btn-messenger {
    background: #0084FF;
}

.share-btn-facebook {
    background: #1877F2;
}

.share-btn-sms {
    background: #6C757D;
}

.share-btn-viber {
    background: #7360F2;
}

.share-btn-email {
    background: #EA4335;
}

.share-btn-copy {
    background: var(--gold);
    color: var(--dark);
}

/* ── Responsive ───────────────────────────────── */
@media (min-width: 480px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .navbar-links {
        display: flex;
    }

    .menu-toggle {
        display: none;
    }

    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .container {
        padding: 0 24px;
    }
}

@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Scrollbar ────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(212, 160, 23, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 160, 23, 0.5);
}