/**
 * responsive.css - Dodatkowe media queries i responsywność
 * Mobile-first approach z breakpointami dla różnych urządzeń
 */

/* ===== BREAKPOINTS ===== */
/*
  Mobile: < 768px
  Tablet: 768px - 1024px
  Desktop: > 1024px
*/

/* ===== GLOBAL RESPONSIVE ADJUSTMENTS ===== */

/* Tablet - 768px do 1024px */
@media screen and (max-width: 1024px) {
    :root {
        --font-size-h1: 2.5rem;      /* 40px */
        --font-size-h2: 2rem;        /* 32px */
        --font-size-h3: 1.75rem;     /* 28px */
        --font-size-h4: 1.25rem;     /* 20px */
        --spacing-xxl: 3rem;         /* 48px */
    }
    
    .container {
        --container-padding: 1.25rem;
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .section__header {
        margin-bottom: var(--spacing-xl);
    }
}

/* Mobile - poniżej 768px */
@media screen and (max-width: 768px) {
    :root {
        --font-size-base: 15px;
        --font-size-h1: 2rem;        /* 32px */
        --font-size-h2: 1.75rem;     /* 28px */
        --font-size-h3: 1.5rem;      /* 24px */
        --font-size-h4: 1.125rem;    /* 18px */
        --spacing-xl: 2rem;          /* 32px */
        --spacing-xxl: 2.5rem;       /* 40px */
    }
    
    .container {
        --container-padding: 1rem;
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .section__header {
        margin-bottom: var(--spacing-lg);
    }
    
    .section__subtitle {
        font-size: var(--font-size-base);
    }
}

/* Small Mobile - poniżej 480px */
@media screen and (max-width: 480px) {
    :root {
        --font-size-base: 14px;
        --font-size-h1: 1.75rem;     /* 28px */
        --font-size-h2: 1.5rem;      /* 24px */
        --font-size-h3: 1.25rem;     /* 20px */
    }
}

/* ===== UTILITY CLASSES - RESPONSIVE VISIBILITY ===== */

/* Ukryj na mobile */
.hide-mobile {
    display: block;
}

@media screen and (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Ukryj na desktop */
.hide-desktop {
    display: none;
}

@media screen and (max-width: 768px) {
    .hide-desktop {
        display: block !important;
    }
}

/* Pokaż tylko na mobile */
.show-mobile-only {
    display: none;
}

@media screen and (max-width: 768px) {
    .show-mobile-only {
        display: block !important;
    }
}

/* ===== TYPOGRAPHY RESPONSIVE ===== */
@media screen and (max-width: 768px) {
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
    }
    
    p {
        line-height: 1.7;
    }
}

/* ===== BUTTONS RESPONSIVE ===== */
@media screen and (max-width: 768px) {
    .btn {
        width: 100%;
        text-align: center;
        /* Fixed dimensions na mobile - zapobiega zmianom */
        min-height: 48px;
        font-size: 16px; /* Fixed font-size na mobile */
        line-height: 1.5;
        /* Dodatkowe optymalizacje na mobile */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        /* Zapobiega zmianom podczas scrollowania */
        position: relative;
        z-index: 1;
    }
    
    .btn--large {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 16px; /* Fixed font-size */
        min-height: 48px;
    }
    
    /* Zapobiegaj skakaniu czcionek podczas scrollowania */
    .hero__buttons {
        contain: layout style paint;
        position: relative;
        z-index: 1;
    }
    
    /* Zapobiegaj reflow podczas scrollowania */
    .hero__buttons .btn {
        will-change: auto;
        /* Zapobiega automatycznemu skalowaniu na iOS */
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Dodatkowa optymalizacja dla całej sekcji hero */
    .hero {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

/* ===== FORMS RESPONSIVE ===== */
@media screen and (max-width: 768px) {
    .form {
        padding: var(--spacing-lg);
    }
    
    /* Input subdomain + suffix w jednej linii na mobile */
    .form__input-group {
        flex-direction: row;
        width: 100%;
    }
    
    .form__input--subdomain {
        flex: 1;
        min-width: 0;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        border-right: none;
    }
    
    .form__input-suffix {
        flex-shrink: 0;
        white-space: nowrap;
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        border-left: none;
        padding: var(--spacing-sm);
        font-size: var(--font-size-small);
    }
}

/* ===== IMAGES RESPONSIVE ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

svg {
    max-width: 100%;
    height: auto;
}

/* ===== GRIDS RESPONSIVE ===== */
@media screen and (max-width: 768px) {
    /* Wszystkie gridy 2-kolumnowe stają się 1-kolumnowe */
    [class*="__grid"],
    [class*="__content"],
    [class*="__container"] {
        grid-template-columns: 1fr !important;
    }
}

/* ===== SPACING UTILITIES - MOBILE ===== */
@media screen and (max-width: 768px) {
    .mb-mobile-0 { margin-bottom: 0 !important; }
    .mb-mobile-1 { margin-bottom: var(--spacing-xs) !important; }
    .mb-mobile-2 { margin-bottom: var(--spacing-sm) !important; }
    .mb-mobile-3 { margin-bottom: var(--spacing-md) !important; }
    
    .mt-mobile-0 { margin-top: 0 !important; }
    .mt-mobile-1 { margin-top: var(--spacing-xs) !important; }
    .mt-mobile-2 { margin-top: var(--spacing-sm) !important; }
    .mt-mobile-3 { margin-top: var(--spacing-md) !important; }
    
    .p-mobile-sm { padding: var(--spacing-sm) !important; }
    .p-mobile-md { padding: var(--spacing-md) !important; }
}

/* ===== OVERFLOW MANAGEMENT ===== */
@media screen and (max-width: 768px) {
    /* Zapobiegaj poziomemu scrollowaniu */
    body {
        overflow-x: hidden;
    }
    
    /* Tabele responsywne */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ===== LANDSCAPE ORIENTATION (Mobile poziomo) ===== */
@media screen and (max-width: 896px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-xxl) 0;
    }
    
    .section {
        padding: var(--spacing-lg) 0;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    /* Ukryj elementy niepotrzebne w druku */
    .nav,
    .header,
    .footer,
    .btn,
    .lightbox,
    .nav__toggle {
        display: none !important;
    }
    
    /* Resetuj kolory do druku */
    body {
        background: white;
        color: black;
    }
    
    /* Zapobiegaj łamaniu elementów */
    .feature-card,
    .pricing-card,
    .about__feature-item {
        page-break-inside: avoid;
    }
    
    /* Usuń cienie dla oszczędności atramentu */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
}

/* ===== HIGH DPI SCREENS (Retina) ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Większa precyzja dla elementów na ekranach Retina */
    .nav__link.active::after {
        height: 2px;
    }
}

/* ===== ACCESSIBILITY - REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ===== DARK MODE SUPPORT (Opcjonalne) ===== */
@media (prefers-color-scheme: dark) {
    /* Można dodać wsparcie dla dark mode w przyszłości */
    /* Na razie pozostawiamy jasny motyw */
}

