/* REAP Integrity - Self-Contained Utility CSS */
/* This replaces Tailwind CDN with only the classes we actually use */

:root {
    --primary: #3B82F6;
    --secondary: #1E40AF;
    --accent: #F59E0B;
}

/* Reset */
* { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }

/* Layout */
.fixed { position: fixed; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-50 { z-index: 50; }
.z-40 { z-index: 40; }

/* Flexbox */
.flex { display: flex; }
.hidden { display: none; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Responsive */
@media (min-width: 768px) {
    .md\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Sizing */
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-24 { width: 6rem; }
.w-32 { width: 8rem; }
.w-80 { width: 20rem; }
.w-full { width: 100%; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-24 { height: 6rem; }
.h-32 { height: 8rem; }
.h-60 { height: 15rem; }
.h-64 { height: 16rem; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-sm { max-width: 24rem; }
.max-h-screen { max-height: 100vh; }
.max-h-full { max-height: 100%; }
.max-w-full { max-width: 100%; }
.min-h-0 { min-height: 0px; }
.min-h-screen { min-height: 100vh; }

/* Spacing */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-10 { padding: 2.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.px-12 { padding-left: 3rem; padding-right: 3rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-1 { margin-left: 0.25rem; }
.mr-2 { margin-left: 0.5rem; }
.mr-3 { margin-left: 0.75rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Colors */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-500 { background-color: #6b7280; }
.bg-gray-600 { background-color: #4b5563; }
.bg-gray-800 { background-color: #1f2937; }
.bg-black { background-color: #000000; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-500 { background-color: #22c55e; }
.bg-green-600 { background-color: #16a34a; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-red-100 { background-color: #fee2e2; }
.bg-red-500 { background-color: #ef4444; }
.bg-red-600 { background-color: #dc2626; }
.bg-opacity-20 { background-color: rgba(255, 255, 255, 0.2); }
.bg-opacity-30 { background-color: rgba(255, 255, 255, 0.3); }
.bg-opacity-50 { background-color: rgba(0, 0, 0, 0.5); }
.bg-opacity-80 { background-color: rgba(255, 255, 255, 0.8); }
.bg-opacity-100 { background-color: rgba(255, 255, 255, 1.0); }
.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.text-white { color: #ffffff; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-blue-500 { color: #3b82f6; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.text-green-500 { color: #22c55e; }
.text-green-800 { color: #166534; }
.text-purple-800 { color: #6b21a8; }
.text-red-500 { color: #ef4444; }
.text-yellow-500 { color: #eab308; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-90 { opacity: 0.9; }

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }
.text-9xl { font-size: 8rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Borders */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Advanced Layout */
.container { width: 100%; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
.flex-1 { flex: 1 1 0%; }
.transform { transform: translateZ(0); }
.-rotate-90 { transform: rotate(-90deg); }
.cursor-pointer { cursor: pointer; }
.object-contain { object-fit: contain; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }
.duration-1000 { transition-duration: 1000ms; }
.ease-linear { transition-timing-function: linear; }
.hover\\:bg-blue-600:hover { background-color: #2563eb; }
.hover\\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\\:bg-gray-600:hover { background-color: #4b5563; }
.hover\\:bg-green-600:hover { background-color: #16a34a; }
.hover\\:bg-red-600:hover { background-color: #dc2626; }
.hover\\:text-blue-700:hover { color: #1d4ed8; }
.hover\\:text-gray-200:hover { color: #e5e7eb; }
.hover\\:bg-opacity-30:hover { background-color: rgba(255, 255, 255, 0.3); }
.hover\\:bg-opacity-100:hover { background-color: rgba(255, 255, 255, 1.0); }

/* Animations */
.animate-bounce { animation: bounce 1s infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8,0,1,1); }
  50% { transform: none; animation-timing-function: cubic-bezier(0,0,0.2,1); }
}

/* Backdrop Filter */
.backdrop-filter { backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); }
.backdrop-blur-10px { backdrop-filter: blur(10px); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }

/* Forms */
input, textarea, select {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-family: inherit;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary);
}

.btn-secondary {
    background-color: transparent;
    color: #6b7280;
}

.btn-secondary:hover {
    color: #374151;
}

/* Modal Fixes */
body.modal-open {
    overflow: hidden !important;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001 !important;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 28rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .max-w-md { 
        padding: 0.5rem; 
        padding-bottom: 4rem; /* Prevent button cutoff */
        min-height: calc(100vh - 2rem);
    }
    .modal-content { margin: 0.5rem; padding: 1rem; }
    .grid-cols-2 { grid-template-columns: 1fr; }
    .space-x-4 > * + * { margin-left: 0; margin-top: 0.5rem; }
    
    /* Fix button cutoff issues */
    .pb-20 { padding-bottom: 5rem !important; }
    .min-h-screen { 
        min-height: 100vh; 
        padding-bottom: 3rem !important; 
    }
    
    /* Ensure page content doesn't get cut off */
    body {
        padding-bottom: 2rem;
    }
    
    /* Fix modal positioning on mobile */
    .fixed.inset-0 {
        padding: 1rem;
        padding-bottom: 2rem;
    }
}

/* Utility overrides */
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }

/* Loading screen fix */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loading-overlay.hide {
    opacity: 0;
    pointer-events: none;
}/**
 * iOS Native Polish CSS
 * Add this to your site when ?channel=ios is detected
 * This makes the web app feel 100% native
 */

/* 1. Remove all web margins/padding */
body.ios-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    -webkit-user-select: none; /* Disable text selection like native */
    user-select: none;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
    -webkit-touch-callout: none; /* Disable long-press menu */
}

/* 2. Full-screen layout */
.ios-wrapper .container,
.ios-wrapper .main-content {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
}

/* 3. Fix safe areas (notch + home indicator) */
.ios-wrapper {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* 4. Native-style scrolling */
.ios-wrapper * {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* 5. Disable zoom (feels more native) */
.ios-wrapper input,
.ios-wrapper textarea,
.ios-wrapper select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
}

/* 6. Native-style buttons (no web shadows/outlines) */
.ios-wrapper button {
    -webkit-appearance: none;
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: 12px; /* iOS style rounded */
}

/* 7. Native-style cards */
.ios-wrapper .card {
    border-radius: 16px !important; /* More iOS-like */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important; /* Softer shadow */
}

/* 8. Hide desktop-only elements */
.ios-wrapper .desktop-only,
.ios-wrapper .web-only {
    display: none !important;
}

/* 9. Native-style navigation */
.ios-wrapper nav {
    backdrop-filter: blur(20px); /* iOS frosted glass effect */
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.8) !important;
}

/* 10. Native-style transitions */
.ios-wrapper * {
    transition-timing-function: cubic-bezier(0.4, 0.0, 0.2, 1) !important;
}

/* 11. Fix modal/popup positioning */
.ios-wrapper .modal,
.ios-wrapper .popup {
    top: env(safe-area-inset-top) !important;
    bottom: env(safe-area-inset-bottom) !important;
}

/* 12. Native-style form inputs */
.ios-wrapper input[type="text"],
.ios-wrapper input[type="email"],
.ios-wrapper input[type="password"],
.ios-wrapper textarea {
    border-radius: 10px !important;
    border: 1px solid #e5e5e5 !important;
    padding: 12px 16px !important;
    background: #f9f9f9 !important;
}

/* 13. Native-style tab bar (bottom navigation) */
.ios-wrapper .bottom-nav,
.ios-wrapper .tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid rgba(0,0,0,0.1);
}

/* 14. Native-style status bar area */
.ios-wrapper .status-bar-bg {
    height: env(safe-area-inset-top);
    background: #0d9488; /* Your teal color */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

/* 15. Remove hover states (touch-only) */
.ios-wrapper *:hover {
    /* Remove all hover effects */
}

/* 16. Native-style pull-to-refresh space */
.ios-wrapper body {
    overscroll-behavior-y: contain;
}
