/* ==========================================================================
   Beijing Hengda Zhonghe Human Resources Management Co., Ltd.
   Responsive Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Extra Large Screens (1400px and above)
   -------------------------------------------------------------------------- */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: var(--font-size-7xl);
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Large Screens (1200px - 1399px)
   -------------------------------------------------------------------------- */
@media (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
    
    .hero-title {
        font-size: var(--font-size-6xl);
    }
    
    .hero-content {
        gap: var(--spacing-3xl);
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xl);
    }
    
    .stats-grid {
        gap: var(--spacing-2xl);
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Medium-Large Screens (992px - 1199px)
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: var(--font-size-5xl);
    }
    
    .hero-description {
        font-size: var(--font-size-lg);
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
    
    .stats-number {
        font-size: var(--font-size-4xl);
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-3xl);
    }
    
    .app-showcase-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-3xl);
    }
    
    .app-preview {
        order: -1;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-2xl);
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Tablet Screens (768px - 991px)
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
    :root {
        --font-size-6xl: 3rem;
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.75rem;
    }
    
    .container {
        max-width: 720px;
    }
    
    .section {
        padding: var(--spacing-3xl) 0;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--color-white);
        flex-direction: column;
        justify-content: flex-start;
        padding: var(--spacing-4xl) var(--spacing-xl);
        gap: var(--spacing-lg);
        box-shadow: var(--shadow-xl);
        transition: right 0.3s ease;
        z-index: var(--z-index-modal);
    }
    
    .nav-menu.open {
        right: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero */
    .hero {
        min-height: auto;
        padding: var(--spacing-4xl) 0;
        padding-top: calc(var(--spacing-4xl) + 80px);
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-text {
        order: 1;
    }
    
    .hero-visual {
        order: 0;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero-stats {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: var(--spacing-2xl);
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-item {
        flex: 1 1 120px;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        padding: var(--spacing-2xl);
    }
    
    /* App Showcase */
    .app-phone-mockup {
        width: 260px;
        height: 520px;
    }
    
    .app-stores {
        flex-direction: column;
    }
    
    .store-button {
        justify-content: center;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-item {
        padding: var(--spacing-xl);
    }
    
    /* Stats */
    .stats-section {
        padding: var(--spacing-3xl) 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    /* News */
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    /* Timeline */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        grid-template-columns: 1fr;
        padding-left: 50px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        text-align: left;
    }
    
    .timeline-dot {
        left: 20px;
    }
    
    /* Team */
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    /* Values */
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    /* Legal */
    .legal-content {
        padding: var(--spacing-3xl) var(--spacing-lg);
    }
    
    .legal-content h2 {
        font-size: var(--font-size-2xl);
    }
}

/* --------------------------------------------------------------------------
   Mobile Screens (576px - 767px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    :root {
        --font-size-6xl: 2.5rem;
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.75rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
        
        --spacing-4xl: 4rem;
        --spacing-3xl: 3rem;
        --spacing-2xl: 2rem;
    }
    
    .container {
        max-width: 540px;
        padding: 0 var(--spacing-lg);
    }
    
    /* Hero */
    .hero-title {
        font-size: var(--font-size-4xl);
    }
    
    .hero-badge {
        font-size: var(--font-size-xs);
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .hero-stats {
        padding: var(--spacing-lg);
        gap: var(--spacing-md);
    }
    
    .stat-number {
        font-size: var(--font-size-2xl);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-number {
        font-size: var(--font-size-3xl);
    }
    
    /* Page Header */
    .page-header {
        padding-top: calc(var(--spacing-3xl) + 60px);
    }
    
    .page-header h1 {
        font-size: var(--font-size-3xl);
    }
    
    .breadcrumb {
        flex-wrap: wrap;
    }
    
    /* CTA */
    .cta-buttons {
        flex-direction: column;
    }
    
    /* App Phone Mockup */
    .app-phone-mockup {
        width: 220px;
        height: 440px;
        border-radius: 30px;
    }
    
    .app-screen {
        border-radius: 24px;
    }
    
    /* Contact */
    .contact-info,
    .contact-form {
        padding: var(--spacing-xl);
    }
    
    .contact-item {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    /* Form */
    .form-group {
        margin-bottom: var(--spacing-lg);
    }
    
    /* Timeline */
    .timeline-content {
        padding: var(--spacing-lg);
    }
    
    .timeline-year {
        font-size: var(--font-size-xl);
    }
    
    .timeline-title {
        font-size: var(--font-size-lg);
    }
    
    /* Legal */
    .legal-content h2 {
        font-size: var(--font-size-xl);
    }
    
    .legal-content h3 {
        font-size: var(--font-size-lg);
    }
    
    .legal-content p {
        font-size: var(--font-size-base);
    }
}

/* --------------------------------------------------------------------------
   Small Mobile Screens (up to 575px)
   -------------------------------------------------------------------------- */
@media (max-width: 575px) {
    :root {
        --font-size-6xl: 2rem;
        --font-size-5xl: 1.75rem;
        --font-size-4xl: 1.5rem;
        --font-size-3xl: 1.25rem;
        --font-size-2xl: 1.125rem;
        --font-size-xl: 1rem;
        
        --spacing-4xl: 3rem;
        --spacing-3xl: 2rem;
        --spacing-2xl: 1.5rem;
        --spacing-xl: 1rem;
    }
    
    .container {
        max-width: 100%;
        padding: 0 var(--spacing-md);
    }
    
    .section {
        padding: var(--spacing-2xl) 0;
    }
    
    /* Hero */
    .hero {
        padding: var(--spacing-3xl) 0;
        padding-top: calc(var(--spacing-3xl) + 60px);
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-description {
        font-size: var(--font-size-base);
    }
    
    .hero-stats {
        flex-direction: column;
        width: 100%;
    }
    
    .stat-item {
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--color-gray-200);
    }
    
    .stat-item:last-child {
        border-bottom: none;
    }
    
    /* Service Card */
    .service-card {
        padding: var(--spacing-xl);
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
    }
    
    .service-icon svg {
        width: 30px;
        height: 30px;
    }
    
    /* Feature Icon */
    .feature-icon {
        width: 80px;
        height: 80px;
    }
    
    .feature-icon svg {
        width: 40px;
        height: 40px;
    }
    
    /* Value Card */
    .value-card {
        padding: var(--spacing-xl);
    }
    
    .value-icon {
        width: 80px;
        height: 80px;
    }
    
    .value-icon svg {
        width: 40px;
        height: 40px;
    }
    
    /* News Card */
    .news-content {
        padding: var(--spacing-lg);
    }
    
    /* Contact */
    .contact-info h3,
    .contact-form h3 {
        font-size: var(--font-size-xl);
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-xl);
    }
    
    .footer-title {
        margin-bottom: var(--spacing-md);
    }
    
    .footer-legal {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    /* Page Header */
    .page-header {
        padding-top: calc(var(--spacing-2xl) + 60px);
    }
    
    .page-header h1 {
        font-size: var(--font-size-2xl);
    }
    
    /* App Phone */
    .app-phone-mockup {
        width: 180px;
        height: 360px;
        border-radius: 24px;
        padding: 8px;
    }
    
    .app-screen {
        border-radius: 18px;
        font-size: var(--font-size-base);
    }
}

/* --------------------------------------------------------------------------
   Touch Device Optimizations
   -------------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .hover-lift:hover {
        transform: none;
    }
    
    .hover-scale:hover {
        transform: none;
    }
    
    /* Make buttons larger for touch */
    .btn {
        padding: var(--spacing-md) var(--spacing-xl);
        min-height: 48px;
    }
    
    /* Add active states */
    .btn:active {
        transform: scale(0.98);
    }
    
    /* Disable smooth scroll on touch */
    html {
        scroll-behavior: auto;
    }
}

/* --------------------------------------------------------------------------
   High DPI / Retina Displays
   -------------------------------------------------------------------------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina */
    .hero-background::before {
        background-size: 50px 50px;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
    .header,
    .footer,
    .hero,
    .cta-section,
    .scroll-progress,
    .scroll-indicator,
    .nav-toggle {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
    }
    
    .section {
        padding: 20pt 0;
    }
    
    a {
        text-decoration: underline;
    }
    
    .legal-content {
        padding: 0;
    }
    
    .legal-content h2 {
        page-break-before: always;
    }
    
    .legal-content h2:first-of-type {
        page-break-before: avoid;
    }
}

/* --------------------------------------------------------------------------
   Dark Mode Support (if needed)
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode styles if required */
}

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

/* --------------------------------------------------------------------------
   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;
    }
    
    .particle {
        animation: none;
    }
    
    .scroll-indicator {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
   Large Touch Targets (Accessibility)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .nav-link {
        padding: var(--spacing-md);
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .service-card,
    .news-card,
    .team-card {
        cursor: pointer;
    }
    
    .form-input,
    .form-textarea {
        min-height: 48px;
    }
}

/* --------------------------------------------------------------------------
   Landscape Orientation on Mobile
   -------------------------------------------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-2xl) 0;
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-stats {
        flex-direction: row;
    }
}

/* --------------------------------------------------------------------------
   Ultra-Wide Screens (1800px and above)
   -------------------------------------------------------------------------- */
@media (min-width: 1800px) {
    :root {
        --container-max-width: 1600px;
        --font-size-base: 1.125rem;
    }
    
    .hero-title {
        font-size: var(--font-size-7xl);
    }
    
    .section {
        padding: var(--spacing-5xl) 0;
    }
}
