/* Neural Nexus Society - Responsive Design */

/* Large screens (desktops, large tablets landscape) */
@media screen and (min-width: 1200px) {
    .main-container {
        padding: var(--spacing-xl);
    }
    
    .network-container {
        height: 500px;
    }
    
    .agent-node {
        width: 100px;
        height: 100px;
    }
    
    .node-core {
        width: 60px;
        height: 60px;
    }
    
    .node-pulse {
        width: 60px;
        height: 60px;
    }
}

/* Medium screens (tablets, small desktops) */
@media screen and (max-width: 1199px) and (min-width: 768px) {
    .main-container {
        padding: var(--spacing-lg);
    }
    
    .hero-section {
        margin-top: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
    }
    
    .network-container {
        height: 350px;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small screens (phones landscape, small tablets) */
@media screen and (max-width: 767px) and (min-width: 480px) {
    .main-container {
        padding: var(--spacing-md);
    }
    
    .hero-section {
        margin-top: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .neural-logo {
        width: 80px;
        height: 80px;
    }
    
    .logo-node {
        width: 32px;
        height: 32px;
    }
    
    .main-title {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }
    
    .subtitle {
        font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    }
    
    .network-container {
        height: 300px;
    }
    
    .agent-node {
        width: 60px;
        height: 60px;
    }
    
    .node-core {
        width: 40px;
        height: 40px;
    }
    
    .node-pulse {
        width: 40px;
        height: 40px;
    }
    
    .node-label {
        font-size: 0.7rem;
    }
    
    /* Adjust node positions for smaller screen */
    .agent-node[data-agent="language"] {
        top: 15%;
        left: 10%;
    }
    
    .agent-node[data-agent="vision"] {
        top: 8%;
        right: 15%;
    }
    
    .agent-node[data-agent="creativity"] {
        bottom: 20%;
        left: 15%;
    }
    
    .agent-node[data-agent="memory"] {
        bottom: 12%;
        right: 10%;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .info-item {
        padding: var(--spacing-xs);
    }
    
    .panel-content {
        padding: var(--spacing-sm);
    }
}

/* Extra small screens (phones portrait) */
@media screen and (max-width: 479px) {
    .main-container {
        padding: var(--spacing-sm);
    }
    
    .hero-section {
        margin-top: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .neural-logo {
        width: 60px;
        height: 60px;
    }
    
    .logo-node {
        width: 24px;
        height: 24px;
    }
    
    .main-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
        margin-bottom: var(--spacing-xs);
    }
    
    .subtitle {
        font-size: clamp(0.8rem, 3vw, 1rem);
        margin-bottom: var(--spacing-md);
    }
    
    .status-display {
        padding: calc(var(--spacing-xs) * 0.75) var(--spacing-xs);
        flex-direction: column;
        gap: calc(var(--spacing-xs) * 0.5);
        text-align: center;
    }
    
    .status-text {
        font-size: 0.8rem;
    }
    
    .network-container {
        height: 250px;
        border-radius: 15px;
    }
    
    .agent-node {
        width: 50px;
        height: 50px;
    }
    
    .node-core {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    
    .node-pulse {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        border-width: 1px;
    }
    
    .node-label {
        font-size: 0.6rem;
        margin-top: calc(var(--spacing-xs) * 0.5);
    }
    
    /* Compact node positioning for mobile */
    .agent-node[data-agent="language"] {
        top: 12%;
        left: 8%;
    }
    
    .agent-node[data-agent="vision"] {
        top: 8%;
        right: 12%;
    }
    
    .agent-node[data-agent="reasoning"] {
        top: 45%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .agent-node[data-agent="creativity"] {
        bottom: 18%;
        left: 12%;
    }
    
    .agent-node[data-agent="memory"] {
        bottom: 12%;
        right: 8%;
    }
    
    .panel-title {
        font-size: 1.2rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
    }
    
    .info-item {
        padding: var(--spacing-xs);
    }
    
    .info-label {
        font-size: 0.7rem;
    }
    
    .info-value {
        font-size: 1rem;
    }
    
    .panel-content {
        padding: var(--spacing-sm);
        border-radius: 12px;
    }
    
    .footer {
        padding: var(--spacing-sm) 0;
    }
    
    .footer-text {
        font-size: 0.8rem;
    }
    
    .construction-indicator {
        flex-direction: column;
        gap: calc(var(--spacing-xs) * 0.5);
    }
    
    .indicator-text {
        font-size: 0.7rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .agent-node {
        /* Larger touch targets */
        min-width: 60px;
        min-height: 60px;
    }
    
    .agent-node:hover {
        /* Remove hover effects on touch devices */
        transform: none;
    }
    
    /* Add touch feedback */
    .agent-node:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .clickable:hover {
        transform: none;
    }
    
    .clickable:active {
        transform: scale(0.95);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-node,
    .node-core {
        /* Sharper borders on high DPI */
        border: 0.5px solid rgba(255, 255, 255, 0.1);
    }
}

/* Landscape orientation adjustments */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .main-container {
        padding: var(--spacing-sm);
    }
    
    .hero-section {
        margin-top: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .network-container {
        height: 200px;
    }
    
    .info-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer {
        margin-top: var(--spacing-sm);
        padding: var(--spacing-sm) 0;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    #neural-canvas,
    .loading-overlay {
        display: none;
    }
    
    * {
        animation: none !important;
        transition: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .main-container {
        padding: 1rem;
    }
    
    .network-container {
        border: 1px solid #000;
        background: #f5f5f5;
    }
}

/* Accessibility improvements */
@media (prefers-high-contrast: high) {
    :root {
        --accent-cyan: #00ffff;
        --accent-purple: #ff00ff;
        --accent-green: #00ff00;
        --accent-pink: #ff0080;
        --white: #ffffff;
        --gray-light: #cccccc;
    }
    
    .network-container,
    .panel-content,
    .info-item {
        border-width: 2px;
    }
}

/* Dark mode support (if user prefers dark color scheme) */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* Light mode adaptation (if needed) */
@media (prefers-color-scheme: light) {
    :root {
        --primary-blue: #f0f4f8;
        --secondary-blue: #e2e8f0;
        --white: #1a202c;
        --gray-light: #4a5568;
    }
    
    body {
        background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
        color: var(--white);
    }
}