/* ===================================
   Pick-Me AI - Responsive Styles
   Mobile-first responsive design
   =================================== */

/* ========== Tablet Landscape (769px - 1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    
    .stat-item h3 {
        font-size: 4rem;
    }
    
    /* Navigation - оптимизация для планшетов */
    .nav-container {
        padding: 1rem 1.5rem !important;
        justify-content: flex-start !important;
        gap: 0 !important;
    }
    
    /* Возвращаем нормальный размер логотипа */
    .nav-logo-full {
        transform: scale(1.75) translateY(1px);
    }
    
    .nav-logo {
        flex-shrink: 0;
        margin-right: 0;
    }
    
    /* Сдвигаем меню ОЧЕНЬ СИЛЬНО правее от логотипа */
    .nav-menu {
        margin-left: 6rem !important;  /* 96px отступ от логотипа */
        gap: 1rem;
        flex-shrink: 0;
    }
    
    .nav-link {
        font-size: 0.85rem;
    }
    
    .nav-right .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    /* Компактный переключатель языков для планшетов */
    .nav-right {
        margin-left: auto;
    }
    
    .lang-switcher {
        position: relative;
        padding: 0;
        background: transparent;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        min-width: 60px;
    }
    
    .lang-btn {
        display: none;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .lang-btn.active {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--card-bg);
        width: 100%;
        cursor: pointer;
        position: relative;
    }
    
    .lang-btn.active::before {
        content: '🌐 ';
        margin-right: 0.25rem;
    }
    
    .lang-btn.active::after {
        content: ' ▼';
        font-size: 0.6rem;
        margin-left: 0.25rem;
        opacity: 0.6;
    }
}

/* ========== Tablet (768px and below) ========== */
@media (max-width: 768px) {
    /* Typography */
    html {
        font-size: 14px;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    /* Container */
    .container {
        padding: 0 1.5rem;
    }

    .section {
        padding: 3rem 0;
    }

    /* Navigation */
    .nav-container {
        padding: 1rem 1.5rem;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(15, 15, 26, 0.98);
        backdrop-filter: blur(10px);
        padding: 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-100%);
        opacity: 0;
        transition: all 0.3s ease;
        pointer-events: none;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-toggle {
        display: block;
    }

    .nav-right {
        gap: 1rem;
    }
    
    /* Скрываем кнопку "Попробовать бесплатно" на мобильных */
    .nav-right .btn-sm {
        display: none;
    }

    /* Hero */
    .hero {
        min-height: 90vh;
        padding-top: 6rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        justify-content: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 300px;
    }

    /* Grid */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

    .stat-item h3 {
        font-size: 3.5rem;
    }
    
    /* Video Player */
    .video-play-btn svg {
        width: 60px;
        height: 60px;
    }

    /* Cards */
    .card {
        padding: 1.5rem;
    }

    /* Buttons */
    .btn {
        padding: 0.875rem 1.75rem;
    }

    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Testimonials Slider */
    .testimonials-slider {
        padding: 0 50px;
    }
    
    .testimonial-card {
        padding: 2rem;
    }
    
    .testimonial-photo {
        width: 60px;
        height: 60px;
    }
    
    .testimonial-info h4 {
        font-size: 1.25rem;
    }
    
    .testimonial-text {
        font-size: 1rem;
    }
    
    .testimonial-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-badge {
        padding: 0.75rem 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }

    /* Modal */
    .modal-content {
        padding: 2rem;
        margin: 1rem;
    }

    /* Pricing page */
    .pricing-toggle {
        flex-direction: column;
        gap: 1rem;
    }

    .pricing-cards {
        grid-template-columns: 1fr;
    }

    .pricing-card {
        margin-bottom: 1.5rem;
    }

    /* CTA Section */
    .cta-card {
        padding: 3rem 2rem;
        border-radius: 20px;
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    .cta-content p {
        font-size: 1.125rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        padding: 2.5rem 2rem;
        gap: 2.5rem;
    }

    .footer-section:first-child {
        grid-column: 1 / -1;
    }

    /* Language switcher in modal on mobile */
    .lang-switcher {
        flex-wrap: wrap;
    }
}

/* ========== Mobile (480px and below) ========== */
@media (max-width: 480px) {
    /* Typography */
    html {
        font-size: 13px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    /* Container */
    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 2.5rem 0;
    }

    /* Navigation */
    .nav-container {
        padding: 1rem;
    }

    .nav-logo {
        font-size: 1.25rem;
    }

    .nav-logo-icon {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .lang-switcher {
        padding: 0.375rem;
        gap: 0.25rem;
    }

    .lang-btn {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }

    /* Hero */
    .hero h1 {
        font-size: 1.875rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* Stats */
    .stat-item h3 {
        font-size: 2rem;
    }

    .stat-item p {
        font-size: 0.875rem;
    }

    /* Cards */
    .card {
        padding: 1.25rem;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: 1.25rem;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }

    .btn-lg {
        padding: 0.875rem 1.75rem;
        font-size: 0.875rem;
    }

    /* Modal */
    .modal-content {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    /* Forms */
    .form-input,
    .form-textarea {
        padding: 0.875rem;
        font-size: 0.875rem;
    }

    /* Testimonials */
    .testimonial {
        padding: 1.5rem;
    }

    .testimonial-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-section h4 {
        font-size: 1rem;
    }

    /* CTA Section */
    .cta-section {
        padding: 3rem 0;
    }

    .cta-card {
        padding: 2.5rem 1.5rem;
        border-radius: 16px;
    }

    .cta-content h2 {
        font-size: 1.75rem;
    }

    .cta-content p {
        font-size: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn {
        width: 100%;
        min-width: auto;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
        border-radius: 16px;
        gap: 2rem;
    }

    .footer-section h4 {
        font-size: 0.95rem;
    }
}

/* ========== Large Desktop (1440px and above) ========== */
@media (min-width: 1440px) {
    :root {
        --max-width: 1400px;
    }

    html {
        font-size: 18px;
    }

    .hero h1 {
        font-size: 4.5rem;
    }

    .hero-subtitle {
        font-size: 1.75rem;
    }
}

/* ========== Print Styles ========== */
@media print {
    .navbar,
    .nav-toggle,
    .hero-cta,
    .modal,
    .footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* ========== Accessibility ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== Dark mode support (if needed in future) ========== */
@media (prefers-color-scheme: light) {
    /* Currently using dark theme by default */
    /* Can add light theme variables here if needed */
}

/* ========== Hover effects on touch devices ========== */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
    }

    .btn-primary:hover {
        transform: none;
    }
}

/* ========== High DPI screens ========== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize images and icons for retina displays */
    .nav-logo-icon,
    .card-icon {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ========== Landscape orientation on mobile ========== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding-top: 4rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section {
        padding: 2rem 0;
    }
}

/* ========== iPad specific ========== */
@media only screen 
  and (min-device-width: 768px) 
  and (max-device-width: 1024px) 
  and (-webkit-min-device-pixel-ratio: 2) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
