@import url('https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400..700;1,400..700&display=swap');

:root {
    --primary: #2c3e50;
    --secondary: #34495e;
    --accent: #2563eb;
    --text-main: #1d1d1f; /* Apple dynamic text */
    --text-muted: #515154;
    --bg-main: #f5f5f7;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    --btn-text: #ffffff;
}

[data-theme="dark"] {
    --primary: #ecf0f1;
    --secondary: #bdc3c7;
    --accent: #3b82f6;
    --text-main: #f5f5f7;
    --text-muted: #a1a1a6;
    --bg-main: #000000;
    --glass-bg: rgba(28, 28, 30, 0.8);
    --glass-border: rgba(255, 255, 255, 0.15);
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --btn-text: #000000;
}

body {
    font-family: 'Arimo', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

h1, h2, h3, h4, .font-bold {
    font-weight: 700 !important;
}

/* Apple-style Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 48px 0 rgba(31, 38, 135, 0.15);
}

/* Custom animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Theme-aware utility overrides */
.bg-dark { background-color: var(--bg-main) !important; }
.text-slate-200 { color: var(--text-main) !important; }
.text-slate-400 { color: var(--text-muted) !important; }
.bg-primary { 
    background-color: var(--primary) !important; 
    color: var(--btn-text) !important;
}

.bg-primary * {
    color: var(--btn-text) !important;
}

/* Ensure text visibility on buttons */
.bg-primary, .bg-accent {
    color: var(--btn-text) !important;
}
.text-primary { color: var(--accent) !important; }
.border-white\/10 { border-color: var(--glass-border) !important; }
.bg-white\/5 { background-color: var(--glass-bg) !important; }
.glass-white { background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(10px); }

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Gradient text - Adjusted for new palette */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .glass-card {
        backdrop-filter: blur(8px);
    }
}

/* === COMPREHENSIVE MOBILE-FIRST RESPONSIVE DESIGN === */

/* Small phones (320px - 480px) */
@media (max-width: 200px) {
    body {
        line-height: 1.5;
        font-size: 14px;
    }

    h1 {
        font-size: 1.75rem !important;
        line-height: 1.1;
        margin-bottom: 1rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
        line-height: 1.2;
        margin-bottom: 0.75rem !important;
    }

    h3 {
        font-size: 1.125rem !important;
        margin-bottom: 0.5rem !important;
    }

    h4 {
        font-size: 0.95rem !important;
    }

    p {
        font-size: 0.9rem !important;
        line-height: 1.5;
    }

    /* Sections - reduce excessive padding */
    section {
        padding: 1.5rem 0.75rem !important;
    }

    section.pt-32 { padding-top: 1rem !important; }
    section.pb-20 { padding-bottom: 1.5rem !important; }
    section.py-32 { padding: 1.5rem 0.75rem !important; }
    section.py-16 { padding: 1rem 0.75rem !important; }

    /* Hero section adjustments */
    .relative.min-h-screen {
        min-height: auto !important;
        padding: 2rem 0.75rem !important;
    }

    /* Grid layouts */
    .grid {
        gap: 0.75rem !important;
    }

    .grid.md\\:grid-cols-2,
    .grid.md\\:grid-cols-3,
    .grid.md\\:grid-cols-4,
    .grid.lg\\:grid-cols-2,
    .grid.lg\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Spacing reductions */
    .gap-20 { gap: 1rem !important; }
    .gap-16 { gap: 0.75rem !important; }
    .gap-12 { gap: 0.6rem !important; }
    .gap-10 { gap: 0.5rem !important; }
    .gap-8 { gap: 0.5rem !important; }
    .gap-6 { gap: 0.4rem !important; }

    .mb-20 { margin-bottom: 1rem !important; }
    .mb-16 { margin-bottom: 0.75rem !important; }
    .mb-12 { margin-bottom: 0.6rem !important; }
    .mb-10 { margin-bottom: 0.6rem !important; }
    .mb-8 { margin-bottom: 0.5rem !important; }
    .mb-6 { margin-bottom: 0.4rem !important; }

    .py-32 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .py-24 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .py-20 { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }
    .py-16 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    .px-6 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
    .px-12 { padding-left: 1rem !important; padding-right: 1rem !important; }

    /* Padding for cards */
    .p-24 { padding: 1rem !important; }
    .p-20 { padding: 1rem !important; }
    .p-16 { padding: 1rem !important; }
    .p-12 { padding: 0.9rem !important; }
    .p-10 { padding: 0.8rem !important; }
    .p-8 { padding: 0.7rem !important; }

    /* Text sizing */
    .text-8xl { font-size: 1.75rem !important; }
    .text-7xl { font-size: 1.6rem !important; }
    .text-6xl { font-size: 1.5rem !important; }
    .text-5xl { font-size: 1.375rem !important; }
    .text-4xl { font-size: 1.25rem !important; }
    .text-3xl { font-size: 1.125rem !important; }
    .text-2xl { font-size: 1rem !important; }
    .text-xl { font-size: 0.95rem !important; }
    .text-lg { font-size: 0.9rem !important; }
    .text-base { font-size: 0.9rem !important; }
    .text-sm { font-size: 0.75rem !important; }
    .text-xs { font-size: 0.65rem !important; }

    /* Buttons */
    button, input[type="button"], input[type="submit"],
    a[class*="bg-primary"], a[class*="bg-accent"],
    .bg-primary, .bg-accent {
        width: 100% !important;
        min-height: 44px !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Forms */
    input, textarea, select {
        min-height: 44px !important;
        font-size: 16px !important;
        padding: 0.75rem !important;
        width: 100% !important;
    }

    textarea {
        min-height: 100px !important;
    }

    /* Hide decorative elements */
    .hidden.lg\\:block {
        display: none !important;
    }

    /* Flex stacking */
    .flex.md\\:flex-row {
        flex-direction: column !important;
    }

    .flex.gap-6 { flex-direction: column; }
    .flex.gap-8 { flex-direction: column; }
    .flex.gap-16 { flex-direction: column; }

    /* Rounded corners */
    .rounded-\\[60px\\] { border-radius: 1rem !important; }
    .rounded-\\[50px\\] { border-radius: 1rem !important; }
    .rounded-\\[40px\\] { border-radius: 1rem !important; }
    .rounded-3xl { border-radius: 0.75rem !important; }
    .rounded-\\[32px\\] { border-radius: 0.75rem !important; }
    .rounded-2xl { border-radius: 0.625rem !important; }

    /* Max width containers */
    .max-w-7xl { max-width: 100% !important; }
    .max-w-4xl { max-width: 100% !important; }
    .max-w-3xl { max-width: 100% !important; }
    .max-w-2xl { max-width: 100% !important; }
    .max-w-lg { max-width: 100% !important; }

    /* Width adjustments */
    .w-auto { width: 100% !important; }
    .md\\:w-1/2 { width: 100% !important; }

    /* Image sizing */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Blur elements */
    .absolute.w-80.h-80 {
        width: 150px !important;
        height: 150px !important;
    }

    /* Contact form specific */
    .md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    .md\\:col-span-2 {
        grid-column: 1 !important;
    }

    /* Width override for form buttons */
    .w-full {
        width: 100% !important;
    }

    /* Stats section */
    .flex.flex-wrap.justify-center.gap-16 {
        flex-direction: column;
        gap: 1rem !important;
    }
}

/* Medium phones (481px - 640px) */
@media (min-width: 481px) and (max-width: 640px) {
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.75rem !important; }
    
    .text-8xl { font-size: 2rem !important; }
    .text-7xl { font-size: 1.875rem !important; }
    .text-6xl { font-size: 1.75rem !important; }
    .text-5xl { font-size: 1.6rem !important; }
    .text-4xl { font-size: 1.4rem !important; }
    
    section {
        padding: 2rem 1rem !important;
    }

    .gap-16 { gap: 1rem !important; }
    .gap-12 { gap: 0.75rem !important; }
    .gap-8 { gap: 0.6rem !important; }

    .mb-16 { margin-bottom: 1rem !important; }
    .mb-12 { margin-bottom: 0.75rem !important; }

    .p-20 { padding: 1.25rem !important; }
    .p-16 { padding: 1.1rem !important; }
    .p-12 { padding: 1rem !important; }
    .p-10 { padding: 0.9rem !important; }

    .rounded-\\[60px\\] { border-radius: 1.25rem !important; }
    .rounded-\\[50px\\] { border-radius: 1.25rem !important; }
    .rounded-\\[40px\\] { border-radius: 1.1rem !important; }
}

/* Tablets (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    .grid.lg\\:grid-cols-2,
    .grid.lg\\:grid-cols-3,
    .grid.lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    section {
        padding: 2.5rem 1.5rem !important;
    }

    .p-20 { padding: 1.5rem !important; }
    .p-24 { padding: 1.5rem !important; }

    .gap-20 { gap: 1.25rem !important; }
    .gap-16 { gap: 1rem !important; }
}

/* Large tablets and small desktops */
@media (min-width: 1025px) and (max-width: 1280px) {
    .text-8xl { font-size: 4rem !important; }
    .grid.lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Landscape orientation fixes */
@media (max-height: 600px) and (orientation: landscape) {
    section.pt-32 { padding-top: 1rem !important; }
    section.py-32 { padding: 1.5rem 0 !important; }
    .min-h-screen { min-height: auto !important; }
    
    h1, h2 { margin-bottom: 0.5rem !important; }
    p { font-size: 0.9rem !important; }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    button,
    a[class*="px-"],
    .bg-primary,
    .bg-accent,
    input[type="submit"] {
        min-height: 48px !important;
        min-width: 48px !important;
        padding: 1rem !important;
        font-size: 1.125rem !important;
    }

    /* Remove hover effects that don't work well on touch */
    .glass-card:hover {
        transform: none;
    }

    /* Touch-friendly link spacing */
    a {
        display: inline-block;
        padding: 0.5rem;
        margin: -0.5rem;
    }
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .animate-float {
        animation: none !important;
    }
}

/* High DPI devices */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .border {
        border-width: 0.5px;
    }
}

/* === FORM AND INPUT RESPONSIVE STYLES === */

/* Form inputs - Mobile first */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    box-sizing: border-box;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.875rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

/* Touch-friendly form input sizing */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
textarea,
select {
    min-height: 44px;
    line-height: 1.5;
}

textarea {
    min-height: 120px;
    resize: vertical;
    max-height: 300px;
}

@media (max-width: 640px) {
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    textarea,
    select {
        min-height: 48px;
        padding: 1rem;
        font-size: 16px;
        border-radius: 1rem;
    }

    textarea {
        min-height: 140px;
    }

    /* Form layouts on mobile */
    .grid.md\\:grid-cols-2.gap-10 {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .md\\:col-span-2 {
        grid-column: span 1 !important;
    }

    /* Form button */
    button[type="submit"] {
        min-height: 52px;
        padding: 1rem;
        font-size: 1rem;
    }
}

@media (max-width: 200px) {
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    textarea,
    select {
        min-height: 44px;
        padding: 0.875rem;
    }

    button[type="submit"] {
        min-height: 48px;
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}

/* Focus and active states */
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid;
    outline-offset: 2px;
}

/* Label responsive sizing */
label {
    display: block;
    margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
    label {
        font-size: 0.875rem;
    }
}

/* === BUTTON RESPONSIVE STYLES === */

button,
a.bg-primary,
a.bg-accent,
input[type="submit"],
input[type="button"],
.px-10.py-5 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

@media (max-width: 640px) {
    button,
    a.bg-primary,
    a.bg-accent,
    input[type="submit"],
    input[type="button"] {
        min-height: 48px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        width: 100%;
    }

    .px-10.py-5 {
        width: 100%;
        padding: 1rem;
    }
}

/* === IMAGE RESPONSIVE OPTIMIZATION === */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive images in containers */
.glass.rounded-\\[40px\\] img,
.glass.rounded-3xl img {
    width: 100%;
    height: auto;
}

/* === SECTION SPACING OPTIMIZATION === */

section {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    section {
        padding: 2rem 1rem;
    }
}

@media (max-width: 200px) {
    section {
        padding: 1.5rem 0.75rem;
    }
}

/* === CONTAINER RESPONSIVE === */

.max-w-7xl,
.max-w-4xl,
.max-w-3xl,
.max-w-2xl {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .max-w-7xl,
    .max-w-4xl,
    .max-w-3xl,
    .max-w-2xl {
        padding: 0;
    }
}

/* === FLEX WRAP FOR MOBILE === */

.flex.flex-wrap {
    gap: 0.25rem;
}

@media (max-width: 640px) {
    .flex.flex-wrap {
        flex-direction: column;
        gap: 0.75rem;
    }

    .flex.gap-6 {
        gap: 0.5rem;
    }
}

/* === ASPECT RATIO HANDLING === */

.aspect-square {
    aspect-ratio: 1;
}

@media (max-width: 200px) {
    .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}
