@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --text-primary: #b794f6;
    --text-secondary: #8a8a9e;
    --text-muted: #4a4a5a;
    --accent: #d4a5ff;
    --border: #1a1a24;
    --particle-primary: rgba(183, 148, 246, 0.6);
    --particle-accent: rgba(212, 165, 255, 1);
    --overlay-bg: rgba(10, 10, 15, 0.95);
}

/* Themes */
[data-theme="matrix"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --text-primary: #00ff41;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --accent: #39ff14;
    --border: #21262d;
    --particle-primary: rgba(0, 255, 65, 0.6);
    --particle-accent: rgba(57, 255, 20, 1);
    --overlay-bg: rgba(13, 17, 23, 0.95);
}

[data-theme="amber"] {
    --bg-primary: #1a0f00;
    --bg-secondary: #2a1a00;
    --text-primary: #ff8c00;
    --text-secondary: #d4753e;
    --text-muted: #8b4513;
    --accent: #ffa500;
    --border: #3a2200;
    --particle-primary: rgba(255, 140, 0, 0.6);
    --particle-accent: rgba(255, 165, 0, 1);
    --overlay-bg: rgba(26, 15, 0, 0.95);
}

[data-theme="ocean"] {
    --bg-primary: #0a1929;
    --bg-secondary: #132f4c;
    --text-primary: #66b2ff;
    --text-secondary: #8796a5;
    --text-muted: #4a5568;
    --accent: #3399ff;
    --border: #1e3a5f;
    --particle-primary: rgba(102, 178, 255, 0.6);
    --particle-accent: rgba(51, 153, 255, 1);
    --overlay-bg: rgba(10, 25, 41, 0.95);
}

[data-theme="crimson"] {
    --bg-primary: #1a0a0a;
    --bg-secondary: #2a1313;
    --text-primary: #ff6b6b;
    --text-secondary: #c9ada7;
    --text-muted: #6b4a4a;
    --accent: #ff4757;
    --border: #3a1a1a;
    --particle-primary: rgba(255, 107, 107, 0.6);
    --particle-accent: rgba(255, 71, 87, 1);
    --overlay-bg: rgba(26, 10, 10, 0.95);
}

[data-theme="cyberpunk"] {
    --bg-primary: #0f0a1a;
    --bg-secondary: #1a0f2e;
    --text-primary: #ff00ff;
    --text-secondary: #c77dff;
    --text-muted: #7b2cbf;
    --accent: #ff10f0;
    --border: #2a1f3d;
    --particle-primary: rgba(255, 0, 255, 0.6);
    --particle-accent: rgba(255, 16, 240, 1);
    --overlay-bg: rgba(15, 10, 26, 0.95);
}

body {
    font-family: 'IBM Plex Mono', monospace;
    background: var(--bg-primary);
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.header,
.container {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.header {
    background: var(--bg-secondary);
    padding: 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
}

.header h1 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.header h1::before {
    content: '> ';
    color: var(--accent);
}

.controls-hint {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.controls-hint span {
    margin-left: 12px;
}

.controls-hint kbd {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 2px 6px;
    font-family: inherit;
    font-size: 10px;
    color: var(--text-secondary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.theme-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.theme-dropdown {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.theme-dropdown:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.theme-dropdown:focus {
    border-color: var(--accent);
}

.theme-dropdown option {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.reset-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: inherit;
    padding: 0;
}

.reset-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    transform: rotate(180deg);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.terminal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    font-size: 13px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.terminal-box.collapsed .terminal-content {
    max-height: 0;
    opacity: 0;
    padding: 0 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.terminal-box.expanding .terminal-content {
    max-height: 2000px;
    opacity: 1;
    padding: 20px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.terminal-box.user-collapsed {
    opacity: 1;
    transform: scaleY(1);
}

.terminal-box.user-collapsed .terminal-content {
    max-height: 0;
    opacity: 0;
    padding: 0 20px;
    overflow: hidden;
}

/* Initial page load collapsed state */
.terminal-box.collapsed:not(.user-collapsed) {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    border-width: 0;
    transform: scaleY(0);
    transform-origin: top;
}

.terminal-box.expanding {
    max-height: 2000px;
    opacity: 1;
    transform: scaleY(1);
}

.terminal-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    position: relative;
}

.terminal-header:hover {
    background: var(--bg-primary);
}

.terminal-header::before {
    content: '◆';
    color: var(--accent);
    font-size: 10px;
    transition: transform 0.3s ease;
}

.terminal-box.user-collapsed .terminal-header {
    border-bottom: none;
}

.terminal-box.user-collapsed .terminal-header::before {
    transform: rotate(90deg);
}

.terminal-content {
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.profile-pic {
    width: 200px;
    height: 200px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.3);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-info h2 {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.info-line {
    display: flex;
    gap: 10px;
    font-size: 13px;
}

.info-label {
    color: var(--text-muted);
    min-width: 120px;
}

.info-value {
    color: var(--text-secondary);
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.online {
    background: var(--text-primary);
    animation: pulse 2s ease-in-out infinite;
}

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

.about-text {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.about-text::before {
    content: '// ';
    color: var(--text-muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.grid-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.grid-item:hover {
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

.grid-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    margin-bottom: 10px;
    filter: grayscale(0.5);
}

.grid-item:hover img {
    filter: grayscale(0);
}

.grid-item p {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.project-item:hover {
    border-color: var(--text-primary);
}

.project-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.project-description {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.project-meta {
    display: flex;
    gap: 20px;
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.project-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.link-item:last-child {
    border-bottom: none;
}

.link-label {
    color: var(--text-muted);
    min-width: 100px;
}

.link-value {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-value:hover {
    color: var(--text-primary);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 12px;
}

.loading::before {
    content: '> ';
    color: var(--accent);
}

.music-player {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.album-art {
    width: 60px;
    height: 60px;
    border: 1px solid var(--border);
    object-fit: cover;
    display: none;
}

.album-art.visible {
    display: block;
}

.progress-container {
    width: 100%;
    height: 4px;
    background: var(--border);
    margin-top: 8px;
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.progress-container.visible {
    display: block;
}

.progress-bar {
    height: 100%;
    background: var(--text-primary);
    width: 0%;
    transition: width 0.1s linear;
}

.spotify-badge {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

#spotify-section {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#spotify-section.visible {
    display: block;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

#spotify-section.hiding {
    animation: fadeOut 0.3s ease forwards;
}

#activity-section.hiding {
    animation: fadeOut 0.3s ease forwards;
}

.spotify-player {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.spotify-player:hover {
    border-color: #1DB954;
    background: rgba(29, 185, 84, 0.05);
    transform: translateY(-2px);
}

.spotify-player::after {
    content: '↗';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 18px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spotify-player:hover::after {
    opacity: 1;
    color: #1DB954;
}

.spotify-album-art {
    width: 80px;
    height: 80px;
    border: 1px solid var(--border);
    object-fit: cover;
    flex-shrink: 0;
}

.spotify-info {
    flex: 1;
    min-width: 0;
}

.spotify-info h4 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-album {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-progress {
    width: 100%;
    height: 4px;
    background: var(--border);
    margin-top: 10px;
    border-radius: 2px;
    overflow: hidden;
}

.spotify-progress-bar {
    height: 100%;
    background: #1DB954;
    width: 0%;
    transition: width 0.1s linear;
}

.spotify-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #1DB954;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.spotify-badge-live::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #1DB954;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Activity Section Styles */
#activity-section {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#activity-section.visible {
    display: block;
    animation: fadeIn 0.5s ease forwards;
}

.activity-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.activity-card:last-child {
    margin-bottom: 0;
}

.activity-card:hover {
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

.activity-image {
    width: 80px;
    height: 80px;
    border: 1px solid var(--border);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.activity-placeholder {
    width: 80px;
    height: 80px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.activity-details {
    flex: 1;
    min-width: 0;
}

.activity-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-state {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-details-text {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-time {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.custom-status {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.custom-status-emoji {
    font-size: 20px;
    flex-shrink: 0;
}

.custom-status-emoji img {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
}

.custom-status-text {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
}

.player-controls {
    display: flex;
    gap: 8px;
}

.player-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    position: relative;
}

.player-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(183, 148, 246, 0.05);
    transform: translateY(-1px);
}

.player-btn:active {
    transform: translateY(0);
    background: rgba(183, 148, 246, 0.1);
}

.player-btn.playing {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.audio-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.audio-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    animation: pulse-slow 2s ease-in-out infinite;
}

.overlay-content h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.overlay-content p {
    font-size: 14px;
    color: var(--text-muted);
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.player-info {
    flex: 1;
}

.player-info h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.player-info p {
    font-size: 11px;
    color: var(--text-muted);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.volume-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    outline: none;
    border-radius: 2px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: var(--text-primary);
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--text-muted);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    background: var(--text-primary);
    transform: scale(1.2);
}

/* Typewriter cursor */
.typewriter {
    display: inline;
}

.typewriter-cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: var(--text-primary);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

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

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .music-player {
        flex-direction: column;
        align-items: flex-start;
    }

    .album-art {
        width: 50px;
        height: 50px;
    }

    .spotify-player {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        gap: 15px;
    }

    .spotify-album-art {
        width: 60px;
        height: 60px;
    }

    .spotify-info {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .spotify-info h4,
    .spotify-info p,
    .spotify-album {
        max-width: 100%;
    }

    .spotify-progress {
        width: 100%;
        max-width: 100%;
    }

    .activity-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        gap: 15px;
    }

    .activity-image {
        width: 60px;
        height: 60px;
    }

    .activity-placeholder {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .activity-details {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .activity-name,
    .activity-state,
    .activity-details-text {
        max-width: 100%;
    }

    .header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .header-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }

    .controls-hint {
        font-size: 9px;
    }

    .theme-selector {
        width: 100%;
    }

    .theme-dropdown {
        flex: 1;
    }

    .spotify-player::after {
        top: 15px;
        right: 15px;
    }

    .project-item {
        padding: 15px;
    }

    .project-name {
        font-size: 14px;
    }

    .project-description {
        font-size: 12px;
    }

    .project-meta {
        gap: 15px;
        font-size: 10px;
    }
}
