/* @import url('https://fonts.googleapis.com/css2?family=VT323&display=swap'); This is now linked directly in HTML for better performance */

:root {
    --primary-color: #00ff00;
    --accent-color-1: #00ffff;
    --accent-color-2: #ff00ff;
    --background-color: #000;
    --text-color: #00ff00;
    --link-color: #00ffff;
    --link-hover-color: #ff00ff;
    --border-color: #00ff00;
    --terminal-header-bg: linear-gradient(90deg, var(--primary-color), var(--background-color));
}

body {
    font-family: 'VT323', monospace;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden;
}

#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.content-wrapper {
    position: relative;
    z-index: 1;
}

.glitch {
    position: relative;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-color);
    color: var(--text-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-color-2);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-color-1);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); transform: skew(0.3deg); }
    10% { clip: rect(112px, 9999px, 76px, 0); }
    20% { clip: rect(85px, 9999px, 77px, 0); }
    30% { clip: rect(27px, 9999px, 97px, 0); }
    40% { clip: rect(64px, 9999px, 98px, 0); transform: skew(-0.2deg); }
    50% { clip: rect(61px, 9999px, 85px, 0); }
    60% { clip: rect(99px, 9999px, 114px, 0); }
    70% { clip: rect(34px, 9999px, 115px, 0); transform: skew(0.1deg); }
    80% { clip: rect(98px, 9999px, 129px, 0); }
    90% { clip: rect(43px, 9999px, 96px, 0); }
    100% { clip: rect(82px, 9999px, 64px, 0); transform: skew(0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 119px, 0); transform: skew(-0.3deg); }
    10% { clip: rect(66px, 9999px, 115px, 0); }
    20% { clip: rect(117px, 9999px, 114px, 0); }
    30% { clip: rect(43px, 9999px, 122px, 0); transform: skew(0.2deg); }
    40% { clip: rect(122px, 9999px, 66px, 0); }
    50% { clip: rect(68px, 9999px, 84px, 0); }
    60% { clip: rect(98px, 9999px, 91px, 0); transform: skew(-0.1deg); }
    70% { clip: rect(91px, 9999px, 85px, 0); }
    80% { clip: rect(84px, 9999px, 126px, 0); }
    90% { clip: rect(119px, 9999px, 103px, 0); }
    100% { clip: rect(103px, 9999px, 79px, 0); transform: skew(0); }
}

.glitch-effect-temp {
    animation: glitch-temp 0.3s linear;
}
@keyframes glitch-temp {
    0% { clip-path: inset(10% 0 80% 0); transform: translateX(-3px); }
    20% { clip-path: inset(90% 0 5% 0); transform: translateX(3px); }
    40% { clip-path: inset(40% 0 30% 0); transform: translateY(-2px) skewX(5deg); }
    60% { clip-path: inset(20% 0 70% 0); transform: translateY(2px) skewX(-5deg); }
    80% { clip-path: inset(60% 0 10% 0); transform: translateX(-1px); }
    100% { clip-path: inset(0 0 0 0); transform: translateX(0); }
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(0, 255, 0, 0.06) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 40; /* Above most content, but player can be higher */
}

.terminal, .project-card-container {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    position: relative;
    z-index: 2;
}

.terminal {
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin-bottom: 2rem;
    background-color: rgba(0, 25, 0, 0.25);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.terminal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1rem;
    background: var(--terminal-header-bg);
    border-bottom: 1px solid var(--border-color);
}

.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

a {
    color: var(--link-color);
    text-decoration: underline;
    transition: color 0.2s ease-in-out, text-shadow 0.2s ease-in-out;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: none;
    text-shadow: 0 0 5px var(--link-hover-color);
}

.pixel {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.music-track {
    transition: all 0.3s ease;
    border-radius: 4px;
}

.music-track:hover {
    background-color: rgba(0, 255, 0, 0.1);
    transform: translateX(5px);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

.now-playing {
    background-color: rgba(0, 255, 0, 0.15);
    border-left: 4px solid var(--accent-color-2);
    border-radius: 4px;
    padding: 0.75rem;
}

.music-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 255, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.discord-status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid rgba(0,0,0,0.2);
}

.status-online { background-color: #3ba55c; }
.status-idle { background-color: #faa81a; }
.status-dnd { background-color: #ed4245; }
.status-offline { background-color: #747f8d; }

.discord-activity {
    background-color: rgba(114, 137, 218, 0.05);
    border-left: 3px solid #7289da;
    border-radius: 4px;
    padding: 0.75rem;
}

.discord-avatar {
    border-radius: 50%;
    border: 2px solid #7289da;
    box-shadow: 0 0 10px rgba(114, 137, 218, 0.5);
}

/* Custom Audio Player Styles */
#custom-audio-player-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background-color: rgba(0, 15, 0, 0.85); /* Darker, more opaque for player */
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem;
    z-index: 50; /* High z-index to be on top */
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
#custom-audio-player-container.hidden {
    display: none;
}
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 0.5rem;
}
.player-header h3 {
    font-size: 1.5rem; /* text-2xl */
    color: var(--primary-color);
}
#close-player-btn {
    background: none;
    border: 1px solid var(--accent-color-2);
    color: var(--accent-color-2);
    padding: 0.25rem 0.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 4px;
}
#close-player-btn:hover {
    background-color: var(--accent-color-2);
    color: var(--background-color);
}
.track-info {
    text-align: center;
    margin-bottom: 1rem;
}
#current-track-title {
    font-size: 1.25rem; /* text-xl */
    color: var(--text-color);
    display: block;
}
#current-track-artist {
    font-size: 1rem; /* text-base */
    color: var(--accent-color-1);
    display: block;
}
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.player-controls button {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%; /* Circular buttons */
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.player-controls button:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
}
#player-playlist {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 4px;
}
#player-playlist .playlist-item {
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-bottom: 1px dashed rgba(0,255,0,0.2);
}
#player-playlist .playlist-item:last-child {
    border-bottom: none;
}
#player-playlist .playlist-item:hover {
    background-color: rgba(0, 255, 0, 0.1);
}
#player-playlist .playlist-item.active-track {
    background-color: rgba(0, 255, 0, 0.2);
    color: var(--accent-color-1);
    font-weight: bold;
}
