/* ==========================================================================
   Responsive CSS - Sokrat Development
   Mobile-First Responsive Design
   ========================================================================== */

/* ===== Extra Large Screens (1400px+) ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* ===== Large Screens (1200px) ===== */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Medium-Large Screens (1024px) ===== */
@media (max-width: 1024px) {
    :root {
        --nav-height: 70px;
        --nav-height-scrolled: 60px;
    }
    
    .section {
        padding: var(--space-16) 0;
    }
    
    .section-header {
        margin-bottom: var(--space-12);
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .about-text {
        padding-left: 0;
    }
    
    /* Portfolio */
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Skills */
    .skills-categories {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
    }
}

/* ===== Tablet (768px) ===== */
@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
        --nav-height-scrolled: 55px;
    }
    
    .section {
        padding: var(--space-12) 0;
    }
    
    .section-header {
        margin-bottom: var(--space-10);
    }
    
    .section-title {
        font-size: var(--fs-3xl);
    }
    
    /* Hero */
    .hero-title {
        font-size: var(--fs-3xl);
    }
    
    .hero-description {
        font-size: var(--fs-base);
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-cta .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .hero-stats {
        gap: var(--space-4);
    }
    
    .stat-divider {
        display: none;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* Portfolio */
    .portfolio-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .portfolio-filter {
        gap: var(--space-2);
    }
    
    .filter-btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--fs-xs);
    }
    
    /* Skills */
    .skills-categories {
        grid-template-columns: 1fr;
    }
    
    /* Contact */
    .contact-form {
        grid-template-columns: 1fr;
        padding: var(--space-6);
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand {
        max-width: none;
    }
}

/* ===== Mobile (576px) ===== */
@media (max-width: 576px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .section {
        padding: var(--space-10) 0;
    }
    
    .section-header {
        margin-bottom: var(--space-8);
    }
    
    .section-subtitle {
        font-size: var(--fs-xs);
        padding: var(--space-1) var(--space-3);
    }
    
    .section-title {
        font-size: var(--fs-2xl);
    }
    
    /* Buttons */
    .btn {
        padding: var(--space-3) var(--space-6);
        font-size: var(--fs-sm);
    }
    
    /* Hero */
    .hero {
        padding: calc(var(--nav-height) + var(--space-4)) var(--space-4) var(--space-4);
    }
    
    .hero-badge {
        padding: var(--space-1) var(--space-3);
    }
    
    .badge-text {
        font-size: var(--fs-xs);
    }
    
    .hero-title {
        font-size: var(--fs-2xl);
    }
    
    .hero-typing {
        flex-direction: column;
        gap: var(--space-1);
        min-height: auto;
    }
    
    .typing-prefix,
    .typing-text {
        font-size: var(--fs-lg);
    }
    
    .stat-number {
        font-size: var(--fs-2xl);
    }
    
    .hero-scroll {
        display: none;
    }
    
    /* About */
    .about-heading {
        font-size: var(--fs-xl);
    }
    
    .about-info {
        grid-template-columns: 1fr;
    }
    
    .about-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .about-cta .btn {
        width: 100%;
    }
    
    .experience-badge {
        position: relative;
        right: auto;
        bottom: auto;
        margin-top: var(--space-4);
    }
    
    /* Services */
    .service-card {
        padding: var(--space-6);
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
    }
    
    .service-icon i {
        font-size: var(--fs-2xl);
    }
    
    .service-price {
        flex-wrap: wrap;
    }
    
    .price-amount {
        font-size: var(--fs-xl);
    }
    
    .service-maintenance {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    
    /* Portfolio */
    .portfolio-content {
        padding: var(--space-4);
    }
    
    .portfolio-title {
        font-size: var(--fs-lg);
    }
    
    /* Skills */
    .skill-category {
        padding: var(--space-5);
    }
    
    .tech-icons {
        gap: var(--space-3);
    }
    
    .tech-icon {
        width: 50px;
        height: 50px;
    }
    
    .tech-icon i {
        font-size: var(--fs-xl);
    }
    
    /* Testimonials */
    .testimonial-card {
        padding: var(--space-6);
    }
    
    .testimonial-text {
        font-size: var(--fs-base);
        padding-left: 0;
        padding-top: var(--space-6);
    }
    
    /* Contact */
    .info-card {
        flex-direction: column;
        text-align: center;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    /* Footer */
    .footer-top {
        padding: var(--space-10) 0 var(--space-8);
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form button {
        width: 100%;
    }
    
    .footer-bottom .container {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: var(--space-4);
        right: var(--space-4);
    }
}

/* ===== Extra Small (400px) ===== */
@media (max-width: 400px) {
    .hero-title {
        font-size: var(--fs-xl);
    }
    
    .hero-badge {
        flex-direction: column;
        gap: var(--space-1);
    }
    
    .language-switcher {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .lang-btn {
        padding: var(--space-1) var(--space-2);
    }
}

/* ===== Landscape Mode ===== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding-top: calc(var(--nav-height) + var(--space-8));
        padding-bottom: var(--space-8);
    }
    
    .hero-scroll {
        display: none;
    }
    
    .hero-stats {
        margin-bottom: var(--space-4);
    }
}

/* ===== Print Styles ===== */
@media print {
    .navbar,
    .preloader,
    .cursor-dot,
    .cursor-outline,
    .back-to-top,
    .hero-particles,
    .hero-shapes {
        display: none !important;
    }
    
    .hero {
        min-height: auto;
        padding: var(--space-8);
    }
    
    .section {
        padding: var(--space-8) 0;
    }
    
    * {
        color: #000 !important;
        background: #fff !important;
    }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --text-secondary: #d4d4d8;
    }
    
    .btn-primary {
        border: 2px solid white;
    }
}

/* ===== Reduced Transparency ===== */
@media (prefers-reduced-transparency: reduce) {
    .glass,
    .navbar::before,
    .modal-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    
    .navbar.scrolled::before {
        background: var(--bg-primary);
    }
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .btn:hover,
    .service-card:hover,
    .portfolio-card:hover,
    .skill-category:hover,
    .info-card:hover,
    .social-link:hover,
    .tech-icon:hover,
    .testimonial-btn:hover,
    .filter-btn:hover {
        transform: none;
    }
    
    /* Active states for touch feedback */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .service-card:active,
    .portfolio-card:active {
        transform: scale(0.99);
    }
    
    /* Larger tap targets */
    .nav-link {
        padding: var(--space-3) var(--space-2);
    }
    
    .lang-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .filter-btn {
        min-height: 44px;
    }
    
    .btn {
        min-height: 48px;
    }
    
    .social-link {
        min-width: 48px;
        min-height: 48px;
    }
    
    /* Disable custom cursor on touch devices */
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
    
    /* Better scrolling */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Disable tooltips on touch */
    .tech-icon::before {
        display: none;
    }
}

/* ===== Safe Area Insets for Notched Devices ===== */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(var(--space-4), env(safe-area-inset-left));
        padding-right: max(var(--space-4), env(safe-area-inset-right));
    }
    
    .footer-bottom {
        padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
    }
}

/* ===== Prevent Text Selection on Interactive Elements ===== */
.btn,
.nav-toggle,
.lang-btn,
.filter-btn,
.social-link {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ===== Reduced Motion ===== */
@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;
    }
    
    .hero-particles,
    .hero-shapes,
    .particles-canvas {
        display: none !important;
    }
    
    .preloader {
        display: none !important;
    }
    
    .typing-cursor {
        animation: none !important;
    }
}
