/* Aptcha Website Custom Styles */

/* Mobile-First Responsive Base */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Prevent text size adjustment on iOS */
html {
    -webkit-text-size-adjust: 100%;
}

/* Ensure text wraps properly */
body {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure all text containers wrap properly */
p, h1, h2, h3, h4, h5, h6, span, div, li, a {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Prevent flex items from overflowing */
.flex {
    min-width: 0;
}

/* Ensure grid items don't overflow */
.grid > * {
    min-width: 0;
}

/* Ensure touch targets meet accessibility standards (44x44px minimum) */
button:not(.workflow-step):not(.lang-btn),
a.button,
input[type="submit"],
input[type="button"],
#submit-btn {
    min-height: 44px;
}

/* Mobile touch target improvements */
@media (max-width: 640px) {
    button, a[role="button"], .workflow-step, .lang-btn {
        -webkit-tap-highlight-color: rgba(233, 84, 32, 0.2);
        tap-highlight-color: rgba(233, 84, 32, 0.2);
    }

    /* Better button spacing */
    button, a[href^="#"] {
        touch-action: manipulation;
    }
}

/* Smooth animations and transitions */
@media (max-width: 640px) {
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Mobile-specific improvements */
@media (max-width: 640px) {
    /* Reduce padding on mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Ensure readable font sizes */
    body {
        font-size: 16px; /* Prevents iOS zoom on input focus */
        line-height: 1.6;
    }

    /* Better spacing for mobile */
    section {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    /* Prevent text overflow on mobile */
    p, h1, h2, h3, h4, h5, h6, span, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    /* Ensure containers don't overflow */
    .container {
        max-width: 100%;
        width: 100%;
    }

    /* Hero Section Mobile Improvements */
    .bg-dark section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    /* Better hero spacing on mobile */
    .bg-dark .container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    /* Improve text readability - better contrast */
    .text-gray-300 {
        color: rgba(255, 255, 255, 0.85) !important;
    }

    .text-gray-400 {
        color: rgba(255, 255, 255, 0.7) !important;
    }

    /* Better line height for mobile readability */
    p {
        line-height: 1.7;
        max-width: 100%;
    }

    /* Optimize heading sizes for mobile */
    h1 {
        font-size: 3rem !important;
        line-height: 1.1;
        margin-bottom: 1.25rem;
        letter-spacing: -0.02em;
    }

    /* Better spacing for credibility badges */
    .flex.flex-col.sm\\:flex-row,
    .flex.items-center.gap-3 {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    /* Credibility badge styling */
    .bg-gray-800\\/50 {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    /* Improve button spacing and sizing */
    .flex.flex-col.sm\\:flex-row.gap-4 {
        gap: 0.75rem;
    }

    a[class*="bg-orange"],
    a[class*="border-2"] {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1rem;
        min-height: 52px;
        font-weight: 600;
    }

    /* Better button hover effects */
    a[class*="bg-orange"]:active {
        transform: translateY(0);
    }

    /* Better spacing for social proof section */
    .flex.flex-col.sm\\:flex-row.space-y-4,
    .grid.grid-cols-2 {
        gap: 0.75rem;
        margin-bottom: 2rem;
    }

    /* Social proof cards */
    .bg-gray-800\\/60 {
        transition: transform 0.2s ease, border-color 0.2s ease;
    }

    .bg-gray-800\\/60:active {
        transform: scale(0.98);
    }

    /* Improve description paragraph */
    .text-base.sm\\:text-lg {
        font-size: 1.0625rem;
        line-height: 1.75;
        margin-bottom: 2rem;
        color: rgba(255, 255, 255, 0.85) !important;
    }

    /* Better tagline spacing */
    .text-xl.sm\\:text-2xl,
    .text-2xl.sm\\:text-3xl {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 1rem;
        font-weight: 300;
    }

    /* Improve workflow visualization on mobile */
    .bg-gray-800.rounded-2xl,
    .bg-gradient-to-br.from-gray-800 {
        padding: 1.25rem;
        margin-bottom: 0;
    }

    /* Better card styling */
    .bg-gray-800\\/60 {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    /* Better code snippet display */
    .bg-gray-900.rounded-lg,
    .bg-black\\/40 {
        padding: 1rem;
        border-radius: 0.75rem;
    }

    pre {
        font-size: 0.8125rem;
        line-height: 1.7;
        overflow-x: auto;
        margin: 0;
    }

    code {
        font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    }

    /* Improve platform icons spacing */
    .flex.justify-center.items-center.space-x-3,
    .flex.justify-center.items-center.gap-3 {
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    /* Platform button improvements */
    .lang-btn {
        transition: all 0.2s ease;
    }

    .lang-btn:active {
        transform: scale(0.95);
    }

    /* Better statistics display */
    .text-sm.font-medium {
        font-size: 0.9375rem;
        font-weight: 500;
    }

    .text-xs.text-gray-400 {
        font-size: 0.8125rem;
        color: rgba(255, 255, 255, 0.65) !important;
    }

    /* Improve credibility badge text */
    .text-gray-300.text-sm {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    /* Better visual hierarchy - improve contrast */
    .bg-dark .text-gray-300 {
        color: rgba(255, 255, 255, 0.9) !important;
    }

    .bg-dark .text-gray-400 {
        color: rgba(255, 255, 255, 0.75) !important;
    }

    /* Improve readability of statistics */
    .bg-dark .text-sm.font-medium,
    .bg-dark .text-sm.font-semibold,
    .bg-dark .text-white {
        color: rgba(255, 255, 255, 0.98) !important;
    }

    /* Better text rendering */
    .bg-dark h1,
    .bg-dark h2,
    .bg-dark h3 {
        text-rendering: optimizeLegibility;
    }

    /* Better spacing between sections */
    section + section {
        margin-top: 0;
    }

    /* Improve workflow labels readability */
    .workflow-label {
        font-weight: 500;
        letter-spacing: 0.025em;
    }

    /* Improve card shadows and depth */
    .bg-gradient-to-br.from-gray-800 {
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    }

    /* Better spacing overall */
    .bg-dark .container > div {
        gap: 2rem;
    }
}

/* Extra small mobile devices (320px and below) */
@media (max-width: 375px) {
    h1 {
        font-size: 2rem !important;
        line-height: 1.15;
    }

    .text-xl.sm\\:text-2xl {
        font-size: 1.125rem;
        line-height: 1.4;
    }

    .text-base.sm\\:text-lg {
        font-size: 0.9375rem;
        line-height: 1.65;
    }

    section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .container {
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }

    /* Even tighter spacing on very small screens */
    .bg-dark section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    /* Smaller gaps */
    .flex.flex-col.gap-3 {
        gap: 0.75rem;
    }

    /* Better button sizing */
    a[class*="bg-orange"],
    a[class*="border-2"] {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
        min-height: 48px;
    }

    /* Smaller heading on tiny screens */
    h1 {
        font-size: 2.5rem !important;
    }

    /* Better card grid */
    .grid.grid-cols-2 {
        gap: 0.625rem;
    }

    .bg-gray-800\\/60 {
        padding: 0.875rem;
    }
}

/* Color Variables */
:root {
    --color-cream: #F5F0E5;
    --color-dark: #1A1A1A;
    --color-orange: #E95420;
    --color-orange-dark: #C34113;
    --color-orange-light: #F56B3A;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-300: #D1D5DB;
    --color-gray-400: #9CA3AF;
    --color-gray-500: #6B7280;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-800: #1F2937;
    --color-gray-900: #111827;
}

/* Tailwind Custom Colors */
.bg-cream {
    background-color: var(--color-cream);
}

.bg-dark {
    background-color: var(--color-dark);
}

.text-dark {
    color: var(--color-dark);
}

.bg-orange {
    background-color: var(--color-orange);
}

.bg-orange-dark {
    background-color: var(--color-orange-dark);
}

.bg-orange-light {
    background-color: var(--color-orange-light);
}

.text-orange {
    color: var(--color-orange);
}

.text-orange-light {
    color: var(--color-orange-light);
}

.hover\:bg-orange-dark:hover {
    background-color: var(--color-orange-dark);
}

/* Typography */
.font-serif {
    font-family: 'Playfair Display', Georgia, serif;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-gray-900);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Code Block Styling */
pre {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    line-height: 1.5;
}

code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
}

/* Button Hover Effects */
a[href^="#"] {
    transition: all 0.2s ease;
}

/* Focus States for Accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--color-orange);
    outline-offset: 2px;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: max-height 0.3s ease-out;
}

#mobile-menu.hidden {
    max-height: 0;
    overflow: hidden;
}

/* Section Spacing */
section {
    scroll-margin-top: 80px;
}

/* Code Copy Button */
button[onclick="copyCode()"] {
    transition: color 0.2s ease;
}

button[onclick="copyCode()"]:hover {
    color: white;
}

/* Gradient Background */
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--color-orange), var(--color-orange-dark));
}

/* Card Hover Effects */
.bg-cream.p-8.rounded-xl {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-cream.p-8.rounded-xl:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Logo Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    html {
        scroll-behavior: auto;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    #mobile-menu-btn {
        display: none;
    }

    section {
        page-break-inside: avoid;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --color-orange: #FF6600;
        --color-dark: #000000;
    }
}

/* Dark Mode Support (if user prefers) */
@media (prefers-color-scheme: dark) {
    /* Keep the design as-is since we're using a dark hero section */
    /* This ensures consistency across all devices */
}

/* Workflow Step Styles */
.workflow-step {
    transition: all 0.3s ease;
}

.workflow-step:hover {
    transform: scale(1.1);
}

.workflow-connector {
    transition: background-color 0.3s ease;
}

.workflow-label {
    transition: color 0.3s ease;
}

/* Language Button Styles */
.lang-btn {
    transition: all 0.3s ease;
}

.lang-btn:hover {
    transform: scale(1.1);
}

.lang-btn.active {
    background-color: var(--color-orange) !important;
}

/* Navigation Styles */
header nav a {
    position: relative;
}

header nav a:hover {
    color: var(--color-dark);
}

/* Active navigation state (when scrolled to section) */
header nav a.active {
    color: var(--color-orange);
}

/* Form Styles */
#signup-form input:focus {
    border-color: var(--color-orange);
    box-shadow: 0 0 0 3px rgba(233, 84, 32, 0.1);
}

#signup-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#form-message {
    transition: all 0.3s ease;
}

#form-message.hidden {
    display: none;
}
