/* ================================
   Astrl Cosmic Visualizer Styles
   ================================ */

/* CSS Variables - Astrl Theme */
:root {
    --astrl-dark: #0d1225;
    --astrl-light: #f8fafc;
    --astrl-accent: #a78bfa;
    --astrl-accent-light: #c4b5fd;
    --astrl-gold: #fcd34d;
    --astrl-blue: #1e3a8a;

    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--astrl-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Selection */
::selection {
    background: var(--astrl-accent);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--astrl-dark);
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--astrl-accent);
}

/* Starfield Canvas */
#starCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, #a78bfa, #c4b5fd, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 20px 0 24px;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Visualizer Canvas */
#visualizer {
    width: 100%;
    height: 350px;
    background: rgba(13, 18, 37, 0.8);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow:
        0 0 60px rgba(167, 139, 250, 0.1),
        inset 0 0 60px rgba(0, 0, 0, 0.3);
}

/* Controls Wrapper */
.controls-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

/* Control Section */
.control-section {
    padding: 20px;
}

.control-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--astrl-accent);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.section-icon {
    width: 18px;
    height: 18px;
}

/* Source Tabs */
.source-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn i {
    width: 20px;
    height: 20px;
}

.tab-btn:hover {
    background: rgba(167, 139, 250, 0.1);
    border-color: var(--astrl-accent);
    color: var(--text-primary);
}

.tab-btn.active {
    background: rgba(167, 139, 250, 0.15);
    border-color: var(--astrl-accent);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.2);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Action Button */
.action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--astrl-accent), #818cf8);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(167, 139, 250, 0.5);
}

.action-btn.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.action-btn i {
    width: 18px;
    height: 18px;
}

/* File Drop Zone */
.file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 20px;
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-drop i {
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
}

.file-drop p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

.file-drop:hover,
.file-drop.drag-over {
    border-color: var(--astrl-accent);
    background: rgba(167, 139, 250, 0.05);
}

.file-drop:hover i,
.file-drop.drag-over i {
    color: var(--astrl-accent);
}

/* Audio Player */
.audio-player {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.audio-player.hidden {
    display: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.file-info > i {
    width: 20px;
    height: 20px;
    color: var(--astrl-accent);
    flex-shrink: 0;
}

.file-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn i {
    width: 16px;
    height: 16px;
}

.icon-btn:hover {
    background: rgba(167, 139, 250, 0.15);
    border-color: var(--astrl-accent);
    color: var(--astrl-accent);
}

.icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.play-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--astrl-accent), #818cf8);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
}

.play-btn i {
    width: 20px;
    height: 20px;
}

.play-btn .hidden {
    display: none;
}

/* Progress */
.progress-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--astrl-accent), var(--astrl-accent-light));
    border-radius: 3px;
    transition: width 0.1s linear;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-control i {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.volume-control input {
    width: 70px;
}

/* Control Row */
.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-row label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Select Input */
.select-input {
    width: 160px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.select-input:focus {
    outline: none;
    border-color: var(--astrl-accent);
}

.select-input option {
    background: #1f2937;
    color: var(--text-primary);
}

/* Slider Input */
.slider-input {
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    appearance: none;
    cursor: pointer;
}

.slider-input::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--astrl-accent), var(--astrl-accent-light));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
    transition: transform 0.2s ease;
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--astrl-accent), var(--astrl-accent-light));
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

/* Toggle Row */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    cursor: pointer;
}

.toggle-row:last-child {
    margin-bottom: 0;
}

.toggle-row span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--astrl-accent), #818cf8);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    margin-top: 16px;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-dot.active {
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.error {
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

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

.status-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.version {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Site Footer */
.site-footer {
    position: relative;
    z-index: 10;
    border-top: 1px solid rgba(55, 65, 81, 1);
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-top: 40px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
}

.footer-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

@media (min-width: 768px) {
    .footer-main {
        flex-direction: row;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.footer-brand-text {
    text-align: center;
}

@media (min-width: 768px) {
    .footer-brand-text {
        text-align: left;
    }
}

.footer-brand-text h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.footer-brand-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

.footer-system {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(55, 65, 81, 1);
    text-align: center;
}

.footer-system p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .title {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    #visualizer {
        height: 280px;
    }

    .controls-wrapper {
        grid-template-columns: 1fr;
    }

    .control-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .select-input,
    .slider-input {
        width: 100%;
    }

    .player-controls {
        flex-wrap: wrap;
    }

    .volume-control {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .volume-control input {
        flex: 1;
    }

    .footer-main {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }

    .source-tabs {
        flex-direction: column;
    }

    .tab-btn {
        flex-direction: row;
        justify-content: center;
    }
}

