/* ===== MOBILE RESPONSIVENESS ENHANCEMENTS ===== */

/* General Mobile Improvements */
@media (max-width: 768px) {
    /* Improved touch targets */
    button, 
    .btn, 
    .nav-link, 
    .footer-section a,
    .social-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for mobile */
    .container,
    .section-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Improved text readability */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    /* Better form inputs */
    input, 
    textarea, 
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    /* Enhanced modal responsiveness */
    .modal-content,
    .project-modal .modal-content {
        margin: 1% auto;
        max-width: 98%;
        max-height: 98vh;
        border-radius: 12px;
    }
    
    /* Better navigation */
    .nav-links,
    .nav-menu {
        padding: 1.5rem 1rem;
        gap: 0;
    }
    
    .nav-links a,
    .nav-menu .nav-link {
        padding: 1rem 1.5rem;
        margin: 0.25rem 0;
        border-radius: 8px;
        font-size: 1.1rem;
        font-weight: 500;
    }

    .nav-menu .nav-link.active,
    .nav-menu .nav-link[aria-current="page"] {
        color: var(--main-accent, #4FC3F7);
        background: rgba(31,177,166,0.08);
    }
    
    /* Improved footer */
    .minimal-footer,
    .footer {
        padding: 3rem 0 2rem;
    }
    
    .footer-content {
        padding: 0 1rem;
    }
    
    .footer-main {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 600px) {
    /* Enhanced mobile navigation */
    .navbar-inner,
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
    }
    
    .logo-area,
    .nav-logo {
        flex-shrink: 0;
    }
    
    .logo,
    .insaat-logo,
    .yumurta-logo {
        height: 40px;
    }
    
    /* Better hamburger menu */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 32px;
        height: 32px;
        cursor: pointer;
        margin-left: auto;
        z-index: 1001;
        padding: 0;
    }
    
    .nav-toggle span {
        width: 100%;
        height: 3px;
        background: var(--main-accent, #4FC3F7);
        margin: 3px 0;
        transition: all 0.3s ease;
        border-radius: 2px;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Improved mobile menu overlay */
    .nav-links,
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(16, 22, 34, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        padding: 1.5rem 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        gap: 0;
        border-top: 1px solid rgba(31,177,166,0.2);
        box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        z-index: 1000;
    }
    
    .nav-links.active,
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links li,
    .nav-menu {
        width: 100%;
        margin: 0;
    }
    
    .nav-links a,
    .nav-menu .nav-link {
        display: block;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        font-weight: 500;
        border-bottom: 1px solid rgba(31,177,166,0.1);
        text-align: center;
        transition: all 0.3s ease;
        border-radius: 8px;
        margin: 0.25rem 0;
    }
    
    .nav-links a:hover,
    .nav-menu .nav-link:hover {
        background: rgba(31,177,166,0.1);
        color: var(--main-accent, #4FC3F7);
        transform: translateX(5px);
    }
    
    .nav-links a:last-child,
    .nav-menu .nav-link:last-child {
        border-bottom: none;
    }
    
    /* Enhanced project modal */
    .project-modal {
        padding: 0.5rem;
    }
    
    .project-modal .modal-content {
        max-width: 98%;
        max-height: 96vh;
        margin: 1% auto;
        border-radius: 12px;
    }
    
    .project-modal .modal-header {
        padding: 1.25rem 1.25rem 0.75rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        position: relative;
    }
    
    .project-modal .modal-header h2 {
        font-size: 1.4rem;
        line-height: 1.3;
        word-wrap: break-word;
        padding-right: 3rem;
    }
    
    .project-modal .modal-close {
        width: 32px;
        height: 32px;
        font-size: 1.4rem;
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .project-modal .modal-body {
        padding: 1.25rem;
    }
    
    .project-modal .project-gallery {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .project-modal .project-gallery .gallery-item {
        height: 180px;
        border-radius: 8px;
    }
    
    .project-modal .project-gallery .image-placeholder {
        height: 180px;
        font-size: 1.5rem;
    }
    
    .project-modal .project-details-content h3 {
        font-size: 1.1rem;
        margin-top: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .project-modal .project-details-content p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .project-modal .technical-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .project-modal .detail-item {
        padding: 0.75rem;
        border-radius: 8px;
    }
    
    .project-modal .detail-label {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    .project-modal .detail-value {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    /* Ultra mobile optimizations */
    .container,
    .section-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Smaller logos for very small screens */
    .logo,
    .insaat-logo,
    .yumurta-logo {
        height: 35px;
    }
    
    /* Enhanced navigation for small screens */
    .navbar-inner,
    .nav-container {
        padding: 0.5rem 0.75rem;
    }
    
    .nav-toggle {
        width: 28px;
        height: 28px;
    }
    
    .nav-toggle span {
        height: 2px;
        margin: 2px 0;
    }
    
    /* Better mobile menu */
    .nav-links,
    .nav-menu {
        padding: 1rem 0.75rem;
    }
    
    .nav-links a,
    .nav-menu .nav-link {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        margin: 0.2rem 0;
    }
    
    /* Ultra mobile project modal */
    .project-modal {
        padding: 0.25rem;
    }
    
    .project-modal .modal-content {
        max-width: 99%;
        max-height: 98vh;
        margin: 0.5% auto;
        border-radius: 10px;
    }
    
    .project-modal .modal-header {
        padding: 1rem 1rem 0.5rem;
        gap: 0.75rem;
    }
    
    .project-modal .modal-header h2 {
        font-size: 1.2rem;
        line-height: 1.2;
        padding-right: 2.5rem;
    }
    
    .project-modal .modal-close {
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .project-modal .modal-body {
        padding: 1rem;
    }
    
    .project-modal .project-gallery {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .project-modal .project-gallery .gallery-item {
        height: 140px;
        border-radius: 6px;
    }
    
    .project-modal .project-gallery .image-placeholder {
        height: 140px;
        font-size: 1.2rem;
    }
    
    .project-modal .project-details-content h3 {
        font-size: 1rem;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .project-modal .project-details-content p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .project-modal .technical-details {
        gap: 0.5rem;
    }
    
    .project-modal .detail-item {
        padding: 0.5rem;
        border-radius: 6px;
    }
    
    .project-modal .detail-label {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }
    
    .project-modal .detail-value {
        font-size: 0.9rem;
    }
    
    /* Enhanced footer for small screens */
    .minimal-footer,
    .footer {
        padding: 2.5rem 0 1.5rem;
    }
    
    .footer-content {
        padding: 0 0.75rem;
    }
    
    .footer-main {
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .footer-links {
        gap: 1rem;
    }
    
    .footer-section {
        min-width: auto;
    }
    
    .footer-section h4 {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-section a {
        font-size: 0.85rem;
        padding: 0.15rem 0;
    }
    
    .footer-bottom {
        padding-top: 1.5rem;
        gap: 1rem;
    }
    
    .footer-copyright {
        font-size: 0.75rem;
    }
    
    .footer-social {
        gap: 0.75rem;
    }
    
    .footer-social a {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .footer-logo-img {
        height: 30px;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Better touch interactions */
    .nav-links a:hover,
    .nav-menu .nav-link:hover,
    .footer-section a:hover,
    .social-link:hover {
        transform: none;
    }
    
    .nav-links a:active,
    .nav-menu .nav-link:active,
    .footer-section a:active,
    .social-link:active {
        background: rgba(31,177,166,0.2);
        transform: scale(0.98);
    }
    
    /* Improved button interactions */
    .btn:active,
    .action-button:active,
    .submit-btn:active {
        transform: scale(0.98);
    }
    
    /* Better card interactions */
    .project-card:active,
    .company-card:active,
    .product-card:active {
        transform: scale(0.98);
    }
}

/* ===== LANDSCAPE MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-header {
        height: auto;
        min-height: 100vh;
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 2rem;
        margin-top: 1rem;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}

/* ===== HIGH DPI DISPLAY OPTIMIZATIONS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo,
    .insaat-logo,
    .yumurta-logo,
    .footer-logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    /* Ensure proper contrast in dark mode */
    .nav-links,
    .nav-menu {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .modal-content {
        background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .nav-toggle,
    .footer,
    .minimal-footer,
    .back-to-top {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero-header {
        height: auto;
        background: white !important;
    }
    
    .hero-title,
    .hero-subtitle {
        color: black !important;
    }
}
