:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #8b5cf6;
    /* Violet */
    --accent-hover: #7c3aed;
    --success: #10b981;
    --error: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.15) 0%, transparent 20%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utilities */
.btn {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-outline:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Landing Page */
.landing-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.main-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.6;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Dashboard & Forms */
.wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}


/* Mobile Nav Defaults (Hidden on Desktop) */
.nav-mobile,
.nav-overlay {
    display: none;
}

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

    .nav-mobile-toggle {
        display: flex !important;
    }
}

@media (min-width: 769px) {
    .nav-mobile-toggle {
        display: none;
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logout-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    transition: color 0.2s;
}

.logout-link:hover {
    color: var(--error);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .main-title {
        font-size: 2.5rem;
    }

    /* Mobile Header */
    header {
        flex-wrap: wrap;
        gap: 15px;
        padding-bottom: 1rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    header nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px !important;
    }

    header nav a {
        font-size: 0.85rem;
        padding: 8px 12px;
        background: var(--bg-card);
        border-radius: 8px;
    }

    /* Hide desktop nav on mobile when hamburger exists */
    .nav-desktop {
        display: none;
    }

    .nav-mobile-toggle {
        display: block !important;
    }

    .nav-mobile {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: #1e293b;
        padding: 60px 20px 20px;
        z-index: 1000;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    }

    .nav-mobile.active {
        right: 0;
    }

    .nav-mobile a {
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 1rem;
    }

    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .nav-overlay.active {
        display: block;
    }

    /* Wrapper padding */
    .wrapper {
        padding: 1rem;
    }

    /* Quick actions */
    .quick-actions {
        grid-template-columns: 1fr;
    }

    /* Balance card */
    .balance-amount {
        font-size: 2.5rem;
    }

    /* Auth container */
    .auth-container {
        margin: 2rem auto;
        padding: 2rem;
    }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Action buttons stack on mobile */
    .action-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .action-buttons .btn {
        width: 100%;
        text-align: center;
    }
}

/* Hamburger menu toggle button */
.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.nav-mobile-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
    transition: all 0.3s;
    border-radius: 2px;
}

.nav-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Close button for mobile nav */
.nav-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, #4c1d95, #6d28d9);
    padding: 2.5rem;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(109, 40, 217, 0.4);
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.balance-title {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-amount {
    font-size: 3.5rem;
    font-weight: 800;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}

.action-card:hover {
    transform: translateY(-5px);
    background: rgba(45, 55, 72, 0.8);
}

.action-card h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

/* Tickets Grid */
.tickets-section h2 {
    margin-bottom: 1.5rem;
}

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

.ticket-item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    position: relative;
}

.ticket-header {
    background: rgba(139, 92, 246, 0.1);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.ticket-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.ticket-body {
    padding: 1.5rem;
    text-align: center;
}

.ticket-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.qr-placeholder {
    width: 120px;
    height: 120px;
    background: white;
    margin: 0 auto;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Auth Forms */
.auth-container {
    max-width: 450px;
    margin: 4rem auto;
    padding: 3rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.error-msg {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
}

.success-msg {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
}

/* Mobile Form Styles */
@media (max-width: 768px) {
    .auth-container {
        margin: 1rem auto;
        padding: 1.5rem;
        max-width: 100%;
        border-radius: 12px;
    }

    .auth-container h2 {
        font-size: 1.5rem;
    }

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

    .form-group label {
        font-size: 0.9rem;
    }

    .form-input {
        padding: 12px;
        font-size: 16px;
        /* Prevents iOS zoom on focus */
        border-radius: 8px;
    }

    .form-input:focus {
        border-width: 2px;
    }

    /* Checkbox styling for mobile */
    .form-group input[type="checkbox"] {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }

    .error-msg,
    .success-msg {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Vendor fields box */
    #vendor_fields {
        padding: 12px !important;
    }

    /* TOS box */
    .form-group[style*="background:rgba(188"] {
        padding: 12px !important;
    }

    .form-group[style*="background:rgba(188"] label {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
        margin: 0.5rem;
    }

    .auth-container h2 {
        font-size: 1.3rem;
    }

    .form-input {
        padding: 10px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* ==========================================
   DASHBOARD & VENDOR MOBILE RESPONSIVE STYLES
   ========================================== */

/* Balance Cards on Mobile */
@media (max-width: 768px) {
    .balance-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .balance-amount {
        font-size: 2.2rem;
    }

    .balance-title {
        font-size: 0.85rem;
    }

    /* Vendor Dashboard 3-column grid to stack */
    .wallet-section>div[style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Quick actions 2x2 on mobile */
    .quick-actions {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
    }

    .action-card {
        padding: 1rem;
    }

    .action-card h3 {
        font-size: 1rem;
    }

    .action-card span {
        font-size: 0.8rem;
    }

    /* Tickets Grid */
    .tickets-container,
    div[style*="grid-template-columns:repeat(auto-fill, minmax(280px"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Ticket display cards */
    .ticket-display,
    .glass-panel.ticket-display {
        padding: 15px !important;
    }

    /* QR codes smaller on mobile */
    .ticket-display img,
    .qr-placeholder {
        max-width: 120px;
        height: auto;
    }

    /* Wallet QR section */
    .glass-panel[style*="text-align:center"] img {
        max-width: 100px;
    }

    /* Tables - make them scrollable */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    table th,
    table td {
        padding: 8px !important;
        font-size: 0.85rem;
    }

    /* Product cards */
    .product-card {
        padding: 15px;
    }

    /* Glass panels */
    .glass-panel {
        padding: 15px;
        border-radius: 12px;
    }

    /* H2 Titles */
    h2 {
        font-size: 1.4rem !important;
        margin: 15px 0 !important;
    }

    /* Pending payments */
    .glass-panel[style*="animation:pulse"] {
        padding: 15px !important;
    }

    /* Button full width on mobile */
    .glass-panel .btn,
    .action-card .btn {
        width: 100%;
        text-align: center;
    }

    /* Fullscreen ticket modal */
    #ticket-fullscreen {
        padding: 20px !important;
    }

    #fullscreen-content h2 {
        font-size: 1.3rem !important;
    }

    #fullscreen-content img {
        max-width: 200px;
    }
}

/* Small screen adjustments */
@media (max-width: 480px) {
    .balance-card {
        padding: 1rem;
    }

    .balance-amount {
        font-size: 1.8rem;
    }

    /* Quick actions single column on very small screens */
    .quick-actions {
        grid-template-columns: 1fr !important;
    }

    /* Smaller buttons */
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    /* Balance card buttons stack */
    .balance-card>div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .balance-card .btn {
        width: 100%;
    }

    h2 {
        font-size: 1.2rem !important;
    }

    /* Table cells even smaller */
    table th,
    table td {
        padding: 6px !important;
        font-size: 0.8rem;
    }
}

/* ==========================================
   VENDOR PAGES SPECIFIC MOBILE STYLES
   ========================================== */

@media (max-width: 768px) {

    /* Vendor Products Page */
    .collapsible-header {
        padding: 12px;
        font-size: 0.95rem;
    }

    .collapsible-content {
        padding-top: 15px;
    }

    /* Sales History Table - Card Layout on Mobile */
    .glass-panel table {
        display: block;
    }

    .glass-panel table thead {
        display: none;
    }

    .glass-panel table tbody {
        display: block;
    }

    .glass-panel table tr {
        display: block;
        padding: 15px;
        margin-bottom: 10px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .glass-panel table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        white-space: normal;
    }

    .glass-panel table td:last-child {
        border-bottom: none;
    }

    .glass-panel table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.8rem;
        text-transform: uppercase;
    }

    /* POS page */
    #pos-form {
        padding: 10px !important;
    }

    /* Vendor profile form */
    .form-group {
        margin-bottom: 15px;
    }

    /* Badge styles */
    .vat-badge,
    .pawn-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* ==========================================
   ADMIN DASHBOARD MOBILE STYLES
   ========================================== */

@media (max-width: 768px) {

    /* Stats grid */
    div[style*="grid-template-columns: repeat(auto-fill"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    /* Payout boxes */
    .payout-box {
        padding: 15px !important;
    }

    .payout-box h3 {
        font-size: 1.4rem !important;
    }

    .payout-box small {
        font-size: 0.75rem;
    }

    /* Analytics charts */
    div[style*="height:180px"] {
        height: 150px !important;
    }

    /* Two column layouts become single */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Event cards */
    div[style*="grid-template-columns: repeat(auto-fill, minmax(400px"] {
        grid-template-columns: 1fr !important;
    }

    /* Fee breakdown */
    .fee-breakdown {
        padding: 10px !important;
    }

    .fee-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        margin: 8px 0;
    }

    .fee-line strong {
        font-size: 0.95rem;
    }

    /* Payout code */
    .payout-code {
        font-size: 0.55rem !important;
        padding: 6px !important;
    }

    /* Modal forms */
    .modal-content {
        width: 95% !important;
        max-width: none !important;
        margin: 10px !important;
        padding: 20px !important;
    }
}

@media (max-width: 480px) {

    /* Stats grid single column on very small */
    div[style*="grid-template-columns: repeat(auto-fill"] {
        grid-template-columns: 1fr !important;
    }

    .payout-box h3 {
        font-size: 1.2rem !important;
    }
}

/* ==========================================
   GENERAL RESPONSIVE UTILITIES
   ========================================== */

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Full width on mobile */
@media (max-width: 768px) {
    .mobile-full-width {
        width: 100% !important;
        max-width: none !important;
    }
}

/* Stack flexbox on mobile */
@media (max-width: 768px) {
    .mobile-stack {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .mobile-stack>* {
        width: 100% !important;
    }
}