:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --text-secondary: #999999;
    --card-bg: #0A0A0A;
    --border-radius: 24px;
    
    /* Gradients matching the reference image */
    /* Apple: Red/Pink to Orange */
    --gradient-apple: linear-gradient(135deg, #FF4B1F 0%, #FF9068 100%);
    /* Figma: Cyan/White to Blue */
    --gradient-figma: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    /* Flutter (matching Framer's Purple/Pink vibe from image) */
    --gradient-flutter: linear-gradient(135deg, #c471ed 0%, #f64f59 100%);
    
    /* RGB Gradient (Combined) */
    --gradient-rgb: linear-gradient(90deg, #FF4B1F, #FF9068, #f64f59, #c471ed, #4facfe, #00f2fe, #FF4B1F);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden; /* Prevent horizontal scroll from glows */
    position: relative;
}

/* Background Beams Effect - Removed */

/* Header Styles */
.top-bar {
    width: 100%;
    max-width: 1200px;
    padding: 40px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* Changed from absolute to relative since bg is gone */
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.click-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: hint-bounce 1.5s infinite;
}

.click-hint.hidden {
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
}

.click-hint .arrow {
    font-size: 18px;
    color: #00f2fe; /* Cyan arrow */
}

@keyframes hint-bounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-5px); }
}

.logo {

    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.logo svg {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo-text {
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
    font-family: 'Courier New', monospace; /* Code font */
    font-size: 16px;
    color: #00f2fe; /* Cyan color */
    background: rgba(255, 255, 255, 0.1);
    padding: 0;
    border-radius: 8px;
    transition: max-width 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease 0.1s, padding 0.3s ease;
}

.logo:hover .logo-text {
    max-width: 250px;
    opacity: 1;
    padding: 8px 12px;
}

.logo:hover svg {
    transform: scale(1.1) rotate(-5deg);
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.5));
}

.social-icons {
    display: flex;
    gap: 16px;
}

.social-icon {
    color: var(--text-secondary);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon:hover {
    color: var(--text-color);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.cards-container {
    display: flex;
    gap: 40px; /* Increased gap for glow */
    padding: 60px 20px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
    align-items: center;
}

.card-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    
    /* Reveal Animation Init State */
    opacity: 0;
    visibility: hidden;
    transform: translateY(40px) scale(0.95);
    pointer-events: none;
}

.card-wrapper.visible {
    visibility: visible;
    pointer-events: auto;
    animation: revealCard 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Terminal Loader Styles */
.terminal-loader {
    position: absolute;
    inset: 0;
    background: #000000;
    border-radius: var(--border-radius);
    z-index: 10;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: 'Courier New', monospace;
    border: 1px solid #333;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.card-wrapper.loaded .terminal-loader {
    opacity: 0;
    pointer-events: none;
}

.terminal-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.terminal-controls {
    display: flex;
    gap: 6px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control.red { background-color: #ff5f56; }
.control.yellow { background-color: #ffbd2e; }
.control.green { background-color: #27c93f; }

.terminal-text {
    color: #00ff00;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    white-space: pre-wrap;
    overflow: hidden;
}

/* Blinking cursor effect */
.terminal-text::after {
    content: '_';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.card {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.1s ease-out;
    z-index: 1;
    opacity: 0; /* Hidden initially, shown after loader */
    transition: opacity 0.5s ease, transform 0.1s ease-out;
}

.card-wrapper.loaded .card {
    opacity: 1;
}

@keyframes revealCard {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Gradient Border (Inner) */
.card::before {
    content: "";
    position: absolute;
    inset: -4px; /* Border width */
    border-radius: calc(var(--border-radius) + 2px);
    z-index: -1;
    background: var(--gradient-default, white);
    background-size: 200% 200%;
    animation: gradient-flow 3s ease infinite;
}

/* Outer Glow */
.card::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: calc(var(--border-radius) + 2px);
    z-index: -2;
    background: var(--gradient-default, white);
    filter: blur(20px);
    opacity: 0.5;
    transition: opacity 0.3s ease;
    background-size: 200% 200%;
    animation: gradient-flow 3s ease infinite;
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.card:hover::after {
    opacity: 0.8;
}

/* Specific Card Gradients */
.card.apple-android {
    --gradient-default: var(--gradient-apple);
}

.card.figma {
    --gradient-default: var(--gradient-figma);
}

.card.flutter {
    --gradient-default: var(--gradient-flutter);
}

/* Update card content layout */
.card-content {
    background: var(--card-bg); /* Cover the center */
    border-radius: var(--border-radius);
    width: 100%;
    height: 100%;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Icon top, Text bottom */
    align-items: flex-start; /* Align content to left */
    z-index: 2;
}

.glow-bg {
    display: none; /* Remove old glow effect */
}

/* Detail Panel Styles */
.detail-panel {
    width: calc(320px * 2 + 40px); /* Two cards + gap */
    height: 320px;
    
    /* Transparent Background with Glass Effect */
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    
    position: relative;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    
    /* Default to a neutral or hidden state if JS fails, but provide a fallback */
    --panel-gradient: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    --main-color: #4facfe;
    
    z-index: 5;
    transform-origin: center;
    overflow: visible; /* Needed for glow */
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.detail-panel.visible {
    opacity: 1;
    animation: smoothOpen 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.detail-panel.hidden {
    display: none;
}

/* Gradient Border (Inner) - Masked for Transparency */
.detail-panel::before {
    content: "";
    position: absolute;
    inset: -4px; /* Border width matching card */
    border-radius: calc(var(--border-radius) + 2px);
    z-index: -1;
    background: var(--panel-gradient);
    background-size: 200% 200%;
    animation: gradient-flow 3s ease infinite;
    
    /* MASKING MAGIC: Create a hole in the center so the gradient is only a border */
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    padding: 4px; /* Matches inset -4px for the border thickness */
}

/* Outer Glow - Adjusted for Transparency */
.detail-panel::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: calc(var(--border-radius) + 2px);
    z-index: -2;
    background: var(--panel-gradient);
    filter: blur(20px); /* Matching card blur */
    opacity: 0.4; /* Reduced opacity to prevent overwhelming the transparent center */
    transition: opacity 0.3s ease;
    background-size: 200% 200%;
    animation: gradient-flow 3s ease infinite;

    /* MASKING MAGIC: Create a hole in the center so the glow is only outside */
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    padding: 4px; /* Matches inset -4px */
}

@keyframes smoothOpen {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Removed complex mask borders (::before) as we use background-origin now */

/* Scanline Effect - Moved to .detail-content::after */
.detail-content::after {
    content: "";
    position: absolute;
    inset: 0;
    /* Use main-color for the scanline gradient */
    background: linear-gradient(transparent 0%, var(--main-color) 50%, transparent 100%);
    z-index: 10;
    background-size: 100% 200%;
    opacity: 0;
    pointer-events: none;
    border-radius: var(--border-radius);
    /* Blend mode to make it look like a light projection */
    mix-blend-mode: screen; 
}

.detail-panel.visible .detail-content::after {
    animation: scanline 1.5s linear forwards;
}

@keyframes scanline {
    0% {
        background-position: 0% -100%;
        opacity: 0;
    }
    10% {
        opacity: 0.3; /* Reduced opacity for transparent effect */
    }
    100% {
        background-position: 0% 200%;
        opacity: 0;
    }
}

/* Hide inactive cards when one is selected */
.card-wrapper.hidden-by-selection {
    display: none;
}

.detail-content {
    background: transparent;
    border-radius: var(--border-radius);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden; /* Ensure content doesn't spill during anim */
}

.detail-title, .detail-body, .detail-tags {
    opacity: 0;
    transform: translateY(10px);
}

.detail-panel.visible .detail-title {
    animation: contentFadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s forwards;
}

.detail-panel.visible .detail-body {
    animation: contentFadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s forwards;
}

.detail-panel.visible .detail-tags {
    animation: contentFadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s forwards;
}

@keyframes contentFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.detail-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: white;
    background: none;
    -webkit-text-fill-color: white;
}

.detail-body {
    flex: 1;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    overflow-y: auto;
}

.detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-color);
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease, color 0.3s ease;
}

/* Tint the tags with the main color */
.detail-panel.visible .detail-tag {
    border-color: var(--main-color);
    color: #fff;
    box-shadow: 0 0 10px var(--main-color); /* Subtle glow */
    text-shadow: 0 0 5px var(--main-color);
}

/* Responsive adjustments */
@media (max-width: 1100px) {
    .detail-panel {
        width: 100%;
        max-width: 680px;
        height: auto;
        min-height: 320px;
        margin-top: 20px;
    }
}

/* Icons */
.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Left align icons */
    width: 100%;
}

.icon {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3)); /* Enhanced glow */
    transition: transform 0.3s ease;
}

.card:hover .icon {
    transform: scale(1.1) translateZ(20px);
}

.card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.card p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cards-container {
        padding-top: 100px;
    }
    
    /* Hide music player on mobile or move it */
    .music-player {
        display: none;
    }
}

.copyright {
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: auto;
    text-align: center;
    width: 100%;
}


/* Music Player Wrapper */
.music-player-wrapper {
    position: relative;
    width: 340px; /* Match min-width of player */
    height: 80px;
    margin: -20px auto 20px auto; /* Equal spacing from cards and copyright */
    
    /* Reveal Animation Init State */
    opacity: 0;
    visibility: hidden;
    transform: translateY(40px) scale(0.95);
    pointer-events: none;
    z-index: 1;
}

.music-player-wrapper.visible {
    visibility: visible;
    pointer-events: auto;
    animation: revealCard 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.music-player-wrapper.loaded .terminal-loader {
    opacity: 0;
    pointer-events: none;
}

.music-player-wrapper.loaded .music-player {
    opacity: 1;
}

/* Music Player Styles - Card Style */
.music-player {
    position: relative;
    width: 100%;
    height: 100%;
    
    /* Card Style Base */
    background: transparent;
    border-radius: var(--border-radius);
    z-index: 1; /* Creates stacking context */
    
    /* Layout */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 20px;
    
    /* Reset fixed positioning props */
    top: auto;
    left: auto;
    transform: none;
    
    opacity: 0; /* Hidden initially inside wrapper */
    transition: opacity 0.5s ease, transform 0.1s ease-out;
}

.music-player.hidden {
    /* This class might be redundant with opacity 0 but good for safety */
    display: flex; /* Keep flex layout but invisible via opacity */
}


/* Background Layer (Black) */
.player-bg {
    position: absolute;
    inset: 0;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    z-index: -1;
}

/* Gradient Border (Inner) */
.music-player::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--border-radius) + 2px);
    z-index: -2;
    background: var(--gradient-rgb);
    background-size: 300% 300%;
    animation: gradient-flow 5s linear infinite;
}

/* Outer Glow */
.music-player::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: calc(var(--border-radius) + 2px);
    z-index: -3;
    background: var(--gradient-rgb);
    filter: blur(20px);
    opacity: 0.5;
    transition: opacity 0.3s ease;
    background-size: 300% 300%;
    animation: gradient-flow 5s linear infinite;
}

.music-player:hover {
    transform: translateY(-5px);
}

.music-player:hover::after {
    opacity: 0.8;
}

/* Hide unused elements for compact view, but show controls */
.player-header, 
.playlist,
.progress-container {
    display: none;
}

.current-track {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
    flex: 1;
}

.track-art {
    width: 48px;
    height: 48px;
    background: transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    flex-shrink: 0;
    overflow: hidden; /* Ensure image respects border-radius */
}

.track-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-art svg {
    display: none;
}

.track-info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.track-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 12px;
    color: var(--text-secondary);
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
    gap: 12px;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: white;
}

.control-btn.play-pause {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.control-btn.play-pause:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.control-btn.play-pause svg {
    width: 20px;
    height: 20px;
}

/* Music Player Terminal Specifics */
.music-player-wrapper .terminal-header {
    display: none;
}

.music-player-wrapper .terminal-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
}

.equalizer-bar {
    width: 6px;
    height: 12px;
    background: #27c93f;
    border-radius: 2px;
    animation: equalizer 1s ease-in-out infinite;
}

.equalizer-bar:nth-child(1) { animation-delay: 0.0s; }
.equalizer-bar:nth-child(2) { animation-delay: 0.2s; }
.equalizer-bar:nth-child(3) { animation-delay: 0.4s; }
.equalizer-bar:nth-child(4) { animation-delay: 0.1s; }
.equalizer-bar:nth-child(5) { animation-delay: 0.3s; }

@keyframes equalizer {
    0%, 100% { height: 8px; opacity: 0.5; }
    50% { height: 24px; opacity: 1; }
}
