/* ========================================
   LEIGHDS GMS - APPLE-INSPIRED DESIGN SYSTEM
   ======================================== */

/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ========================================
   CSS VARIABLES - DESIGN TOKENS
   ======================================== */

:root {
    /* Apple-inspired Color Palette */
    --color-bg-primary: #F5F5F7;
    --color-bg-secondary: #FFFFFF;
    --color-bg-tertiary: #E5E5E7;
    --color-border: #D1D1D6;
    --color-text-primary: #1D1D1F;
    --color-text-secondary: #6E6E73;
    --color-accent: #006096;
    --color-accent-hover: #004c77;
    --color-accent-rgb: 0, 96, 150;

    /* Spacing Scale - increased by 25% for Apple aesthetics */
    --space-0-5: 5px;
    --space-1: 10px;
    --space-1-5: 15px;
    --space-2: 20px;
    --space-2-5: 25px;
    --space-3: 30px;
    --space-4: 40px;
    --space-5: 50px;
    --space-6: 60px;
    --space-8: 80px;
    --space-10: 100px;

    /* Border Radius - Apple-inspired smoothness */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    /* Shadows - Subtle Apple-style */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.16);

    /* Transitions - Smooth Apple animations */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   BASE RESET & TYPOGRAPHY
   ======================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    background:
        radial-gradient(at 20% 10%, rgba(0, 96, 150, 0.15) 0px, transparent 45%),
        radial-gradient(at 85% 90%, rgba(110, 110, 115, 0.12) 0px, transparent 45%),
        radial-gradient(at 50% 50%, rgba(229, 229, 231, 0.3) 0px, transparent 60%),
        var(--color-bg-primary);
    background-image:
        radial-gradient(at 20% 10%, rgba(0, 96, 150, 0.15) 0px, transparent 45%),
        radial-gradient(at 85% 90%, rgba(110, 110, 115, 0.12) 0px, transparent 45%),
        radial-gradient(at 50% 50%, rgba(229, 229, 231, 0.3) 0px, transparent 60%),
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
    background-color: var(--color-bg-primary);
    background-attachment: fixed;
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

h1 { font-size: 48px; }
h2 { font-size: 36px; }
h3 { font-size: 28px; }
h4 { font-size: 24px; }
h5 { font-size: 20px; }
h6 { font-size: 18px; }

p {
    color: var(--color-text-primary);
    line-height: 1.6;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

/* ========================================
   CARDS & CONTAINERS
   ======================================== */

.card,
.stat-card,
.member-card,
.product-card,
.checkin-card,
.plan-card,
.admin-card,
.settings-card,
.dashboard-card,
.form-card,
.billing-card,
.transaction-card,
.offer-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    backdrop-filter: blur(20px);
}

.card:hover,
.stat-card:hover,
.member-card:hover,
.product-card:hover,
.checkin-card:hover,
.plan-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* Card Headers */
.card-header {
    background: var(--color-accent);
    color: white;
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin: calc(var(--space-3) * -1) calc(var(--space-3) * -1) var(--space-2);
}

.card-body {
    padding: var(--space-2) 0;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn,
button:not(.unstyled) {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 15px;
    letter-spacing: 0.3px;
}

.btn-primary,
button.primary {
    background: var(--color-accent);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
button.primary:hover {
    background: var(--color-accent-hover);
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-secondary);
    transform: scale(1.03);
    box-shadow: var(--shadow-sm);
}

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

.btn-outline:hover {
    background: var(--color-accent);
    color: white;
    transform: scale(1.03);
}

/* ========================================
   INPUTS & FORMS
   ======================================== */

input:not([type="checkbox"]):not([type="radio"]):not(.unstyled),
textarea:not(.unstyled),
select:not(.unstyled) {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    padding: var(--space-2) var(--space-2-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    transition: var(--transition-fast);
    width: 100%;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-secondary);
}

label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
    display: block;
}

/* ========================================
   TABLES
   ======================================== */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

thead {
    background: var(--color-bg-tertiary);
}

th {
    padding: var(--space-2) var(--space-2-5);
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: var(--space-2) var(--space-2-5);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

tr:hover {
    background: var(--color-bg-tertiary);
}

/* ========================================
   BADGES & PILLS
   ======================================== */

.badge,
.pill,
.tag {
    display: inline-block;
    padding: 6px 15px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: rgba(var(--color-accent-rgb), 0.1);
    color: var(--color-accent);
    border: 1px solid rgba(var(--color-accent-rgb), 0.3);
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* ========================================
   MODALS & OVERLAYS
   ======================================== */

.modal-overlay {
    background: rgba(29, 29, 31, 0.5);
    backdrop-filter: blur(10px);
}

.modal {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    padding: var(--space-4);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Spacing */
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }

.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }

/* Text */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-accent { color: var(--color-accent); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* Backgrounds */
.bg-primary { background: var(--color-bg-primary); }
.bg-secondary { background: var(--color-bg-secondary); }
.bg-tertiary { background: var(--color-bg-tertiary); }

/* Borders */
.border { border: 1px solid var(--color-border); }
.border-radius { border-radius: var(--radius-md); }
.border-radius-lg { border-radius: var(--radius-lg); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-pill);
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

@media (max-width: 768px) {
    :root {
        --space-3: 20px;
        --space-4: 30px;
    }

    h1 { font-size: 36px; }
    h2 { font-size: 28px; }
    h3 { font-size: 24px; }

    .card,
    .stat-card,
    .member-card {
        padding: var(--space-2);
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    body {
        background: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
