/* ========================================
 * AILA Tech Solutions - Professional Mobile-First Responsive Design
 * Inspired by DigitalOcean's excellent mobile experience
 * ======================================== */

/* ========================================
 * 1. MOBILE-FIRST BASE STYLES
 * ======================================== */

/* Base container with mobile-first approach - DigitalOcean inspired */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Professional mobile-first typography */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Mobile-first headings */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 0.5em;
    font-weight: 600;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

/* Mobile-first spacing */
.section {
    padding: 3rem 0;
}

.section-sm {
    padding: 2rem 0;
}

.section-lg {
    padding: 4rem 0;
}

/* Professional mobile-first buttons - DigitalOcean inspired */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 52px; /* Touch-friendly */
    white-space: nowrap;
    position: relative;
}

.btn-primary {
    background: linear-gradient(135deg, #0066ff 0%, #004dcf 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0052cc 0%, #003d99 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 102, 255, 0.3);
}

.btn-secondary,
.btn-outline {
    background: transparent;
    color: var(--text-dark);
    border: 2px solid rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover,
.btn-outline:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.btn-secondary:active,
.btn-outline:active {
    transform: translateY(0);
    background: rgba(0, 0, 0, 0.08);
}

.btn-lg {
    padding: 20px 32px;
    font-size: 18px;
    min-height: 56px;
}

.btn-sm {
    padding: 12px 20px;
    font-size: 14px;
    min-height: 44px;
}

/* Mobile-first cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

/* Mobile-first grid system */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

/* Mobile-first flex utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

/* Mobile-first spacing utilities */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

/* Mobile-first text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

/* ========================================
 * 2. TABLET BREAKPOINT (768px+)
 * ======================================== */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 24px;
    }
    
    /* Tablet typography */
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.875rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.125rem; }
    h6 { font-size: 1rem; }
    
    /* Tablet spacing */
    .section {
        padding: 4rem 0;
    }
    
    .section-sm {
        padding: 3rem 0;
    }
    
    .section-lg {
        padding: 5rem 0;
    }
    
    /* Tablet grid */
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    
    /* Tablet cards */
    .card {
        padding: 2rem;
    }
}

/* ========================================
 * 3. DESKTOP BREAKPOINT (1024px+)
 * ======================================== */
@media (min-width: 1024px) {
    .container {
        max-width: 960px;
        padding: 0 32px;
    }
    
    /* Desktop typography */
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.75rem; }
    h4 { font-size: 1.5rem; }
    h5 { font-size: 1.25rem; }
    h6 { font-size: 1.125rem; }
    
    /* Desktop spacing */
    .section {
        padding: 5rem 0;
    }
    
    .section-sm {
        padding: 4rem 0;
    }
    
    .section-lg {
        padding: 6rem 0;
    }
    
    /* Desktop grid */
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    
    /* Desktop cards */
    .card {
        padding: 2.5rem;
    }
}

/* ========================================
 * 4. LARGE DESKTOP BREAKPOINT (1200px+)
 * ======================================== */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
        padding: 0 40px;
    }
    
    /* Large desktop typography */
    h1 { font-size: 3.5rem; }
    h2 { font-size: 2.5rem; }
    h3 { font-size: 2rem; }
    h4 { font-size: 1.75rem; }
    h5 { font-size: 1.5rem; }
    h6 { font-size: 1.25rem; }
    
    /* Large desktop spacing */
    .section {
        padding: 6rem 0;
    }
    
    .section-sm {
        padding: 5rem 0;
    }
    
    .section-lg {
        padding: 8rem 0;
    }
}

/* ========================================
 * 5. HERO SECTION RESPONSIVE - DigitalOcean Inspired
 * ======================================== */
@media (max-width: 767px) {
    .animated-hero-section {
        padding: 40px 0 30px 0;
        min-height: auto;
        background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
    }
    
    .animated-hero-content {
        flex-direction: column;
        gap: 40px;
        text-align: center;
        align-items: center;
    }
    
    .animated-hero-left {
        order: 1;
        max-width: 100%;
    }
    
    .animated-hero-right {
        order: 2;
        margin-bottom: 0;
    }
    
    /* Professional mobile typography - DigitalOcean style */
    .animated-hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
        font-weight: 700;
        color: #1a1a1a;
        margin-bottom: 20px;
        letter-spacing: -0.02em;
    }
    
    .animated-hero-description {
        font-size: 18px;
        line-height: 1.5;
        color: #666;
        margin: 20px 0 40px 0;
        max-width: 100%;
    }
    
    /* Professional stats container */
    .animated-stats-container {
        flex-direction: row;
        gap: 20px;
        margin: 30px 0;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .animated-stat-card {
        padding: 20px;
        min-width: auto;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 12px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        flex: 0 1 auto;
        min-width: 120px;
    }
    
    .animated-stat-number {
        font-size: 2.2rem;
        font-weight: 700;
        color: #0066ff;
    }
    
    .animated-stat-label {
        font-size: 14px;
        color: #666;
        font-weight: 500;
    }
    
    /* Professional CTA buttons - DigitalOcean style */
    .animated-cta-buttons {
        flex-direction: column;
        gap: 16px;
        margin-top: 40px;
        width: 100%;
        max-width: 400px;
    }
    
    .animated-btn {
        width: 100%;
        justify-content: center;
        padding: 18px 24px;
        font-size: 16px;
        font-weight: 600;
        border-radius: 8px;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .animated-btn-primary {
        background: linear-gradient(135deg, #0066ff 0%, #004dcf 100%);
        color: white;
        border: none;
        box-shadow: 0 4px 16px rgba(0, 102, 255, 0.3);
    }
    
    .animated-btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
    }
    
    .animated-btn-secondary {
        background: transparent;
        color: #1a1a1a;
        border: 2px solid rgba(0, 0, 0, 0.15);
    }
    
    .animated-btn-secondary:hover {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.25);
    }
    
    /* ID Card mobile optimization - cleaner presentation */
    .id-card-container {
        transform: scale(0.9);
        margin: 0;
        display: flex;
        justify-content: center;
    }
    
    .id-card {
        width: 320px;
        height: 200px;
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .animated-hero-section {
        padding: 2rem 0;
    }
    
    .animated-hero-content {
        gap: 3rem;
    }
    
    .animated-hero-title {
        font-size: 2.5rem;
    }
    
    .animated-stats-container {
        gap: 1.5rem;
    }
    
    .animated-stat-card {
        padding: 1.25rem;
    }
    
    .id-card-container {
        transform: scale(0.9);
    }
}

/* ========================================
 * 6. NAVIGATION RESPONSIVE
 * ======================================== */
@media (max-width: 767px) {
    .top-navbar {
        padding: 0.5rem 0;
    }
    
    .top-navbar .container {
        flex-direction: row; /* Keep horizontal layout */
        justify-content: flex-end; /* Align to right */
        gap: 0;
    }
    
    /* Hide Email us and Call us on mobile */
    .top-navbar-left {
        display: none !important;
    }
    
    /* Position language selector to right corner */
    .top-navbar-right {
        width: auto;
        justify-content: flex-end;
        margin-left: auto;
    }
    
    .main-header {
        padding: 0.75rem 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.95);
        z-index: 1000;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu a {
        font-size: 1.25rem;
        color: white;
        padding: 1rem 2rem;
        border-radius: 8px;
        transition: all 0.3s ease;
    }
    
    .nav-menu a:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        color: var(--primary);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-login {
        width: 100%;
        text-align: center;
    }
}

/* ========================================
 * 7. FOOTER RESPONSIVE
 * ======================================== */
@media (max-width: 767px) {
    .footer {
        padding: 2rem 0;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-section {
        width: 100%;
    }
    
    .footer-section h3 {
        margin-bottom: 1rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ========================================
 * 8. FORM RESPONSIVE
 * ======================================== */
@media (max-width: 767px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .form-group textarea {
        min-height: 120px;
    }
    
    .btn-submit {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1rem;
        min-height: 52px;
    }
}

/* ========================================
 * 9. CARD LAYOUT RESPONSIVE
 * ======================================== */
@media (max-width: 767px) {
    .services-grid,
    .features-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card,
    .feature-card,
    .testimonial-card {
        padding: 1.5rem;
        text-align: center;
    }
    
    .service-card h3,
    .feature-card h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .service-card p,
    .feature-card p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .services-grid,
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ========================================
 * 10. UTILITY CLASSES FOR MOBILE
 * ======================================== */
@media (max-width: 767px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-margin-bottom {
        margin-bottom: 1rem !important;
    }
    
    .mobile-padding {
        padding: 1rem !important;
    }
    
    .mobile-stack {
        flex-direction: column !important;
    }
    
    .mobile-gap {
        gap: 1rem !important;
    }
}

/* ========================================
 * 11. TOUCH-FRIENDLY INTERACTIONS
 * ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    .btn,
    .nav-link,
    .card {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    /* Increase touch targets */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 24px;
        min-height: 24px;
    }
    
    /* Improve scrolling */
    .scroll-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* ========================================
 * 12. HIGH DPI DISPLAYS
 * ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp rendering on high DPI displays */
    .logo img,
    .icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ========================================
 * 13. PRINT STYLES
 * ======================================== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .section {
        padding: 1rem 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .btn {
        border: 1px solid #000;
        background: white;
        color: black;
    }
}

/* ========================================
 * 14. ACCESSIBILITY IMPROVEMENTS
 * ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --primary: #000080;
        --text-dark: #000000;
        --text-light: #333333;
    }
    
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* ========================================
 * 15. DARK MODE SUPPORT
 * ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --gray-50: #2a2a2a;
        --gray-100: #3a3a3a;
        --gray-200: #4a4a4a;
        --text-dark: #ffffff;
        --text-light: #cccccc;
    }
    
    body {
        background-color: var(--white);
        color: var(--text-dark);
    }
    
    .card {
        background: var(--gray-50);
        border-color: var(--gray-200);
    }
}

/* ========================================
 * 16. LANDSCAPE MOBILE OPTIMIZATION
 * ======================================== */
@media (max-width: 767px) and (orientation: landscape) {
    .animated-hero-section {
        padding: 0.5rem 0;
        min-height: auto;
    }
    
    .animated-hero-content {
        flex-direction: row;
        gap: 1rem;
    }
    
    .animated-hero-left {
        order: 1;
        flex: 1;
    }
    
    .animated-hero-right {
        order: 2;
        flex: 0 0 auto;
    }
    
    .animated-hero-title {
        font-size: 1.5rem;
    }
    
    .animated-hero-description {
        font-size: 0.875rem;
        margin: 0.5rem 0;
    }
    
    .animated-stats-container {
        flex-direction: row;
        gap: 0.5rem;
        margin: 0.5rem 0;
    }
    
    .animated-stat-card {
        padding: 0.5rem;
    }
    
    .animated-stat-number {
        font-size: 1.25rem;
    }
    
    .animated-stat-label {
        font-size: 0.75rem;
    }
    
    .animated-cta-buttons {
        flex-direction: row;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .animated-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .id-card-container {
        transform: scale(0.6);
        margin: -1rem 0;
    }
}