/* Global Mobile-Friendly CSS for DNP Consult Website */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Oswald:wght@400;500;600;700&display=swap');

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Montserrat', Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Tables */
table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
}

@media (max-width: 768px) {
    table {
        font-size: 0.9rem;
    }
    
    table th,
    table td {
        padding: 8px 4px;
    }
}

/* Responsive Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 0.5em;
    word-wrap: break-word;
}

p {
    margin-bottom: 1em;
    word-wrap: break-word;
}

/* Container Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.container-fluid {
    width: 100%;
    padding: 0 15px;
}

/* Responsive Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }
    
    .col {
        width: 100%;
        margin-bottom: 20px;
    }
}

/* Button Styles - Mobile Friendly */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch-friendly minimum */
    min-width: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, #1e5082, #3c78b4);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3c78b4, #1e5082);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 1.1rem;
    }
}

/* Form Elements - Mobile Optimized */
input, textarea, select {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    transition: border-color 0.3s ease;
    min-height: 44px; /* Touch-friendly */
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #1e5082;
    box-shadow: 0 0 0 3px rgba(30, 80, 130, 0.1);
}

@media (max-width: 768px) {
    input, textarea, select {
        font-size: 1.1rem; /* Prevent zoom on iOS */
        padding: 15px;
    }
}

/* Navigation Improvements */
.nav-mobile-friendly {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(30, 80, 130, 0.1);
}

/* Content Spacing for Fixed Header */
.main-content {
    margin-top: 60px; /* Adjust based on header height */
    padding: 20px 0;
}

@media (max-width: 768px) {
    .main-content {
        margin-top: 55px;
        padding: 15px 0;
    }
}

/* Card Components - Mobile Optimized */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(30, 80, 130, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 80, 130, 0.15);
}

.card-header {
    padding: 20px;
    background: linear-gradient(135deg, #1e5082, #3c78b4);
    color: white;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .card-header,
    .card-body {
        padding: 15px;
    }
    
    .card-footer {
        padding: 12px 15px;
    }
}

/* Gallery/Grid Layouts */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

@media (max-width: 768px) {
    .text-sm-center { text-align: center; }
    .text-sm-left { text-align: left; }
}

/* Spacing Utilities */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* Mobile-specific utilities */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
    
    .mt-sm-1 { margin-top: 0.25rem; }
    .mt-sm-2 { margin-top: 0.5rem; }
    .mt-sm-3 { margin-top: 1rem; }
    
    .mb-sm-1 { margin-bottom: 0.25rem; }
    .mb-sm-2 { margin-bottom: 0.5rem; }
    .mb-sm-3 { margin-bottom: 1rem; }
    
    .p-sm-1 { padding: 0.25rem; }
    .p-sm-2 { padding: 0.5rem; }
    .p-sm-3 { padding: 1rem; }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1e5082;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #1e5082;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .hide-print { display: none !important; }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
        box-shadow: 0 4px 16px rgba(30, 80, 130, 0.1);
    }
    
    .btn:hover {
        transform: none;
    }
    
    /* Larger touch targets */
    .btn {
        min-height: 48px;
        min-width: 48px;
    }
    
    input, textarea, select {
        min-height: 48px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        margin-top: 50px;
    }
    
    .card-body {
        padding: 15px;
    }
}

/* Very small screens (older phones) */
@media (max-width: 320px) {
    .container {
        padding: 0 10px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}