/* ============================================
   RESPONSIVE.CSS - Additional Responsive Adjustments
   F1Key Website - Enterprise Software Engineering
   ============================================ */

/* ==================== */
/* GLOBAL RESPONSIVE UTILITIES */
/* ==================== */

/* Responsive Text Utilities */
@media (max-width: 640px) {
    .text-responsive {
        font-size: 0.9rem;
    }
    
    h1.text-responsive { font-size: 2rem; }
    h2.text-responsive { font-size: 1.75rem; }
    h3.text-responsive { font-size: 1.5rem; }
}

/* Responsive Spacing */
@media (max-width: 968px) {
    .spacing-responsive {
        padding: var(--spacing-md) var(--spacing-sm);
    }
}

@media (max-width: 640px) {
    .spacing-responsive {
        padding: var(--spacing-sm);
    }
}

/* ==================== */
/* CONTAINER ADJUSTMENTS */
/* ==================== */

@media (max-width: 1400px) {
    .container {
        max-width: 1200px;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 968px) {
    .container {
        max-width: 100%;
        padding: 0 var(--spacing-md);
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
}

/* ==================== */
/* HERO SECTION RESPONSIVE */
/* ==================== */

@media (max-width: 968px) {
    .hero {
        min-height: 80vh;
    }
    
    .hero-content {
        padding: var(--spacing-md);
    }
    
    .hero h1 {
        font-size: 3rem;  /* 48px en tablet */
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .cta-primary {
        padding: 0.875rem 1.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .hero {
        min-height: 70vh;
    }
    
    .hero h1 {
        font-size: 2.25rem;  /* 36px en móvil */
        letter-spacing: -0.01em;
        line-height: 1.1;
    }
    
    .hero-tagline {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .cta-primary {
        width: 100%;
        padding: 1rem;
    }
}

/* ==================== */
/* GRID RESPONSIVE OVERRIDES */
/* ==================== */

/* Force single column on mobile */
@media (max-width: 640px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    /* Stats grid: 2 columnas en mobile */
    .stats-highlight .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px !important;
    }
}

/* 2 columns on tablets */
@media (min-width: 641px) and (max-width: 968px) {
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== */
/* NAVIGATION RESPONSIVE TWEAKS */
/* ==================== */

@media (max-width: 968px) {
    .navbar {
        padding: 1rem var(--spacing-md);
    }
    
    .logo {
        font-size: 1.5rem;
    }
}

@media (max-width: 640px) {
    .navbar {
        padding: 1rem var(--spacing-sm);
    }
    
    .logo {
        font-size: 1.35rem;
    }
    
    .menu-toggle {
        width: 30px;
        height: 24px;
    }
}

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

@media (max-width: 968px) {
    section {
        padding: 80px 0;
    }
    
    .section-header {
        margin-bottom: 48px;
    }
    
    .stats-highlight {
        padding: 60px 0 !important;
    }
    
    .stat-badge {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 640px) {
    section {
        padding: 60px 0;
    }
    
    .section-header {
        margin-bottom: 32px;
    }
    
    .section-subtitle {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
    
    .stats-highlight {
        padding: 40px 0 !important;
    }
    
    .stat-badge {
        padding: 16px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .badge {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
}

/* ==================== */
/* VISIBILITY UTILITIES */
/* ==================== */

/* Hide on mobile */
@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }    
    
    /* Contact form: padding reducido */
    .contact-form input,
    .contact-form textarea {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }
    
    /* Service card: ajustar padding */
    .service-card {
        padding: 24px 20px;
    }
    
    .service-icon {
        width: 48px;
        height: 48px;
    }}

/* Hide on tablet */
@media (max-width: 968px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 969px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none !important;
}

@media (max-width: 640px) {
    .show-mobile {
        display: block !important;
    }
}

/* Show only on tablet */
.show-tablet {
    display: none !important;
}

@media (min-width: 641px) and (max-width: 968px) {
    .show-tablet {
        display: block !important;
    }
}

/* ==================== */
/* TOUCH DEVICE OPTIMIZATIONS */
/* ==================== */

@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets for touch */
    button,
    a,
    .service-card,
    .tech-category {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .service-card:hover::before {
        transition: none;
    }
    
    /* Increase spacing for better touch interaction */
    .nav-links li {
        padding: 1rem 0;
    }
}

/* ==================== */
/* LANDSCAPE MOBILE ADJUSTMENTS */
/* ==================== */

@media (max-width: 968px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
    }
    
    section {
        padding: var(--spacing-md) 0;
    }
}

/* ==================== */
/* TABLET SPECIFIC */
/* ==================== */

@media (min-width: 641px) and (max-width: 968px) {
    /* Optimize card sizes for tablet */
    .service-card {
        min-height: 300px;
    }
    
    /* Adjust stat card sizing */
    .stat-card {
        padding: var(--spacing-md);
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
}

/* ==================== */
/* LARGE DESKTOP */
/* ==================== */

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Increase section padding on large screens */
    section {
        padding: calc(var(--spacing-xl) * 1.5) 0;
    }
    
    /* Larger hero title */
    .hero h1 {
        font-size: 7rem;
    }
    
    /* Increase service card padding */
    .service-card {
        padding: var(--spacing-xl) var(--spacing-lg);
    }
}

/* ==================== */
/* ULTRA WIDE SCREENS */
/* ==================== */

@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    /* Prevent excessive line length */
    .about-text p,
    .service-description {
        max-width: 60ch;
    }
}

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

@media print {
    /* Hide non-essential elements */
    .navbar,
    .loader,
    .menu-toggle,
    .footer-social,
    .cta-primary {
        display: none !important;
    }
    
    /* Optimize for print */
    body {
        background: white;
        color: black;
    }
    
    section {
        page-break-inside: avoid;
        padding: 1rem 0;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    

    
    /* Optimize colors for print */
    * {
        color: black !important;
        background: white !important;
    }
    
    .highlight {
        color: #DC143C !important;
    }
}

/* ==================== */
/* HIGH DPI DISPLAYS */
/* ==================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ==================== */
/* DARK MODE SUPPORT (Future Enhancement) */
/* ==================== */

@media (prefers-color-scheme: dark) {
    /* Already dark by default */
    /* This is a placeholder for future customization */
}

/* ==================== */
/* HIGH CONTRAST MODE */
/* ==================== */

@media (prefers-contrast: high) {
    /* Increase border thickness */
    .service-card,
    .tech-category,
    .stat-card,
    .contact-form input,
    .contact-form textarea {
        border-width: 3px;
    }
    
    /* Ensure text contrast */
    body {
        color: #FFFFFF;
    }
    
    .section-subtitle,
    .stat-number,
    .footer-logo .highlight {
        color: #FF1744; /* Brighter red for high contrast */
    }
}

/* ==================== */
/* ACCESSIBILITY - FOCUS INDICATORS */
/* ==================== */

@media (prefers-reduced-motion: no-preference) {
    *:focus-visible {
        outline: 2px solid var(--color-ferrari-red);
        outline-offset: 4px;
        transition: outline-offset 0.2s ease;
    }
}

/* ==================== */
/* RESPONSIVE IMAGES */
/* ==================== */

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

/* ==================== */
/* FLUID TYPOGRAPHY FALLBACKS */
/* ==================== */

/* Ensure text remains readable at all sizes */
@media (max-width: 320px) {
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

@media (min-width: 2560px) {
    html {
        font-size: 18px;
    }
}
