/* =====================================================
   TG Construction - Responsive CSS
   ===================================================== */

/* Extra Large Devices */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
}

/* Large Devices */
@media (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .nav-menu {
        gap: 25px;
    }
}

/* Medium Devices */
@media (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    /* Body lock when menu is open */
    body.menu-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
    }
    
    /* Prevent horizontal scroll on mobile */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile Navigation */
    .header-inner {
        position: relative;
    }
    
    .main-nav {
        display: none;
    }
    
    /* New Mobile Nav */
    .mobile-nav-container {
        display: block;
    }
    
    .menu-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 1000;
    }
    
    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-nav {
        display: flex !important;
        flex-direction: column;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        width: 300px !important;
        height: 100vh !important;
        background-color: var(--light-color);
        padding: 20px 25px 30px;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease, visibility 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
        transform: translateX(110%);
        visibility: hidden;
        pointer-events: none;
        -webkit-transform: translateX(110%);
    }
    
    .mobile-nav.active {
        transform: translateX(0);
        -webkit-transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }
    
    /* Mobile Nav Header */
    .mobile-nav-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding-bottom: 20px;
        margin-bottom: 15px;
        border-bottom: 2px solid var(--secondary-color);
    }
    
    .mobile-nav-logo {
        height: 50px;
        width: auto;
    }
    
    .mobile-nav-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--primary-color);
        line-height: 1.3;
        margin: 0;
    }
    
    .mobile-nav-menu {
        list-style: none;
        padding: 0;
        margin: 0 0 20px 0;
    }
    
    .mobile-nav-menu li {
        border-bottom: 1px solid var(--border-color);
    }
    
    .mobile-nav-menu li a {
        display: block;
        padding: 15px 0;
        color: var(--dark-color);
        text-decoration: none;
        font-size: 16px;
        font-weight: 600;
    }
    
    .mobile-nav-menu li a:hover,
    .mobile-nav-menu li a.active {
        color: var(--primary-color);
    }
    
    /* Mobile Nav Button */
    .mobile-nav-btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 25px;
    }
    
    /* Mobile Nav Contact Info */
    .mobile-nav-info {
        margin-bottom: 20px;
    }
    
    .mobile-nav-info-item {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 8px 0;
        font-size: 13px;
        color: var(--text-color);
    }
    
    .mobile-nav-info-item i {
        color: var(--primary-color);
        width: 16px;
        margin-top: 3px;
    }
    
    /* Mobile Nav Social */
    .mobile-nav-social {
        display: flex;
        gap: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--border-color);
    }
    
    .mobile-nav-social a {
        width: 36px;
        height: 36px;
        background-color: var(--primary-color);
        color: var(--light-color);
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 14px;
        transition: var(--transition);
    }
    
    .mobile-nav-social a:hover {
        background-color: var(--secondary-color);
        color: var(--dark-color);
    }
    
    .mobile-menu-toggle {
        display: flex;
        z-index: 1002;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .header-btn {
        display: none;
    }
    
    /* Logo text on mobile header */
    .logo-text {
        display: block;
        font-size: 12px;
        font-weight: 700;
        color: var(--primary-color);
        line-height: 1.2;
        max-width: 150px;
    }
    
    .logo {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .logo img {
        height: 40px;
        width: auto;
    }
    
    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Hero */
    .hero {
        min-height: 80vh;
    }
    
    .hero-title {
        font-size: 2.75rem;
    }
    
    .hero-text {
        font-size: 16px;
    }
    
    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .about-images {
        order: -1;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .about-content {
        text-align: center;
    }
    
    .about-content .section-subtitle,
    .about-content .section-title {
        text-align: center;
    }
    
    .about-features {
        justify-content: center;
    }
    
    .experience-box {
        margin: 20px auto 0;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Projects */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Team */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* CTA */
    .cta-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    
    /* Values */
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Certifications */
    .certifications-grid {
        grid-template-columns: 1fr;
    }
    
    /* Service Detail */
    .service-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .service-sidebar {
        order: -1;
    }
}

/* Small Devices */
@media (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Top Bar */
    .top-bar {
        display: none;
    }
    
    /* Hero */
    .hero {
        min-height: 70vh;
        padding: 120px 0 60px;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 13px;
        letter-spacing: 2px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        padding: 30px 25px;
    }
    
    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-image {
        height: 280px;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 3rem;
    }
    
    /* Team */
    .team-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer {
        padding-top: 50px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* About */
    .about-features {
        grid-template-columns: 1fr;
    }
    
    .experience-box {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    /* Contact */
    .contact-form {
        padding: 30px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Page Header */
    .page-header {
        padding: 120px 0 60px;
    }
    
    .page-header-title {
        font-size: 2rem;
    }
    
    /* Values */
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    /* Timeline */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item,
    .timeline-item:nth-child(even) {
        padding-left: 60px;
        padding-right: 0;
        justify-content: flex-start;
    }
    
    .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }
    
    .timeline-year {
        left: 0;
        transform: none;
        padding: 5px 10px;
        font-size: 12px;
    }
    
    /* Project Gallery */
    .project-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .project-gallery img {
        height: 180px;
    }
    
    /* Project Meta */
    .project-meta {
        gap: 20px;
    }
}

/* Extra Small Devices */
@media (max-width: 575.98px) {
    .container {
        padding: 0 15px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .section {
        padding: 50px 0;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 12px;
        letter-spacing: 2px;
    }
    
    /* Hero */
    .hero-title {
        font-size: 1.875rem;
        line-height: 1.3;
    }
    
    .hero-text {
        font-size: 15px;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 25px;
        font-size: 13px;
    }
    
    /* Stats */
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-text {
        font-size: 14px;
    }
    
    /* Service Card */
    .service-icon {
        width: 70px;
        height: 70px;
    }
    
    .service-icon i {
        font-size: 28px;
    }
    
    /* Project Gallery */
    .project-gallery {
        grid-template-columns: 1fr;
    }
    
    .project-gallery img {
        height: 220px;
    }
    
    /* Contact Info */
    .contact-info-box {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-info-icon {
        margin: 0 auto;
    }
    
    /* Certification Card */
    .certification-card {
        flex-direction: column;
        text-align: center;
    }
    
    .certification-icon {
        margin: 0 auto;
    }
    
    /* Scroll Top */
    .scroll-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
    
    /* Logo */
    .logo img {
        height: 50px;
    }
    
    .footer-logo img {
        height: 60px;
    }
}

/* Print Styles */
@media print {
    .top-bar,
    .header,
    .footer,
    .scroll-top,
    .btn {
        display: none !important;
    }
    
    .hero {
        min-height: auto;
        padding: 50px 0;
    }
    
    .section {
        padding: 30px 0;
    }
    
    body {
        font-size: 12pt;
        color: #000;
    }
    
    a {
        text-decoration: underline;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 0 0 2px #000;
        --shadow-hover: 0 0 0 3px #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Users can enable this if needed */
}
