/*
Palguru - Production CSS
Bulletproof, self-contained, no external dependencies
Includes Tailwind-like utilities + custom components
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    background-color: #f9fafb;
    color: #111827;
    /* iOS safe areas */
    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);
}

/* ===== CSS VARIABLES ===== */
:root {
    --primary-green: #003d3a;
    --primary-green-light: #005550;
    --primary-green-dark: #002c2b;
    --accent-yellow: #ffc000;
    --accent-yellow-dark: #e6ad00;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
}

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

/* Container */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container { max-width: 640px; padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 768px) {
    .container { max-width: 768px; }
}

@media (min-width: 1024px) {
    .container { max-width: 1024px; padding-left: 2rem; padding-right: 2rem; }
}

@media (min-width: 1280px) {
    .container { max-width: 1280px; }
}

/* Max width utilities */
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }

/* Flexbox */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }

@media (min-width: 768px) {
    .md\:hidden { display: none !important; }
    .md\:block { display: block !important; }
    .md\:flex { display: flex !important; }
    .md\:inline-flex { display: inline-flex !important; }
    .md\:flex-row { flex-direction: row !important; }
    .md\:gap-2 { gap: 0.5rem; }
    .md\:gap-6 { gap: 1.5rem; }
    .md\:gap-8 { gap: 2rem; }
}

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

/* Spacing - Padding */
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.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; }
.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-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pt-8 { padding-top: 2rem; }
.pb-4 { padding-bottom: 1rem; }

@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 768px) {
    .md\:py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
    .md\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
    .md\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
    .md\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Spacing - Margin */
.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-20 { margin-top: 5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 0.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.-mt-12 { margin-top: -3rem; }

/* Width & Height */
.w-full { width: 100%; }
.h-10 { height: 2.5rem; }
.h-96 { height: 24rem; }
.min-h-screen { min-height: 100vh; }

/* Colors - Background */
.bg-white { background-color: var(--white); }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-gray-200 { background-color: var(--gray-200); }
.bg-gray-800 { background-color: var(--gray-800); }
.bg-primary { background-color: var(--primary-green); }
.bg-primary-dark { background-color: var(--primary-green-dark); }
.bg-accent { background-color: var(--accent-yellow); }
.bg-gradient-primary {
    background: linear-gradient(to right, var(--primary-green), var(--primary-green-dark));
}

/* Colors - Text */
.text-white { color: var(--white); }
.text-gray-100 { color: var(--gray-100); }
.text-gray-200 { color: var(--gray-200); }
.text-gray-300 { color: var(--gray-300); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-800 { color: var(--gray-800); }
.text-primary { color: var(--primary-green); }
.text-accent { color: var(--accent-yellow); }

/* Colors - Border */
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-gray-200 { border-color: var(--gray-200); }
.border-gray-300 { border-color: var(--gray-300); }
.border-gray-800 { border-color: var(--gray-800); }
.border-primary-dark { border-color: var(--primary-green-dark); }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

@media (min-width: 768px) {
    .md\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
    .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
    .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
}

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }

/* Borders & Radius */
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* Shadows */
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Transitions */
.transition { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 300ms; }
.transition-transform { transition-property: transform; transition-duration: 300ms; }

/* Transforms */
.transform { transform: translate(0, 0); }
.translate-x-full { transform: translateX(100%); }
.translate-x-0 { transform: translateX(0); }

/* Outline */
.outline-none { outline: 2px solid transparent; outline-offset: 2px; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* ===== COMPONENT STYLES ===== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
    /* Mobile: Minimum 44px tap target */
    min-height: 44px;
    min-width: 44px;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-green-light);
}

.btn-secondary {
    background-color: var(--accent-yellow);
    color: var(--primary-green);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--accent-yellow-dark);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--white);
    transition: opacity 0.2s;
}

.mobile-menu-btn:hover {
    opacity: 0.8;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Panel */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 80%;
    background-color: var(--primary-green);
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: -4px 0 6px -1px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--primary-green-light);
}

.mobile-menu-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.mobile-menu-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
    /* Minimum 44px tap target */
    min-height: 44px;
    display: flex;
    align-items: center;
}

.mobile-menu-nav a:hover,
.mobile-menu-nav a:active {
    background-color: var(--primary-green-light);
}

/* Input Fields */
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    transition: border-color 0.2s;
    /* iOS: Prevent zoom on focus */
    font-size: 16px;
    /* Minimum 44px tap target */
    min-height: 44px;
}

@media (min-width: 768px) {
    input[type="text"],
    input[type="email"],
    textarea {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(0, 61, 58, 0.1);
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Hover states for touch devices */
@media (hover: hover) {
    .hover\\:bg-primary-light:hover {
        background-color: var(--primary-green-light);
    }
    .hover\\:bg-accent-dark:hover {
        background-color: var(--accent-yellow-dark);
    }
    .hover\\:text-accent:hover {
        color: var(--accent-yellow);
    }
    .hover\\:text-gray-200:hover {
        color: var(--gray-200);
    }
    .hover\\:text-white:hover {
        color: var(--white);
    }
}

/* Focus states for accessibility */
*:focus-visible {
    outline: 2px solid var(--accent-yellow);
    outline-offset: 2px;
}

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

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Prevent text selection on buttons */
button,
.btn {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Safe loading for images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== MOBILE-SPECIFIC OPTIMIZATIONS ===== */

@media (max-width: 767px) {
    /* Larger font sizes on mobile for readability */
    body {
        font-size: 16px;
    }
    
    /* Hero section mobile optimization */
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
        line-height: 1.5;
    }
    
    /* Reduce padding on mobile */
    .mobile-compact-padding {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    /* Stack CTA buttons on mobile */
    .mobile-stack > * {
        width: 100%;
    }
}

/* ===== UTILITY CLASSES FOR RESPONSIVE DESIGN ===== */

/* Show/hide based on screen size */
@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
}

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