/* =============================================================================
   RESPONSIVE DESIGN - FULL MOBILE COMPATIBILITY
   ============================================================================= */

/* Mobile First Approach - Base styles for mobile */
* {
    box-sizing: border-box;
}

/* Viewport and Base Settings */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header Responsive Design */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Logo Responsive */
.custom-logo {
    max-height: 50px;
    width: auto;
    transition: all 0.3s ease;
}

.custom-logo:hover {
    transform: scale(1.05);
}

/* Mobile Menu Button */
#mobile-menu-button {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
}

#mobile-menu-button:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

#mobile-menu-button.active {
    color: #3b82f6;
}

/* Mobile Menu */
#mobile-menu {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: white;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#mobile-menu.translate-x-0 {
    transform: translateX(0);
}

#mobile-menu.-translate-x-full {
    transform: translateX(-100%);
}

#mobile-menu .menu {
    padding: 0;
    list-style: none;
    margin: 0;
}

#mobile-menu .menu li {
    margin-bottom: 0;
}

#mobile-menu .menu a {
    display: block;
    padding: 12px 16px;
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

#mobile-menu .menu a:hover,
#mobile-menu .menu a:focus {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    transform: none;
}

/* Navigation Menu Responsive */
.primary-navigation {
    display: flex;
    align-items: center;
    gap: 20px;
}

.primary-navigation .menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
}

.primary-navigation .menu a {
    padding: 10px 15px;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.primary-navigation .menu a:hover,
.primary-navigation .menu a:focus {
    color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
}

.primary-navigation .menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.primary-navigation .menu a:hover::after {
    width: 80%;
}

/* Buttons Responsive */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 14px;
    line-height: 1.4;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.btn-secondary:hover {
    background: #3b82f6;
    color: white;
    text-decoration: none;
}

/* Hero Section Responsive */
.hero-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="white" opacity="0.1"/><circle cx="80" cy="40" r="1" fill="white" opacity="0.1"/><circle cx="40" cy="80" r="1.5" fill="white" opacity="0.1"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Cards Responsive Design */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-image {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1e293b;
}

.card-description {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Grid System Responsive */
.grid {
    display: grid;
    gap: 30px;
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Forms Responsive */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.img-responsive {
    width: 100%;
    height: auto;
}

/* Tables Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 600px;
}

/* =============================================================================
   MEDIA QUERIES - RESPONSIVE BREAKPOINTS
   ============================================================================= */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .container {
        padding: 0 30px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .grid-lg-4 { grid-template-columns: repeat(4, 1fr); }
    .grid-lg-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-lg-2 { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop (992px to 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet (768px to 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .hero-section {
        padding: 50px 0;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .primary-navigation {
        display: none;
    }
    
    #mobile-menu-button {
        display: block;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Mobile Large (576px to 767px) */
@media (max-width: 767px) and (min-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .card-content {
        padding: 15px;
    }
    
    .primary-navigation {
        display: none;
    }
    
    #mobile-menu-button {
        display: block;
    }
    
    .site-header .flex {
        height: 70px;
    }
    
    #mobile-menu {
        top: 70px;
        height: calc(100vh - 70px);
    }
}

/* Mobile Small (up to 575px) */
@media (max-width: 575px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }
    
    .hero-buttons {
        gap: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
        min-width: auto;
        width: 100%;
        max-width: 280px;
    }
    
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card-content {
        padding: 12px;
    }
    
    .card-title {
        font-size: 1.125rem;
    }
    
    .card-description {
        font-size: 0.9rem;
    }
    
    .primary-navigation {
        display: none;
    }
    
    #mobile-menu-button {
        display: block;
        padding: 6px;
    }
    
    .site-header .flex {
        height: 60px;
        padding: 0 10px;
    }
    
    #mobile-menu {
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    .custom-logo {
        max-height: 40px;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Extra Small Mobile (up to 375px) */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .card-content {
        padding: 10px;
    }
    
    .site-header .flex {
        height: 55px;
        padding: 0 8px;
    }
    
    #mobile-menu {
        top: 55px;
        height: calc(100vh - 55px);
    }
    
    .custom-logo {
        max-height: 35px;
    }
}

/* =============================================================================
   TOUCH AND INTERACTION IMPROVEMENTS
   ============================================================================= */

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    .btn,
    #mobile-menu-button,
    .primary-navigation .menu a,
    #mobile-menu .menu a {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .card {
        transition: none;
    }
    
    .card:active {
        transform: scale(0.98);
    }
}

/* Hover effects only for devices that support hover */
@media (hover: hover) and (pointer: fine) {
    .card:hover {
        transform: translateY(-5px);
    }
    
    .btn:hover {
        transform: translateY(-2px);
    }
}

/* =============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================= */

/* Focus states */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .site-header {
        background: rgba(0, 0, 0, 0.95);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    #mobile-menu {
        background: #1f2937;
    }
    
    #mobile-menu .menu a {
        color: #f9fafb;
    }
    
    .card {
        background: #1f2937;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .card-title {
        color: #f9fafb;
    }
    
    .card-description {
        color: #d1d5db;
    }
}

/* Print styles */
@media print {
    .site-header,
    #mobile-menu,
    .btn,
    .hero-buttons {
        display: none !important;
    }
    
    .hero-section {
        background: none !important;
        color: #000 !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

