/* Mobile Optimizations and Touch-Friendly Improvements */

/* Prevent horizontal scroll on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Improve touch targets */
button, a, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
}

/* Better touch feedback */
.nav-link, .btn, button, a {
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-link:active, .btn:active, button:active, a:active {
    transform: scale(0.98);
    opacity: 0.8;
}

/* Improve form elements on mobile */
input, select, textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    width: 100%;
    box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Mobile-specific improvements for images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Improve readability on small screens */
@media (max-width: 480px) {
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
    h4 { font-size: 1.1rem; }
    
    p, li {
        font-size: 16px;
        line-height: 1.5;
    }
}

/* Landscape orientation optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar {
        height: 60px;
    }
    
    .nav-container {
        height: 60px;
    }
    
    .nav-logo {
        font-size: 1.3rem;
    }
    
    .signature-image {
        height: 25px;
        max-width: 100px;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .signature-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Keep light theme for now, but structure is ready */
}

/* Print optimizations */
@media print {
    .navbar, .footer, .mobile-menu-btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* Accessibility improvements */
@media (prefers-contrast: high) {
    .nav-link, .btn, button {
        border: 2px solid currentColor;
    }
    
    .nav-link:hover, .btn:hover, button:hover {
        background-color: currentColor;
        color: white;
    }
}

/* Focus improvements for keyboard navigation */
.nav-link:focus, .btn:focus, button:focus, a:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 6px;
}

/* Loading states for better UX */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
