/* mobile.css - Mobile-specific styles and responsive design */

/* Mobile Navigation Components */
.mobile-menu-toggle {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
}

.hamburger {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s ease;
    position: relative;
}

.mobile-menu-toggle:hover {
    border-color: var(--accent);
}

.mobile-menu-toggle:hover .hamburger {
    background: var(--accent);
}

.mobile-menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.mobile-menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation Slide-down */
.mobile-nav {
    position: fixed;
    top: 48px; /* Adjusted for thinner header */
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: max-height 0.3s ease;
    z-index: 99;
    /* Hide completely when not active */
    opacity: 0;
    pointer-events: none;
    box-shadow: none;
    border: none;
}

.mobile-nav.active {
    max-height: 320px; /* Increased to show full Connect button */
    opacity: 1;
    pointer-events: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--border);
}

.mobile-nav-content {
    width: 100%;
    padding: 1.5rem 1rem 2rem 1rem; /* Extra bottom padding for Connect button */
}

.mobile-nav-close {
    display: none; /* Hide close button for slide-down menu */
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
}

.mobile-nav-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-left: 2px solid transparent;
}

.mobile-nav-link:hover {
    color: var(--accent);
    border-left-color: var(--accent);
    transform: translateX(10px);
}

.nav-prefix {
    color: var(--secondary);
    opacity: 0.7;
}

.nav-suffix {
    color: var(--secondary);
    opacity: 0.7;
}

.mobile-nav-cta {
    margin-top: 0.5rem;
    border: 1px solid var(--accent);
    border-radius: 4px;
    text-align: center;
    justify-content: center;
    border-left: 1px solid var(--accent);
    padding: 0.6rem 1rem; /* Smaller padding */
    font-size: 0.85rem; /* Smaller font */
}

.mobile-nav-cta:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: var(--accent);
    border-left-color: var(--accent);
}

/* Mobile-specific breakpoints */
@media (max-width: 480px) {
    /* Small phones */
    .hero-name {
        font-size: clamp(2rem, 10vw, 3rem);
    }
    
    .hero-tagline {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }
    
    .section-tagline {
        font-size: 1.5rem;
    }
    
    /* Hide UTC in header on mobile */
    .time-display {
        display: none;
    }
    
    /* Show UTC in mobile nav */
    .mobile-time-display {
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.75rem;
        color: var(--secondary);
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border);
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .mobile-time-display::before {
        content: '◉';
        font-size: 0.6rem;
        animation: timePulse 2s ease-in-out infinite;
    }
}

/* Remove tap highlight on all elements */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

@media (max-width: 768px) {
    /* Show mobile navigation elements */
    .mobile-menu-toggle {
        display: flex;
        margin-right: 0.75rem;
    }
    
    /* Keep header fixed on mobile too */
    .header {
        padding: 0.4rem 0;
    }
    
    .header-right {
        display: none;
    }
    
    .header-content {
        justify-content: space-between;
        padding: 0.25rem 0;
    }
    
    .header-left {
        gap: 0.75rem;
        margin-left: 0.75rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    /* Mobile-optimized hero */
    .hero {
        padding: 4.5rem 0 1rem; /* More space to avoid header overlap */
    }
    
    .hero-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-portrait {
        width: 280px;
        height: 350px;
        margin: 1.5rem auto; /* Center the portrait */
        display: block;
        opacity: 0;
        animation: slideUp 0.8s ease 1.3s forwards; /* After description at 1.1s */
    }
    
    .hero-name {
        font-size: clamp(2.8rem, 12vw, 4rem);
        text-align: left;
    }
    
    .hero-name .first-name {
        margin-bottom: -0.05em; /* Add more space between lines */
    }
    
    .hero-title {
        text-align: left;
        font-size: 0.65rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .hero-tagline {
        text-align: left;
        font-size: clamp(1.5rem, 4.5vw, 2.2rem);
    }
    
    .hero-description {
        text-align: left;
        font-size: 0.9rem;
        line-height: 1.4;
        padding: 0;
    }
    
    /* Mobile-optimized terminals */
    .status-content,
    .personal-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    /* Fix personal header on mobile */
    .personal-header {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.8rem;
        justify-content: flex-start; /* Left justify */
    }
    
    .status-column:not(:last-child):not(.full-width):not(:nth-child(3))::after,
    .status-column:not(:last-child):not(.full-width):not(:nth-child(3))::before,
    .personal-column:not(:last-child)::after,
    .personal-column:not(:last-child)::before {
        display: none;
    }
    
    .status-column:not(:last-child):not(.full-width),
    .personal-column:not(:last-child) {
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--border);
    }
    
    .status-column.full-width {
        margin-top: 0;
        padding-top: 1.5rem;
    }
    
    .status-item,
    .personal-item {
        font-size: 0.85rem;
        white-space: normal;
        line-height: 1.4;
    }
    
    /* Mobile-optimized content */
    body {
        font-size: 0.9rem;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    section {
        padding: 2rem 0;
    }
    
    .section-header {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .section-tagline {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }
    
    .content-card {
        padding: 1.25rem;
    }
    
    .content-card p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .work-item {
        padding: 1.5rem;
    }
    
    .work-company {
        font-size: 1.5rem;
    }
    
    .work-links {
        flex-direction: column;
    }
    
    .work-link-button,
    .work-link-pending {
        width: 100%;
        justify-content: center;
        /* Allow transitions for visual effects */
        transition: all 0.3s ease;
    }
    
    /* Enable desktop hover effects on mobile */
    .work-link-button:hover,
    .work-link-button:active {
        /* Keep the hover transform but smaller */
        transform: translateX(3px);
        color: var(--bg);
        /* Background will be handled by ::before */
    }
    
    /* Re-enable the animated background */
    .work-link-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: var(--secondary);
        transition: left 0.3s ease;
        z-index: -1;
    }
    
    .work-link-button:hover::before,
    .work-link-button:active::before {
        left: 0;
    }
    
    /* Mobile terminal output - FIX LINE BREAKS */
    .terminal-output {
        padding: 1rem 0;
        margin: 1.5rem 0;
    }
    
    .terminal-line {
        display: block;
        font-size: 0.75rem;
        white-space: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .prompt-user {
        display: inline;
    }
    
    .prompt-separator,
    .prompt-path,
    .prompt-symbol {
        display: inline;
    }
    
    .command-text {
        display: inline;
    }
    
    .response-text {
        font-size: 1.1rem;
        padding-left: 1rem;
        white-space: normal;
    }
    
    /* Mobile contact section - With desktop effects */
    .email-button {
        /* Use inline-block, not flex */
        display: inline-block !important;
        width: fit-content !important;
        max-width: 280px !important;
        padding: 12px 24px !important;
        margin: 0 !important;
        
        /* Visual styles */
        background: transparent !important;
        border: 1px solid var(--accent) !important;
        color: var(--text-bright) !important;
        font-family: 'JetBrains Mono', monospace !important;
        font-size: 14px !important;
        line-height: 20px !important;
        letter-spacing: 0.05em !important;
        text-decoration: none !important;
        text-align: center !important;
        white-space: nowrap !important;
        
        /* Enable smooth transitions */
        transition: all 0.3s ease !important;
        
        /* Position for ::before effect */
        position: relative !important;
        overflow: hidden !important;
        
        /* Initial state */
        transform: none !important;
        box-shadow: none !important;
        outline: none !important;
        
        /* Box model */
        box-sizing: border-box !important;
        -webkit-box-sizing: border-box !important;
        
        /* Prevent flex container behavior */
        flex: none !important;
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
        flex-basis: auto !important;
    }
    
    /* Enable hover effects on mobile */
    .email-button:hover,
    .email-button:active {
        /* Keep same size properties */
        display: inline-block !important;
        width: fit-content !important;
        max-width: 280px !important;
        padding: 12px 24px !important;
        font-size: 14px !important;
        line-height: 20px !important;
        
        /* Add visual effects */
        transform: translateY(-2px) !important;
        color: var(--bg) !important;
        background: transparent !important;
        border: 1px solid var(--accent) !important;
        box-shadow: 0 5px 20px rgba(255, 107, 107, 0.3) !important;
    }
    
    /* Add animated background */
    .email-button::before {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: -100% !important;
        width: 100% !important;
        height: 100% !important;
        background: var(--accent) !important;
        transition: left 0.3s ease !important;
        z-index: -1 !important;
    }
    
    .email-button:hover::before,
    .email-button:active::before {
        left: 0 !important;
    }
    
    .email-button::after {
        display: none !important;
        content: none !important;
    }
    
    /* Text elements as inline spans */
    .email-button .button-prefix,
    .email-button .button-suffix,
    .email-button .button-text {
        display: inline !important;
        position: static !important;
        transform: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        height: auto !important;
    }
    
    .button-prefix,
    .button-suffix {
        color: var(--secondary) !important;
        opacity: 0.7 !important;
    }
    
    .button-text {
        text-transform: uppercase !important;
        margin: 0 4px !important;
    }
    
    .linkedin-button {
        width: 100%;
        height: 48px;
    }
    
    /* Hide decorative elements */
    .hero-decoration {
        display: none;
    }
    
    /* Enable subtle hover effects on cards */
    .content-card:hover {
        border-color: rgba(255, 107, 107, 0.3) !important;
        box-shadow: 0 5px 20px rgba(255, 107, 107, 0.1) !important;
    }
    
    .work-item:hover {
        border-color: rgba(78, 205, 196, 0.3) !important;
        transform: translateX(3px) !important;
    }
    
    .contact-method:hover {
        transform: none !important;
        border-color: var(--border) !important;
        box-shadow: none !important;
    }
    
    /* Touch devices can have animations too */
    
    /* Fix section spacing around quote */
    #quote {
        margin: 0.5rem 0;
        padding: 0.5rem 0;
        min-height: auto !important;
    }
    
    /* Make quote section visible immediately on mobile */
    #quote[data-section] {
        opacity: 1 !important;
        transform: none !important;
    }
    
    #quote.visible {
        opacity: 1 !important;
        transform: none !important;
    }
    
    #about, #work {
        padding-top: 1.5rem;
    }
    
    /* Disable all transform animations on sections */
    section[data-section] {
        transform: none !important;
    }
    
    section[data-section].visible {
        transform: none !important;
    }
    
    /* Reduce animations on mobile for performance */
    .grid-bg {
        animation: none;
        opacity: 0.02;
    }
    
    body::before {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Tablet styles */
    /* Prevent horizontal scrolling on tablets */
    html, body {
        overflow-x: hidden !important;
        max-width: 100% !important;
        position: relative;
    }
    
    .container {
        padding: 0 2.5rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Ensure sections and containers don't cause horizontal scroll */
    section, .container, .content-card, .work-item, .terminal-output {
        max-width: 100% !important;
    }
    
    .hero-wrapper {
        gap: 3rem;
        overflow: visible; /* Allow content to be fully visible */
        max-width: 100%;
    }
    
    .hero-portrait {
        width: 250px !important;
        height: 333px !important;
        max-width: none !important; /* Override any max-width constraints */
        flex-shrink: 0; /* Prevent flexbox from shrinking it */
    }
    
    .status-content,
    .personal-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .status-column.full-width {
        grid-column: 1 / -1;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 5rem 0 2rem;
    }
    
    .hero-name {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .mobile-nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 2rem;
    }
    
    .mobile-nav-link {
        font-size: 1.2rem;
        flex: 0 1 auto;
    }
}