/* Responsive Design Optimizations */

/* Mobile Devices (up to 480px) */
@media screen and (max-width: 480px) {
    .terminal-container {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .terminal-body {
        padding: 15px 10px;
    }
    
    .ascii-art {
        display: none; /* Hide ASCII art on very small screens */
    }
    
    .skill-name {
        width: 80px;
        font-size: 12px;
    }
    
    .project-cube {
        width: 60px;
        height: 60px;
    }
    
    .cube-face {
        width: 60px;
        height: 60px;
        font-size: 10px;
    }
    
    .cube-face.front {
        transform: translateZ(30px);
    }
    
    .cube-face.back {
        transform: rotateY(180deg) translateZ(30px);
    }
    
    .cube-face.right {
        transform: rotateY(90deg) translateZ(30px);
    }
    
    .cube-face.left {
        transform: rotateY(-90deg) translateZ(30px);
    }
    
    .cube-face.top {
        transform: rotateX(90deg) translateZ(30px);
    }
    
    .cube-face.bottom {
        transform: rotateX(-90deg) translateZ(30px);
    }
    
    .terminal-input {
        font-size: 12px;
    }
    
    .prompt {
        font-size: 12px;
    }
    
    .section-header {
        font-size: 12px;
    }
}

/* Tablets (480px - 768px) */
@media screen and (min-width: 481px) and (max-width: 768px) {
    .terminal-container {
        width: 95%;
        height: 90vh;
    }
    
    .ascii-art {
        font-size: 10px;
    }
    
    .projects-container {
        grid-template-columns: 1fr;
    }
    
    .skill-name {
        width: 100px;
    }
}

/* Small Laptops (769px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .terminal-container {
        width: 90%;
        height: 85vh;
    }
    
    .projects-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .project-item {
        transform: none !important;
    }
    
    .project-cube {
        animation: auto-rotate 10s infinite linear;
    }
    
    @keyframes auto-rotate {
        from { transform: rotateX(-15deg) rotateY(0deg); }
        to { transform: rotateX(-15deg) rotateY(360deg); }
    }
    
    .terminal-button {
        min-width: 20px;
        min-height: 20px;
        margin-right: 5px;
    }
    
    .terminal-input-container {
        padding: 15px 0;
    }
    
    .terminal-input {
        font-size: 16px; /* Better for touch input */
    }
}

/* Landscape Mode Optimization */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .terminal-container {
        height: 95vh;
        margin: 2.5vh auto;
    }
    
    .terminal-body {
        padding: 10px;
    }
    
    .section-content {
        padding-left: 10px;
    }
    
    .skill-bars {
        gap: 10px;
    }
    
    .experience-item {
        margin-bottom: 20px;
    }
    
    .education-item {
        gap: 20px;
    }
}

/* High Resolution Screens */
@media screen and (min-width: 1400px) {
    .terminal-container {
        max-width: 1400px;
    }
    
    .projects-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ascii-art {
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0A192F;
        --bg-secondary: #112240;
        --text-primary: #E6F1FF;
        --text-secondary: #8892B0;
    }
}

/* Light Mode Support */
@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #F5F5F5;
        --bg-secondary: #E0E0E0;
        --text-primary: #333333;
        --text-secondary: #666666;
        --accent-primary: #0A8C79;
    }
    
    #matrix-rain {
        opacity: 0.05;
    }
    
    .terminal-container {
        background-color: rgba(245, 245, 245, 0.85);
    }
    
    .project-item {
        background-color: rgba(224, 224, 224, 0.5);
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
    }
    
    #particles-js, #matrix-rain {
        display: none;
    }
    
    .terminal-container {
        box-shadow: none;
        border: 1px solid #ccc;
        height: auto;
    }
    
    .terminal-body {
        height: auto;
    }
    
    .terminal-section {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .project-cube {
        display: none;
    }
    
    .terminal-input-container {
        display: none;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    
    #particles-js, #matrix-rain {
        display: none;
    }
    
    .project-cube {
        transform: none !important;
    }
    
    .skill-progress {
        transition: none !important;
    }
}

/* Focus Styles for Keyboard Navigation */
:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.terminal-input:focus {
    outline: none;
    border-bottom: 2px solid var(--accent-primary);
}

/* Loading Animation Responsiveness */
@media screen and (max-width: 480px) {
    .loading-text {
        font-size: 18px;
    }
    
    .loading-progress {
        width: 250px;
    }
}
