/* Custom CSS for Nexus Consortium Website - Mobile First Approach */

/* Mobile-first base styles */
body {
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Mobile-first typography */
h1 {
    font-size: 1.875rem; /* 30px */
    line-height: 1.2;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem; /* 24px */
    line-height: 1.3;
    font-weight: 600;
}

h3 {
    font-size: 1.25rem; /* 20px */
    line-height: 1.4;
    font-weight: 600;
}

h4 {
    font-size: 1.125rem; /* 18px */
    line-height: 1.4;
    font-weight: 600;
}

/* Responsive typography for larger screens */
@media (min-width: 640px) {
    h1 {
        font-size: 2.25rem; /* 36px */
    }
    
    h2 {
        font-size: 1.875rem; /* 30px */
    }
    
    h3 {
        font-size: 1.5rem; /* 24px */
    }
}

@media (min-width: 1024px) {
    h1 {
        font-size: 3rem; /* 48px */
    }
    
    h2 {
        font-size: 2.25rem; /* 36px */
    }
    
    h3 {
        font-size: 1.875rem; /* 30px */
    }
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile-first spacing and layout utilities */
.container-mobile {
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 100%;
}

@media (min-width: 640px) {
    .container-mobile {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container-mobile {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Touch-friendly interactive elements */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile-optimized buttons */
.btn-mobile {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-mobile:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive grid system */
.grid-mobile {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-mobile {
        gap: 1.5rem;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-mobile {
        gap: 2rem;
        grid-template-columns: repeat(3, 1fr);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Custom button styles */
.btn-primary {
    @apply bg-primary-600 text-white px-6 py-3 rounded-lg font-semibold hover:bg-primary-700 transition-colors;
}

.btn-secondary {
    @apply bg-secondary-600 text-white px-6 py-3 rounded-lg font-semibold hover:bg-secondary-700 transition-colors;
}

.btn-outline {
    @apply border-2 border-primary-600 text-primary-600 px-6 py-3 rounded-lg font-semibold hover:bg-primary-600 hover:text-white transition-colors;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Loading spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form styles */
.form-input {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent text-gray-900 bg-white;
}

.form-textarea {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent resize-none text-gray-900 bg-white;
}

.form-select {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white text-gray-900;
}

/* General form input overrides */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
    @apply text-gray-900 bg-white;
}

/* Placeholder text styling */
input::placeholder,
textarea::placeholder {
    @apply text-gray-500;
}

/* Focus state text */
input:focus,
textarea:focus,
select:focus {
    @apply text-gray-900;
}

/* Alert styles */
.alert {
    @apply p-4 rounded-lg mb-4;
}

.alert-success {
    @apply bg-[#2d7a8e]/10 border border-[#2d7a8e]/20 text-[#1a5f7a];
}

.alert-error {
    @apply bg-red-100 border border-red-200 text-red-800;
}

.alert-warning {
    @apply bg-yellow-100 border border-yellow-200 text-yellow-800;
}

.alert-info {
    @apply bg-[#2d7a8e]/10 border border-[#2d7a8e]/20 text-[#1a5f7a];
}

/* Navigation dropdown animation */
.dropdown-menu {
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-menu {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Mobile-first responsive improvements */
@media (max-width: 639px) {
    /* Mobile-specific adjustments */
    .hero-text {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    /* Stack elements vertically on mobile */
    .mobile-stack {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Full-width buttons on mobile */
    .mobile-full-width {
        width: 100%;
    }
    
    /* Reduce padding on mobile */
    .mobile-padding {
        padding: 1rem;
    }
    
    /* Smaller cards on mobile */
    .mobile-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Hide desktop-only content */
    .desktop-only {
        display: none;
    }
    
    /* Mobile navigation improvements */
    .mobile-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
    
    /* Mobile form improvements */
    .mobile-form input,
    .mobile-form textarea,
    .mobile-form select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem;
        border-radius: 0.5rem;
    }
    
    /* Ensure touch targets are adequate */
    .mobile-touch {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Tablet adjustments */
@media (min-width: 640px) and (max-width: 1023px) {
    .tablet-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .tablet-padding {
        padding: 1.5rem;
    }
}

/* Desktop enhancements */
@media (min-width: 1024px) {
    .desktop-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .desktop-padding {
        padding: 2rem;
    }
    
    /* Show desktop-only content */
    .mobile-only {
        display: none;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
}

/* Accessibility improvements */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-to-content:focus {
    top: 6px;
}

/* Focus styles for better accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Ensure form inputs have proper text color */
input:focus,
textarea:focus,
select:focus {
    color: #1f2937 !important; /* gray-800 */
    background-color: #ffffff !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-primary-600 {
        background-color: #000 !important;
    }
    
    .text-primary-600 {
        color: #000 !important;
    }
    
    .border-primary-600 {
        border-color: #000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Enhanced Mobile-First Utilities */

/* Form step improvements for mobile */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeInUp 0.3s ease-in-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile-first progress indicator */
.progress-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .progress-indicator {
        flex-direction: row;
        text-align: left;
    }
}

/* Mobile card layouts */
.mobile-card {
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background: white;
    overflow: hidden;
}

/* Mobile-optimized grid */
.mobile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .mobile-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .mobile-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Enhanced touch targets for mobile */
a, button, input, select, textarea {
    -webkit-tap-highlight-color: rgba(45, 122, 142, 0.3);
}

/* Mobile-first hero sections */
.hero-mobile {
    padding: 4rem 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-mobile {
        padding: 6rem 2rem;
    }
}

@media (min-width: 1024px) {
    .hero-mobile {
        padding: 8rem 4rem;
    }
}

/* Mobile service cards */
.service-card-mobile {
    padding: 1.5rem;
    border-radius: 16px;
    background: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.service-card-mobile:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) {
    .service-card-mobile {
        padding: 2rem;
    }
}

/* Mobile contact sections */
.contact-mobile {
    padding: 3rem 1rem;
}

@media (min-width: 768px) {
    .contact-mobile {
        padding: 4rem 2rem;
    }
}

/* Mobile footer optimization */
.footer-mobile {
    padding: 2rem 1rem;
}

.footer-mobile .footer-section {
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .footer-mobile {
        padding: 3rem 2rem;
    }
    
    .footer-mobile .footer-section {
        margin-bottom: 0;
    }
}

/* Mobile navigation improvements */
.mobile-nav-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

/* Mobile-responsive container */
.mobile-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .mobile-container {
        max-width: 640px;
        padding: 0 1.5rem;
    }
}

@media (min-width: 768px) {
    .mobile-container {
        max-width: 768px;
        padding: 0 2rem;
    }
}

@media (min-width: 1024px) {
    .mobile-container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .mobile-container {
        max-width: 1280px;
    }
}
