/* ========================================
   Beijing Longyu Construction Engineering Co., Ltd.
   Responsive Design - Mobile & Tablet
   ======================================== */

/* Extra Large Screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .section-title {
        font-size: 3.2rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktop */
@media (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
        padding: 0 1.5rem;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .section-title {
        font-size: 2.8rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-menu {
        gap: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 3.5rem;
    }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
    .container {
        max-width: 720px;
    }
    
    h1 {
        font-size: 2.8rem;
    }
    
    h2 {
        font-size: 2.3rem;
    }
    
    h3 {
        font-size: 1.8rem;
    }
    
    .hero {
        padding: 140px 0 100px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section {
        padding: 100px 0;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-description {
        font-size: 1.1rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    .services-grid,
    .news-grid,
    .testimonials-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    
    .app-features {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .culture-values {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-header {
        padding: 160px 0 80px;
    }
    
    .page-title {
        font-size: 2.8rem;
    }
    
    .legal-content {
        padding: 2.5rem;
    }
    
    .legal-content h1 {
        font-size: 2.2rem;
    }
    
    .legal-content h2 {
        font-size: 1.6rem;
    }
}

/* Tablet Portrait */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    .nav-container {
        padding: 1rem 1.5rem;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        font-size: 1.8rem;
        padding: 1rem;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .hero {
        padding: 120px 0 80px;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .app-features {
        grid-template-columns: 1fr;
    }
    
    .culture-values {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-form {
        padding: 2rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-contact p {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-bottom {
        padding-top: 1.5rem;
    }
    
    .page-header {
        padding: 140px 0 70px;
    }
    
    .page-title {
        font-size: 2.5rem;
    }
    
    .page-subtitle {
        font-size: 1.1rem;
    }
    
    .legal-content {
        padding: 2rem 1.5rem;
    }
}

/* Mobile Landscape */
@media (max-width: 767px) {
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    h4 {
        font-size: 1.3rem;
    }
    
    .section {
        padding: 80px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-badge {
        font-size: 0.75rem;
        padding: 0.4rem 1.2rem;
    }
    
    .section-header {
        margin-bottom: 2.5rem;
    }
    
    .hero {
        padding: 100px 0 60px;
        min-height: auto;
    }
    
    .hero-badge {
        font-size: 0.8rem;
        padding: 0.6rem 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        gap: 1rem;
    }
    
    .btn {
        padding: 0.9rem 2rem;
        font-size: 0.95rem;
    }
    
    .stats-section {
        padding: 60px 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .stat-item {
        padding: 1rem 0.5rem;
    }
    
    .stat-number {
        font-size: 2.8rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .service-card {
        padding: 2rem;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1.2rem;
    }
    
    .service-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .service-title {
        font-size: 1.4rem;
    }
    
    .news-card {
        margin-bottom: 1.5rem;
    }
    
    .news-image {
        height: 200px;
    }
    
    .news-content {
        padding: 1.5rem;
    }
    
    .news-title {
        font-size: 1.3rem;
    }
    
    .testimonial-card {
        padding: 2rem;
    }
    
    .testimonial-text {
        font-size: 1rem;
    }
    
    .testimonial-author {
        flex-direction: column;
        text-align: center;
    }
    
    .culture-value {
        padding: 2rem;
    }
    
    .culture-icon {
        width: 80px;
        height: 80px;
    }
    
    .culture-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .contact-card {
        padding: 2rem;
    }
    
    .contact-icon {
        width: 70px;
        height: 70px;
    }
    
    .contact-icon svg {
        width: 35px;
        height: 35px;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-input,
    .form-textarea {
        padding: 0.9rem;
        font-size: 0.95rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .footer {
        padding: 60px 0 30px;
    }
    
    .footer-section h4 {
        font-size: 1.2rem;
    }
    
    .footer-links li {
        margin-bottom: 0.5rem;
    }
    
    .footer-social {
        gap: 0.8rem;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }
    
    .page-header {
        padding: 120px 0 60px;
    }
    
    .page-title {
        font-size: 2.2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .legal-page {
        padding: 120px 0 60px;
    }
    
    .legal-content {
        padding: 1.5rem 1rem;
    }
    
    .legal-content h1 {
        font-size: 1.8rem;
    }
    
    .legal-content h2 {
        font-size: 1.4rem;
        margin-top: 2rem;
    }
    
    .legal-content h3 {
        font-size: 1.2rem;
    }
    
    .legal-content p,
    .legal-content li {
        font-size: 0.95rem;
    }
    
    .scroll-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
    
    .scroll-top svg {
        width: 20px;
        height: 20px;
    }
}

/* Mobile Portrait */
@media (max-width: 479px) {
    .container {
        padding: 0 0.75rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    h4 {
        font-size: 1.15rem;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    .hero {
        padding: 100px 0 50px;
    }
    
    .hero-badge {
        font-size: 0.7rem;
        padding: 0.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .hero-buttons {
        width: 100%;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .service-title {
        font-size: 1.25rem;
    }
    
    .service-description {
        font-size: 0.95rem;
    }
    
    .news-image {
        height: 180px;
    }
    
    .news-content {
        padding: 1.2rem;
    }
    
    .news-title {
        font-size: 1.15rem;
    }
    
    .news-excerpt {
        font-size: 0.9rem;
    }
    
    .testimonial-card {
        padding: 1.5rem;
    }
    
    .testimonial-quote {
        font-size: 2.5rem;
    }
    
    .testimonial-text {
        font-size: 0.95rem;
    }
    
    .culture-value {
        padding: 1.5rem;
    }
    
    .contact-card {
        padding: 1.5rem;
    }
    
    .contact-title {
        font-size: 1.3rem;
    }
    
    .contact-info {
        font-size: 0.95rem;
    }
    
    .contact-form {
        padding: 1.2rem;
    }
    
    .form-label {
        font-size: 0.95rem;
    }
    
    .form-input,
    .form-textarea {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 50px 0 25px;
    }
    
    .footer-section h4 {
        font-size: 1.1rem;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    .footer-bottom p {
        font-size: 0.8rem;
    }
    
    .page-header {
        padding: 100px 0 50px;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
    
    .legal-page {
        padding: 100px 0 50px;
    }
    
    .legal-content {
        padding: 1.2rem 0.8rem;
    }
    
    .legal-content h1 {
        font-size: 1.6rem;
    }
    
    .legal-content h2 {
        font-size: 1.25rem;
        margin-top: 1.5rem;
    }
    
    .legal-content h3 {
        font-size: 1.1rem;
    }
    
    .legal-content p,
    .legal-content li {
        font-size: 0.9rem;
    }
    
    .scroll-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }
    
    .scroll-top svg {
        width: 18px;
        height: 18px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .btn:focus {
        transform: none;
    }
    
    .service-card:hover {
        transform: none;
    }
    
    .news-card:hover {
        transform: none;
    }
    
    .social-link:hover {
        transform: none;
    }
    
    .nav-link:hover {
        color: var(--text-primary);
    }
    
    .nav-link:hover::after {
        width: 0;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero::before {
        background: radial-gradient(circle at 30% 50%, rgba(201, 169, 98, 0.08) 0%, transparent 50%),
                    radial-gradient(circle at 70% 80%, rgba(201, 169, 98, 0.06) 0%, transparent 40%);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #1a1a1a;
        --secondary-color: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
    }
}

/* Reduced Motion */
@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;
    }
    
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
    
    .stagger-item {
        opacity: 1;
        transform: none;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .hero,
    .footer,
    .scroll-top,
    .loading-overlay {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        padding: 20px 0;
    }
    
    .legal-content {
        background: white;
        border: 1px solid #ddd;
    }
    
    .legal-content h1,
    .legal-content h2,
    .legal-content h3 {
        color: black;
        page-break-after: avoid;
    }
    
    .service-card,
    .news-card,
    .testimonial-card {
        border: 1px solid #ddd;
        background: white;
        page-break-inside: avoid;
    }
}

/* Accessibility - Focus Visible */
@media (focus-visible) {
    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    textarea:focus-visible {
        outline: 2px solid var(--accent-color);
        outline-offset: 2px;
    }
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Landscape Mode on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 80px 0 40px;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .btn {
        width: auto;
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .stats-section {
        padding: 40px 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .page-header {
        padding: 80px 0 40px;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
}
