/* Mobile Responsive Styles for cerberus.cv */

/* Mobile Header */
.mobile-header {
    display: none;
}

/* Mobile Menu Styles */
.mobile-menu-btn {
    display: block;
    position: relative;
    width: 44px;
    height: 44px;
    background-color: #000 !important; /* Black background always */
    border: 2px solid var(--accent-color, #00ff00);
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    margin: 0 auto 10px;
    box-shadow: 0 0 15px var(--accent-color, #00ff00);
}

.mobile-menu-btn span {
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background-color: var(--accent-color, #00ff00);
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu-btn span:nth-child(1) {
    top: 10px;
}

.mobile-menu-btn span:nth-child(2) {
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
}

.mobile-menu-btn span:nth-child(3) {
    bottom: 10px;
}

.mobile-menu-btn.active span:nth-child(1) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.mobile-menu-btn:hover {
    background-color: var(--accent-hover, rgba(0, 255, 0, 0.1));
    transform: scale(1.05);
}

/* Active state for better feedback */
.mobile-menu-btn:active {
    transform: scale(0.95);
}

/* Fallback hamburger icon */
.menu-icon-fallback {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: var(--accent-color);
    line-height: 1;
}

/* If spans are not visible, show fallback */
@supports not (transform: translateX(-50%)) {
    .mobile-menu-btn span {
        display: none !important;
    }
    .menu-icon-fallback {
        display: block !important;
    }
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-color);
    border-left: 2px solid var(--accent-color);
    z-index: 10000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-nav.active {
    right: 0;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--accent-color);
}

.nav-header h3 {
    margin: 0;
    color: var(--accent-color);
}

.nav-close {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 30px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav li {
    border-bottom: 1px solid var(--accent-border, rgba(0, 255, 0, 0.2));
}

.mobile-nav a {
    display: block;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-nav a:hover {
    background: var(--accent-hover, rgba(0, 255, 0, 0.1));
    color: var(--accent-color);
    padding-left: 30px;
}

.nav-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--accent-color);
    font-size: 12px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .mobile-header {
        display: block !important;
        text-align: center;
        margin-bottom: 10px;
        min-height: 50px; /* Ensure space for button */
    }
    
    .mobile-menu-btn {
        display: inline-block !important;
        vertical-align: middle;
    }
    
}

/* Tablet breakpoint */
@media (max-width: 768px) {
    /* Container adjustments */
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    /* Header section - stack portrait and bio */
    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .portrait {
        width: 100%;
        max-width: 250px;
        margin-right: 0;
        margin-bottom: 20px;
        font-size: 0.6em;
    }
    
    .bio {
        width: 100%;
    }
    
    /* Sections spacing */
    .section {
        margin: 20px 0;
        padding: 15px;
    }
    
    /* Forms and inputs */
    input[type="text"],
    input[type="file"],
    button {
        width: 100%;
        margin: 5px 0;
        font-size: 14px;
    }
    
    /* Terminal input */
    .terminal-input {
        font-size: 14px;
        padding: 8px;
    }
    
    /* Code blocks and pre elements */
    pre {
        font-size: 12px;
        overflow-x: auto;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    /* Hacking game adjustments */
    .port-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .port-btn {
        padding: 10px;
        font-size: 14px;
    }
    
    .memory-grid {
        grid-template-columns: repeat(2, 80px) !important;
        gap: 8px !important;
    }
    
    .memory-cell {
        width: 80px !important;
        height: 80px !important;
    }
    
    /* Game menu */
    .hacking-menu {
        padding: 10px;
    }
    
    .game-options {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .game-options button {
        width: 100%;
    }
    
    /* Leaderboard */
    .leaderboard li {
        font-size: 14px;
        padding: 6px;
    }
    
    .leaderboard .games {
        display: none; /* Hide games count on mobile */
    }
    
    /* Visitor log */
    #visitor-log {
        font-size: 11px;
    }
    
    .visitor-log-container {
        max-height: 300px;
    }
}

/* Mobile breakpoint */
@media (max-width: 480px) {
    body {
        padding: 10px;
        padding-bottom: 120px;
        font-size: 14px;
    }
    
    /* Typography scaling */
    h1 {
        font-size: 1.5em;
    }
    
    h2 {
        font-size: 1.2em;
        margin: 15px 0 10px;
    }
    
    h3 {
        font-size: 1.1em;
    }
    
    /* Portrait even smaller on mobile */
    .portrait {
        font-size: 0.5em;
        line-height: 1.1;
    }
    
    /* Bio text */
    .bio p, .bio .quote {
        font-size: 14px;
        line-height: 1.4;
    }
    
    /* Binary separator */
    .separator {
        font-size: 10px;
        overflow-x: auto;
        white-space: nowrap;
        padding: 10px 0;
    }
    
    /* Theme switcher - 2x3 grid on mobile */
    .theme-switcher {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .theme-switcher button {
        font-size: 11px;
        padding: 6px 4px;
    }
    
    /* Section padding */
    .section {
        padding: 10px;
        margin: 15px 0;
    }
    
    /* Forms */
    input[type="text"],
    input[type="file"] {
        font-size: 14px;
        padding: 8px;
    }
    
    button {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    /* Hacking game specific */
    .port-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
    
    .port-btn {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .player-info {
        font-size: 13px;
        padding: 8px;
    }
    
    .alias-setup input {
        font-size: 14px;
    }
    
    /* Code breaker */
    .code-input {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    #code-guess {
        font-size: 16px; /* Prevent zoom on iOS */
        text-align: center;
    }
    
    /* Articles and thoughts */
    #articles-content,
    #thoughts-content {
        font-size: 13px;
    }
    
    /* Footer adjustments */
    #taskbar-footer {
        font-size: 11px;
    }
    
    .footer-center p {
        font-size: 10px;
    }
    
    .footer-item {
        padding: 2px 6px;
        font-size: 11px;
    }
    
    /* Hide less important footer items on very small screens */
    @media (max-width: 360px) {
        .footer-left {
            display: none;
        }
    }
    
    /* Encryption/decryption section */
    #encrypt-output,
    #decrypt-output {
        font-size: 11px;
        max-height: 100px;
        overflow-y: auto;
    }
    
    /* ASCII art output */
    #ascii-output {
        font-size: 8px;
        line-height: 1;
        overflow-x: auto;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding-bottom: 80px;
    }
    
    .header {
        flex-direction: row;
    }
    
    .portrait {
        width: 40%;
        margin-right: 20px;
    }
    
    .bio {
        width: 60%;
        text-align: left;
    }
    
    /* Reduce vertical spacing in landscape */
    .section {
        margin: 10px 0;
        padding: 10px;
    }
    
    h2 {
        margin: 10px 0 8px;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) {
    /* Disable custom cursor on touch devices */
    body {
        cursor: auto !important;
    }
    
    .custom-cursor {
        display: none !important;
    }
    /* Make interactive elements larger for touch */
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .port-btn {
        min-height: 40px;
    }
    
    /* Remove hover effects on touch devices */
    button:hover {
        background-color: inherit;
        color: inherit;
    }
    
    /* Add active states for better touch feedback */
    button:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
}