/* Base styles */
:root {
    --bg-color: #f2f2f2;
    --text-color: #333;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1F2223;
        --text-color: #f2f2f2;
    }
}

/* Reset for better mobile handling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    transition: background-color 0.5s, color 0.5s;
}

.container {
    text-align: left;
    padding: 2rem;
    margin-left: 3%;
    width: 94%; /* Control width to prevent overflow */
    max-width: 800px;
}

.metro-board {
    border-left: 4px solid #333;
    padding-left: 1.5rem;
    width: 100%;
}

.title {
    font-size: clamp(2rem, 8vw, 3rem); /* Responsive font size */
    margin-bottom: 2rem;
    letter-spacing: -1px;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
}

.nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.metro-link {
    text-decoration: none;
    font-size: clamp(1.4rem, 5vw, 1.8rem); /* Responsive font size */
    margin: 8px 0;
    padding: 5px;
    transition: all 0.3s;
    position: relative;
    width: fit-content;
    opacity: 1;
    max-height: 50px;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none; /* Prevent text selection */
}

.metro-link.hidden {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.metro-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: currentColor;
    transition: width 0.3s;
}

.metro-link:hover::after {
    width: 100%;
}

/* Copy notification styles */
#copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    max-width: 90%; /* Prevent overflowing on small screens */
    text-align: center;
}

#copy-notification.show {
    opacity: 1;
}

/* About Me Section Styles */
.about-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    padding-left: 5px;
    width: 100%;
    max-width: 600px;
    transform: translateY(-10px);
    transform-origin: top left;
    transition: max-height 0.3s ease-out,
                opacity 0.2s ease-out,
                margin-top 0.2s ease-out,
                transform 0.2s ease-out;
    pointer-events: none;
}

.about-section.active {
    max-height: 1000px;
    margin-top: 20px;
    opacity: 1;
    transform: translateY(0);
    transition: max-height 0.5s cubic-bezier(0, 0, 0.2, 1),
                opacity 0.3s ease-in,
                margin-top 0.3s ease-in,
                transform 0.3s ease-in;
    pointer-events: auto;
}

.about-section h2 {
    font-size: clamp(1.2rem, 4vw, 1.5rem); /* Responsive font size */
    margin-bottom: 10px;
    -webkit-user-select: none;
    user-select: none; /* Prevent text selection */
}

.about-content p {
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: clamp(0.9rem, 3vw, 1rem); /* Responsive font size */
    -webkit-user-select: none;
    user-select: none; /* Prevent text selection */
}

/* Metro color schemes applied via JavaScript */

/* Monochrome theme */
body.mono-theme {
    background-color: #000000;
    color: #ffffff;
}

@media (prefers-color-scheme: dark) {
    body.mono-theme {
        background-color: #000000;
        color: #ffffff;
    }
}

/* Flash effect for theme change */
.flash-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    pointer-events: none;
    animation: flash 0.3s forwards;
}

@keyframes flash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

body.dark-theme .flash-effect {
    background: rgba(0, 0, 0, 0.9);
}

/* Style for the metro caption */
.metro-caption {
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
    font-size: clamp(0.7rem, 2.5vw, 0.8rem); /* Responsive font size */
    opacity: 0.6;
    margin-top: 2rem;
}

/* Mobile-specific adjustments */
@media (max-width: 480px) {
    body {
        align-items: flex-start; /* Align to top on mobile */
        padding-top: 2rem; /* Add some padding at the top */
    }
    
    .container {
        margin-left: 0; /* Remove left margin on mobile */
        padding: 1.5rem; /* Smaller padding */
        width: 100%;
    }
    
    .metro-board {
        padding-left: 1rem; /* Smaller left padding */
    }
    
    .about-section.active {
        margin-top: 15px; /* Smaller margin on mobile */
    }
}

/* Fix for very small screens */
@media (max-width: 320px) {
    .container {
        padding: 1rem;
    }
    
    .metro-board {
        padding-left: 0.8rem;
    }
}