/* WeTheNorth Space Station - Responsive Design */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .section-container {
        max-width: 1600px;
    }
    
    .hero-title .title-main {
        font-size: 6rem;
    }
    
    .space-station-model {
        width: 400px;
        height: 400px;
    }
    
    .feature-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop (1024px - 1399px) */
@media (max-width: 1399px) and (min-width: 1024px) {
    .nav-constellation {
        gap: var(--space-lg);
    }
    
    .hero-content {
        gap: var(--space-2xl);
    }
    
    .space-station-model {
        width: 280px;
        height: 280px;
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Landscape (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    /* Navigation */
    .nav-container {
        padding: 0 var(--space-md);
    }
    
    .nav-constellation {
        gap: var(--space-md);
    }
    
    .nav-star {
        width: 10px;
        height: 10px;
    }
    
    .star-label {
        font-size: 0.7rem;
        bottom: -25px;
    }
    
    /* Layout Changes */
    .hero-content,
    .trading-overview,
    .security-overview,
    .comm-overview,
    .docking-overview {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
        text-align: center;
    }
    
    .research-data {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    /* Hero Section */
    .space-station-model {
        width: 250px;
        height: 250px;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    /* Components */
    .feature-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    /* Sticky Elements */
    .status-panel {
        position: static;
        margin-top: var(--space-xl);
        right: auto;
        bottom: auto;
    }
    
    .trading-stats,
    .security-monitor,
    .comm-interface,
    .docking-visual {
        position: static;
        top: auto;
    }
    
    /* Interface Adjustments */
    .interface-screen {
        height: 400px;
    }
    
    .docking-bay-model {
        width: 200px;
        height: 250px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xl);
    }
}

/* Tablet Portrait (481px - 767px) */
@media (max-width: 767px) and (min-width: 481px) {
    /* Navigation */
    .nav-container {
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--space-md);
    }
    
    .nav-constellation {
        order: 2;
        gap: var(--space-sm);
    }
    
    .nav-controls {
        order: 3;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
    
    .logo-subtitle {
        font-size: 0.65rem;
    }
    
    /* Typography */
    .hero-title .title-main {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Layout */
    .space-section {
        padding: var(--space-2xl) 0;
    }
    
    .section-container {
        padding: 0 var(--space-md);
    }
    
    /* Hero Section */
    .space-station-model {
        width: 220px;
        height: 220px;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }
    
    .cosmic-button {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    /* Components */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .process-steps {
        gap: var(--space-md);
    }
    
    .process-step {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
    }
    
    .step-number {
        align-self: center;
    }
    
    /* Interface Elements */
    .interface-screen {
        height: 350px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .message-input {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .cosmic-input {
        width: 100%;
    }
    
    /* Docking Bay */
    .docking-actions {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }
    
    .docking-bay-model {
        width: 180px;
        height: 220px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .coordinate-item,
    .regulation-item {
        flex-direction: column;
        text-align: center;
        gap: var(--space-xs);
    }
}

/* Mobile (320px - 480px) */
@media (max-width: 480px) {
    /* Base Adjustments */
    :root {
        --space-xs: 0.2rem;
        --space-sm: 0.4rem;
        --space-md: 0.8rem;
        --space-lg: 1.2rem;
        --space-xl: 1.6rem;
        --space-2xl: 2.4rem;
        --space-3xl: 3.2rem;
    }
    
    /* Navigation */
    .nav-container {
        padding: var(--space-sm);
    }
    
    .nav-constellation {
        gap: var(--space-xs);
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-star {
        width: 8px;
        height: 8px;
    }
    
    .star-label {
        font-size: 0.6rem;
        bottom: -20px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .logo-subtitle {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }
    
    /* Typography */
    .hero-title .title-main {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    .title-line {
        font-size: 1rem;
    }
    
    .title-subtitle {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }
    
    .section-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* Layout */
    .space-main {
        margin-top: 120px; /* Account for taller mobile nav */
    }
    
    .space-section {
        padding: var(--space-xl) 0;
    }
    
    .section-container {
        padding: 0 var(--space-sm);
    }
    
    /* Hero Section */
    .hero-content {
        gap: var(--space-xl);
    }
    
    .space-station-model {
        width: 180px;
        height: 180px;
    }
    
    .station-core {
        width: 40px;
        height: 40px;
    }
    
    .ring-outer {
        width: 160px;
        height: 160px;
    }
    
    .ring-middle {
        width: 120px;
        height: 120px;
    }
    
    .ring-inner {
        width: 80px;
        height: 80px;
    }
    
    .module {
        width: 12px;
        height: 12px;
    }
    
    .hero-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* Buttons */
    .cosmic-button {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.8rem;
        width: 100%;
        max-width: 280px;
    }
    
    /* Components */
    .feature-card {
        padding: var(--space-md);
    }
    
    .feature-icon {
        font-size: 1.5rem;
    }
    
    .feature-title {
        font-size: 1rem;
    }
    
    .feature-description {
        font-size: 0.85rem;
    }
    
    /* Stats */
    .stats-hologram,
    .monitor-screen {
        padding: var(--space-md);
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-trend {
        font-size: 0.7rem;
    }
    
    /* Security Layers */
    .layer-header {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
    
    .layer-title {
        font-size: 1rem;
    }
    
    .spec-item {
        flex-direction: column;
        text-align: center;
        gap: var(--space-xs);
    }
    
    /* Communication Interface */
    .interface-screen {
        height: 300px;
    }
    
    .screen-header {
        padding: var(--space-sm) var(--space-md);
    }
    
    .screen-header h3 {
        font-size: 0.8rem;
    }
    
    .message-display {
        padding: var(--space-md);
        gap: var(--space-sm);
    }
    
    .message {
        max-width: 90%;
        padding: var(--space-sm);
    }
    
    .message-header {
        font-size: 0.7rem;
    }
    
    .message-content {
        font-size: 0.8rem;
    }
    
    .message-input {
        padding: var(--space-sm);
    }
    
    .cosmic-input {
        font-size: 0.8rem;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .send-button {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.8rem;
    }
    
    /* Research Lab */
    .chart-container {
        height: 150px;
    }
    
    .insight-item {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }
    
    .insight-icon {
        font-size: 1.2rem;
    }
    
    /* Docking Bay */
    .docking-bay-model {
        width: 150px;
        height: 180px;
    }
    
    .bay-entrance {
        width: 60px;
        height: 40px;
    }
    
    .entrance-lights {
        width: 70px;
        height: 6px;
    }
    
    .docking-arms {
        width: 100px;
        height: 100px;
    }
    
    .arm {
        width: 3px;
        height: 40px;
    }
    
    .approaching-ship {
        width: 15px;
        height: 20px;
    }
    
    /* Process Steps */
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .step-title {
        font-size: 1rem;
    }
    
    .step-description {
        font-size: 0.85rem;
    }
    
    /* Footer */
    .footer-content {
        gap: var(--space-md);
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-title {
        font-size: 1rem;
    }
    
    .footer-description {
        font-size: 0.8rem;
    }
    
    .coordinate-item,
    .regulation-item {
        padding: var(--space-sm);
        font-size: 0.8rem;
    }
    
    .coord-label,
    .coord-value {
        font-size: 0.7rem;
    }
    
    .status-item {
        font-size: 0.7rem;
    }
    
    .footer-disclaimer p {
        font-size: 0.7rem;
    }
    
    .footer-copyright {
        font-size: 0.7rem;
    }
    
    /* Loading Screen */
    .logo-orbit {
        width: 80px;
        height: 80px;
    }
    
    .planet-core {
        width: 20px;
        height: 20px;
    }
    
    .ring-1 {
        width: 40px;
        height: 40px;
    }
    
    .ring-2 {
        width: 60px;
        height: 60px;
    }
    
    .ring-3 {
        width: 80px;
        height: 80px;
    }
    
    .satellite {
        width: 4px;
        height: 4px;
    }
    
    .loading-title {
        font-size: 1.2rem;
    }
    
    .loading-progress {
        width: 250px;
    }
    
    .loading-status {
        font-size: 0.8rem;
    }
    
    /* Cosmic Cursor - Hide on Mobile */
    .cosmic-cursor {
        display: none;
    }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
    .hero-title .title-main {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .space-station-model {
        width: 150px;
        height: 150px;
    }
    
    .docking-bay-model {
        width: 120px;
        height: 150px;
    }
    
    .interface-screen {
        height: 250px;
    }
    
    .cosmic-button {
        max-width: 250px;
        font-size: 0.75rem;
    }
    
    .loading-progress {
        width: 200px;
    }
}

/* Landscape Orientation Adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .space-section {
        padding: var(--space-lg) 0;
    }
    
    .hero-content {
        min-height: 60vh;
    }
    
    .space-station-model {
        width: 200px;
        height: 200px;
    }
    
    .interface-screen {
        height: 250px;
    }
    
    .docking-bay-model {
        width: 150px;
        height: 180px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .space-station-model,
    .docking-bay-model {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .cosmic-button {
        min-height: 44px; /* iOS touch target minimum */
        padding: var(--space-md) var(--space-lg);
    }
    
    .nav-star {
        min-width: 44px;
        min-height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-star::before {
        content: '';
        width: 12px;
        height: 12px;
        background: var(--space-silver);
        border-radius: 50%;
        box-shadow: 0 0 10px var(--space-silver);
    }
    
    .nav-star:active::before {
        background: var(--space-blue);
        box-shadow: 0 0 20px var(--space-blue);
    }
    
    .star-label {
        position: static;
        opacity: 1;
        font-size: 0.6rem;
        margin-top: var(--space-xs);
    }
    
    /* Remove hover effects on touch devices */
    .feature-card:hover,
    .security-layer:hover,
    .comm-feature:hover,
    .process-step:hover {
        transform: none;
        box-shadow: none;
        border-color: inherit;
    }
    
    /* Add active states instead */
    .feature-card:active,
    .security-layer:active,
    .comm-feature:active,
    .process-step:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* Print Styles */
@media print {
    .space-background,
    .cosmic-cursor,
    .space-loader,
    .nav-constellation,
    .cosmic-button,
    .interface-screen,
    .docking-bay-model {
        display: none !important;
    }
    
    .space-nav {
        position: static;
        background: transparent;
        border: none;
    }
    
    .space-main {
        margin-top: 0;
    }
    
    .space-section {
        page-break-inside: avoid;
        padding: 1rem 0;
    }
    
    .section-title,
    .hero-title {
        color: #000 !important;
        text-shadow: none !important;
    }
    
    .hero-text,
    .overview-text,
    .security-text,
    .comm-text,
    .research-text,
    .docking-text {
        color: #333 !important;
    }
    
    .feature-card,
    .security-layer,
    .comm-feature,
    .process-step {
        border: 1px solid #ccc !important;
        background: #f9f9f9 !important;
        box-shadow: none !important;
    }
}

