/* ====================
   RESPONSIVE IMPROVEMENTS
   ==================== */

/* Mobile-First Approach - Base styles for mobile, then enhance for larger screens */

/* Improved Mobile Navigation */
@media (max-width: 768px) {
    /* Better touch targets for mobile */
    .main-nav a,
    .dropdown > a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Improved dropdown behavior */
    .dropdown {
        width: 100%;
    }

    .dropdown-content {
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            max-height: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            max-height: 500px;
            transform: translateY(0);
        }
    }

    /* Better spacing for mobile content */
    .section {
        padding: 40px 15px;
    }

    /* Improved grid layouts for mobile */
    .features,
    .insights-grid,
    .jobs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .contact-info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Footer responsive */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-content {
        padding: 40px 20px 20px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    /* Better typography for mobile */
    h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.2rem;
    }

    p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .section-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    /* Improved button sizing for mobile */
    .btn,
    .toggle-btn,
    button {
        padding: 12px 20px;
        font-size: 1rem;
        min-height: 44px;
    }

    /* Better forms on mobile */
    .contact-form input,
    .contact-form textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px;
    }

    /* Improved slider for mobile */
    .slider {
        max-height: 40vh;
    }

    .slides img {
        height: 40vh;
    }

    .slider-nav button {
        font-size: 1.2rem;
        padding: 8px 12px;
    }

    /* Better contact section layout */
    .contact-wrapper {
        gap: 30px;
    }

    .contact-info,
    .contact-form {
        padding: 25px;
    }

    /* Improved feature cards */
    .feature {
        padding: 25px;
    }

    .feature i {
        font-size: 2rem;
    }

    /* Better project cards */
    .project img {
        height: 180px;
    }

    /* Improved footer for mobile */
    footer {
        padding: 25px 15px;
    }

    .footer-nav,
    .socials {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .socials {
        flex-direction: row;
        justify-content: center;
    }
}

/* Tablet specific improvements */
@media (min-width: 769px) and (max-width: 992px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .section {
        padding: 50px 30px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .slides img {
        height: 50vh;
    }
}

/* Small mobile specific */
@media (max-width: 480px) {
    .hero {
        padding: 40px 15px;
    }

    .hero h1 {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    .hero p {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .slider {
        max-height: 35vh;
    }

    .slides img {
        height: 35vh;
    }

    .feature {
        padding: 20px;
    }

    .project div {
        padding: 15px;
    }

    .contact-info,
    .contact-form {
        padding: 20px;
    }

    .section {
        padding: 30px 12px;
    }
}

/* Very small screens (312px - 365px) */
@media (max-width: 365px) {
    /* Header and navigation */
    .site-header {
        padding: 0.5rem 0.6rem;
        min-height: 60px;
    }
    
    body {
        padding-top: 60px;
    }
    
    .logo h2 {
        font-size: 0.85rem;
        line-height: 1.1;
    }
    
    .logo img {
        height: 35px;
    }
    
    .menu-toggle {
        padding: 0.5rem 0.6rem;
        font-size: 1rem;
    }
    
    /* Hero section */
    .hero {
        padding: 25px 10px;
    }
    
    .hero h1 {
        font-size: 1.3rem;
        line-height: 1.2;
        margin-bottom: 10px;
    }
    
    .hero p {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    /* Slider */
    .slider {
        max-height: 28vh;
        margin: 10px 0;
    }
    
    .slides img {
        height: 28vh;
    }
    
    .slider-nav button {
        width: 40px;
        height: 40px;
        font-size: 1.4em;
    }
    
    .slider-nav {
        padding: 0 10px;
    }
    
    .slider-dot {
        width: 8px;
        height: 8px;
    }
    
    .slider-dots {
        bottom: 10px;
        gap: 6px;
    }
    
    /* Sections */
    .section {
        padding: 20px 8px;
    }
    
    .section h2 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    
    .section-description {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    /* Funny box */
    .funny-box {
        padding: 12px 10px;
        margin-top: 15px;
    }
    
    .funny-box h3 {
        font-size: 1rem;
    }
    
    .funny-box p {
        font-size: 0.85rem;
    }
    
    .funny-box::before {
        font-size: 1.8em;
        top: 10px;
        right: 10px;
    }
    
    /* About section */
    .about-content p {
        font-size: 0.95rem;
    }
    
    .mission-box {
        padding: 15px;
        gap: 12px;
    }
    
    .mission-box i {
        font-size: 1.8rem;
    }
    
    .mission-box strong {
        font-size: 1rem;
    }
    
    /* Cards - all types */
    .feature,
    .insight-card,
    .job-card {
        padding: 15px 12px;
    }
    
    .feature h3,
    .insight-content h3,
    .job-header h3 {
        font-size: 1rem;
    }
    
    .feature i {
        font-size: 1.6rem;
    }
    
    .feature p,
    .insight-content p,
    .job-card p {
        font-size: 0.85rem;
    }
    
    /* Insight cards */
    .insight-image {
        height: 150px;
    }
    
    .insight-content {
        padding: 15px;
    }
    
    .insight-meta {
        font-size: 0.75rem;
        gap: 12px;
    }
    
    /* Job cards */
    .job-header {
        gap: 10px;
    }
    
    .job-header i {
        font-size: 1.5rem;
        padding: 12px;
    }
    
    .job-meta {
        font-size: 0.8rem;
        gap: 10px;
    }
    
    /* Projects and testimonials */
    .project {
        padding: 0;
    }
    
    .project div {
        padding: 12px;
    }
    
    .project strong {
        font-size: 1rem;
    }
    
    .project p {
        font-size: 0.85rem;
    }
    
    /* Buttons */
    .btn,
    .toggle-btn,
    .preview .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .btn-large {
        padding: 12px 24px !important;
        font-size: 0.95rem !important;
    }
    
    /* Contact section */
    .contact-info-item {
        padding: 20px 15px;
    }
    
    .contact-info-item i {
        font-size: 2rem;
    }
    
    .contact-info-item h3 {
        font-size: 1rem;
    }
    
    .contact-info-item p {
        font-size: 0.9rem;
    }
    
    /* Footer */
    .footer-content {
        padding: 30px 15px 15px;
    }
    
    .footer-column h3 {
        font-size: 1rem;
    }
    
    .footer-column p,
    .footer-links a,
    .footer-contact li {
        font-size: 0.85rem;
    }
    
    .footer-grid {
        gap: 20px;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .footer-bottom {
        padding: 15px 10px;
    }
    
    .footer-bottom p {
        font-size: 0.8rem;
    }
    
    .footer-tagline {
        font-size: 0.75rem !important;
    }
    
    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
    }
    
    * {
        max-width: 100%;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Typography adjustments */
    h1 {
        font-size: 1.3rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    p {
        font-size: 0.85rem;
    }
}

/* Specific optimization for 410px width (narrow phones) */
@media (max-width: 420px) and (min-width: 390px) {
    /* Logo adjustments */
    .logo h2 {
        font-size: 1rem;
        line-height: 1.2;
    }

    .logo img {
        height: 42px;
    }

    /* Header adjustments */
    .site-header {
        padding: 0.6rem 0.8rem;
        min-height: 65px;
    }

    body {
        padding-top: 65px;
    }

    /* Menu toggle */
    .menu-toggle {
        padding: 0.6rem 0.8rem;
        font-size: 1.1rem;
    }
    
    /* Navigation - ensure proper display */
    nav {
        gap: 0;
    }
    
    nav a {
        padding: 12px 8px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    /* Hero section */
    .hero {
        padding: 35px 12px;
        min-height: auto;
    }

    .hero h1 {
        font-size: 1.5rem;
        line-height: 1.25;
        margin-bottom: 12px;
    }

    .hero p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* Slider */
    .slider {
        max-height: 32vh;
        margin: 15px 0;
    }

    .slides img {
        height: 32vh;
        object-fit: cover;
    }

    .slider-nav button {
        padding: 6px 10px;
        font-size: 1.1rem;
    }

    /* Sections */
    .section {
        padding: 25px 10px;
    }

    .section h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    /* Features/Services - single column */
    .features {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature {
        padding: 18px;
    }

    .feature h3 {
        font-size: 1.1rem;
    }

    .feature i {
        font-size: 1.8rem;
    }
    
    /* Projects grid */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Buttons */
    .btn,
    .toggle-btn,
    .preview .btn {
        padding: 10px 18px;
        font-size: 0.95rem;
    }

    /* Funny box */
    .funny-box {
        padding: 16px;
        margin-top: 20px;
    }

    .funny-box h3 {
        font-size: 1.1rem;
    }

    .funny-box p {
        font-size: 0.9rem;
    }
    
    /* Footer adjustments */
    .footer {
        padding: 20px 12px;
        font-size: 0.9rem;
    }
    
    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
    }
    
    * {
        max-width: 100%;
    }
}

/* Large desktop improvements */
@media (min-width: 1200px) {
    .section {
        max-width: 1200px;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .features {
        grid-template-columns: repeat(3, 1fr);
        gap: 35px;
    }

    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

/* ====================
   ENHANCED ANIMATIONS
   ==================== */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Page entrance animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeInUp 0.6s ease-out;
}

/* Stagger animation for features */
.feature:nth-child(1) {
    animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

.feature:nth-child(2) {
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.feature:nth-child(3) {
    animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

.feature:nth-child(4) {
    animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

/* Hover effects for interactive elements */
.feature,
.project,
.testimonial-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature:hover,
.project:hover,
.testimonial-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Button hover effects */
.btn,
.toggle-btn,
button[type="submit"] {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before,
.toggle-btn::before,
button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before,
.toggle-btn:hover::before,
button[type="submit"]:hover::before {
    width: 300px;
    height: 300px;
}

/* Link animations */
a {
    transition: all 0.3s ease;
}

/* Image loading animation */
img {
    animation: imageLoad 0.5s ease-out;
}

@keyframes imageLoad {
    from {
        opacity: 0;
        filter: blur(5px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* Form focus animations */
input:focus,
textarea:focus {
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* ====================
   ACCESSIBILITY IMPROVEMENTS
   ==================== */

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

.skip-to-main:focus {
    top: 0;
}

/* 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;
        scroll-behavior: auto !important;
    }
}

/* ====================
   ENHANCED MOBILE MENU
   ==================== */

/* Overlay for mobile menu */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    /* Drawer slide-in itself is handled by .header-container's transform
       transition (see header.php); this file only adds item-level polish. */
    .main-nav a {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    .main-nav a:hover,
    .main-nav a:active {
        background: rgba(255, 255, 255, 0.15);
        padding-left: 1.5rem;
    }

    /* Mobile dropdown improvements */
    .dropdown > a::after {
        content: '▾';
        float: right;
        transition: transform 0.3s ease;
    }

    .dropdown.active > a::after {
        transform: rotate(180deg);
    }

    .dropdown-content {
        background: rgba(0, 0, 0, 0.2);
        border-left: 3px solid var(--accent-color);
    }

    .dropdown-content a {
        padding-left: 2rem;
        font-size: 0.9rem;
    }
}

/* ========================================
   RESPONSIVE: NEW SECTIONS
   ======================================== */

/* Blog Posts Grid */
@media (max-width: 768px) {
    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .blog-image {
        height: 180px;
    }
    
    .blog-content {
        padding: 20px;
    }
    
    .blog-content h3 {
        font-size: 1.1rem;
    }
    
    .blog-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* Why Choose Us Grid */
@media (max-width: 768px) {
    .why-choose-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .why-card {
        padding: 25px 20px;
    }
    
    .why-icon {
        width: 70px;
        height: 70px;
    }
    
    .why-icon i {
        font-size: 2rem;
    }
}

/* Payment Methods Grid */
@media (max-width: 768px) {
    .payment-methods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .payment-card {
        padding: 20px 15px;
    }
    
    .payment-logo {
        height: 50px;
    }
}

@media (max-width: 480px) {
    .blog-posts-grid {
        gap: 15px;
    }
    
    .blog-content {
        padding: 15px;
    }
    
    .blog-badge {
        font-size: 0.6rem;
        padding: 3px 10px;
    }
    
    .blog-btn {
        padding: 8px 18px;
        font-size: 0.8rem;
    }
    
    .payment-methods-grid {
        grid-template-columns: 1fr;
    }
    
    .why-choose-grid {
        gap: 15px;
    }
}

@media (max-width: 365px) {
    .blog-image {
        height: 150px;
    }
    
    .blog-content h3 {
        font-size: 1rem;
    }
    
    .blog-excerpt {
        font-size: 0.875rem;
    }
    
    .why-card {
        padding: 20px 15px;
    }
    
    .why-icon {
        width: 60px;
        height: 60px;
    }
    
    .why-icon i {
        font-size: 1.8rem;
    }
    
    .payment-logo {
        height: 45px;
    }
}

/* ====================
   LOADING STATES
   ==================== */

/* Loading spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Page loading overlay */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ====================
   UTILITY CLASSES
   ==================== */

/* Spacing utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-accent { color: var(--accent-color); }

/* Display utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flex utilities */
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* Responsive utilities */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
    .show-desktop { display: block !important; }
}

/* Container utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* Card utilities */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
