/* Responsive styles for all pages */

/* General responsive styles */
@media screen and (max-width: 768px) {
    /* Basic adjustments */
    body {
        padding-top: 60px; /* Space for fixed header */
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    .container {
        padding: 0 1rem;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Header and Navigation */
    header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: white;
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
        height: 60px;
    }
    
    .logo {
        z-index: 1001;
    }
    
    .nav-toggle {
        display: block !important;
        border: none;
        background: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--primary, #10b981);
        padding: 0.5rem;
    }
    
    .nav-toggle i,
    .nav-toggle span {
        display: inline-block;
        width: 25px;
        height: 2px;
        background-color: var(--primary, #10b981);
        position: relative;
        transition: all 0.3s ease;
    }
    
    .nav-toggle span:before,
    .nav-toggle span:after {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        background-color: var(--primary, #10b981);
        transition: all 0.3s ease;
    }
    
    .nav-toggle span:before {
        top: -8px;
    }
    
    .nav-toggle span:after {
        bottom: -8px;
    }
    
    nav ul {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        margin: 0;
        padding: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        overflow-y: auto;
        max-height: calc(100vh - 60px);
    }
    
    nav ul.show {
        display: flex !important;
    }
    /* Ensure nav.open (toggled by JS) also displays the nav container on mobile */
    nav.open {
        display: block !important;
    }
    /* If nav is open, ensure the UL inside displays flex for the list */
    nav.open ul {
        display: flex !important;
    }
    
    /* Ensure list items take full width */
    nav ul li {
        width: 100%;
    }
    
    /* Make links take full width for better touch targets */
    nav ul li a {
        width: 100%;
        display: block;
        padding: 1rem;
        color: #333;
        text-decoration: none;
        border-bottom: 1px solid #eee;
        box-sizing: border-box;
    }
    
    nav ul li:last-child a {
        border-bottom: none;
    }
    
    /* Active state styling */
    nav ul li a.active {
        background-color: var(--primary, #10b981);
        color: white;
    }
    
    nav ul li {
        text-align: center;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    nav ul li a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid #f0f0f0;
    }
    
    /* Hero section */
    .hero {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center;
        padding: 2rem 1rem !important;
        box-sizing: border-box !important;
    }

    .hero-content {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 0.5rem !important;
    }

    .hero-image {
        margin-top: 1.5rem;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 0.5rem !important;
    }

    .hero-image img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .button-group {
        justify-content: center !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    /* Grid layouts */
    .service-grid, 
    .projects-grid, 
    .overview-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Timeline specific styling for About page */
    .timeline {
        padding: 0;
        margin: 0 auto;
        max-width: 100%;
    }
    
    .timeline > div[style*="position: absolute; left: 50%"] {
        display: none; /* Hide vertical line on mobile */
    }
    
    .timeline-item {
        margin-bottom: 3rem !important;
    }
    
    .timeline-item > div {
        position: static !important;
        width: 100% !important;
        padding: 0 !important;
        text-align: center !important;
        margin-bottom: 1rem;
    }
    
    .timeline-item > div > div {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .timeline-item .timeline-dot {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        margin: 0 auto 1rem !important;
        transform: none !important;
        display: block !important;
        width: 16px !important;
        height: 16px !important;
    }
    
    [class*="timeline-item"] > div > div {
        padding: 1.5rem !important;
    }
    
    /* Improved timeline item styling */
    .timeline-item div[style*="background: rgba(255, 255, 255, 0.9);"] {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
        border-radius: 0.75rem !important;
        border-width: 1px !important;
    }
    
    /* Footer */
    .footer-container {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .footer-column {
        margin-bottom: 2rem;
    }
    
    /* Forms and contact */
    input, textarea, select {
        width: 100%;
    }
    
    .contact-sidebyside {
        flex-direction: column;
    }
}

/* Additional mobile styles for Journey timeline */
@media screen and (max-width: 768px) {
    /* Specific timeline fixes for about.html */
    .timeline {
        max-width: 100% !important;
    }
    
    /* All timeline items stack with consistent width */
    .timeline-item > div {
        width: 95% !important;
        box-sizing: border-box !important;
    }
    
    /* Timeline item content */
    .timeline-item > div > div {
        padding: 1.5rem !important;
    }
    
    /* Award item special handling */
    .timeline-item:nth-child(3) > div > div {
        padding-top: 2rem !important;
    }
    
    /* Timeline dots with better positioning */
    .timeline-item div[style*="position: absolute; left: 50%;"] {
        position: relative !important;
        display: block !important;
        margin: 1rem auto !important;
        left: auto !important;
        transform: none !important;
    }
    
    /* For the gold medal one */
    .timeline-item div[style*="background: gold"] {
        margin: 1rem auto !important;
    }
    
    /* Fix for any sticky positioning that could affect mobile layout */
    * {
        position: relative;
    }
    
    /* Ensure all timeline content is visible */
    .timeline-item h3, 
    .timeline-item p {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Medium screens */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
    
    .overview-grid,
    .service-grid,
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
