:root {
    --bg-color: #0d0f12;
    --text-main: #ffffff;
    --text-muted: #8b92a5;
    --primary: #ff5500; /* SoundCloud Orange */
    --primary-hover: #ff7733;
    --secondary: #1db954; /* Spotify Green for contrast */
    --secondary-hover: #1ed760;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Animated Blobs */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
    position: relative;
}

.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn:hover {
    color: white;
}

.lang-btn.active {
    background: var(--primary);
    color: white;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 3rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #b3b3b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* —— dichvu.ovh auth —— */
.auth-section {
    width: 100%;
    margin-bottom: 1.75rem;
    padding: 1.25rem 1.5rem;
}

.auth-section-head {
    margin-bottom: 1rem;
}

.auth-title {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.auth-title i {
    color: var(--primary);
}

.auth-title-ip-line {
    font-weight: 600;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
}

.client-ip-value {
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: 0.02em;
}

.auth-details {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.auth-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-detail-row:last-of-type {
    border-bottom: none;
}

.auth-dt-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.82rem;
}

.auth-dt-value {
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}

.auth-key-foot {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.auth-policy {
    margin-top: 0.85rem;
    padding: 0.75rem 1rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #ffb84d;
    background: rgba(255, 184, 77, 0.08);
    border: 1px solid rgba(255, 184, 77, 0.28);
    border-radius: 10px;
}

.auth-policy strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
}

.auth-policy p {
    margin: 0;
    color: rgba(255, 220, 180, 0.95);
}

.mono.subtle {
    font-size: 0.85em;
    opacity: 0.75;
}

.auth-form-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.auth-input {
    width: 100%;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.auth-input:focus {
    border-color: var(--primary);
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, filter 0.15s;
}

.auth-btn:active {
    transform: scale(0.98);
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--primary), #cc4400);
    color: #fff;
}

.auth-btn.primary:hover {
    filter: brightness(1.08);
}

.auth-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.auth-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.auth-btn.ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    margin-top: 0.5rem;
}

.auth-btn.ghost:hover {
    color: #fff;
    border-color: var(--text-muted);
}

.auth-divider {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0.25rem 0;
    position: relative;
}

.auth-status-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-status-wrap.hidden,
.auth-form-wrap.hidden,
.hidden {
    display: none !important;
}

.auth-status-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-main);
}

.auth-status-text .ok {
    color: var(--secondary);
    font-weight: 600;
}

.auth-error {
    margin-top: 0.75rem;
    font-size: 0.88rem;
    color: #ff6b6b;
    min-height: 0;
    display: none;
}

.auth-error.show {
    display: block;
}

.input-section.disabled-wrap {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.2);
}

/* Input Section */
.input-section {
    width: 100%;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 5px 5px 5px 25px;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(255, 85, 0, 0.2);
}

.input-icon {
    color: var(--text-muted);
    font-size: 1.2rem;
}

#url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    padding: 15px;
    outline: none;
    font-family: inherit;
}

#url-input::placeholder {
    color: var(--text-muted);
}

#extract-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 40px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

#extract-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

#extract-btn:active {
    transform: scale(0.98);
}

#extract-btn.loading .btn-text,
#extract-btn.loading .btn-icon {
    opacity: 0;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

#extract-btn.loading .spinner {
    display: block;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.error-message {
    color: #ff4444;
    text-align: center;
    margin-top: 15px;
    min-height: 20px;
    font-size: 0.95rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

/* Result Section */
.result-section {
    width: 100%;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.result-section.hidden {
    display: none;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.track-card {
    display: flex;
    gap: 30px;
    align-items: center;
}

.track-artwork {
    width: 180px;
    height: 180px;
    border-radius: 15px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    position: relative;
}

.track-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.track-artwork:hover img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.play-overlay i {
    font-size: 3rem;
    color: white;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
    transition: transform 0.2s ease;
}

.play-overlay:hover i {
    transform: scale(1.1);
}

.track-artwork:hover .play-overlay {
    opacity: 1;
}

.play-overlay.playing i::before {
    content: "\f04c"; /* fa-pause */
}

.track-info {
    flex: 1;
    min-width: 0; /* Prevents flex children from overflowing */
}

.track-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.link-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

#stream-link {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 12px 15px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    outline: none;
}

.icon-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    color: white;
    width: 45px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.2);
}

.icon-btn.success {
    background: var(--secondary);
    border-color: var(--secondary);
}

/* Tooltip */
.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.action-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.primary-btn {
    background: var(--secondary);
    color: #000;
}

.primary-btn:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(29, 185, 84, 0.3);
}

.secondary-btn {
    background: var(--primary);
    color: white;
}

.secondary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 85, 0, 0.3);
}

.hls-warning {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #ffb84d;
    background: rgba(255, 184, 77, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 184, 77, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.hls-warning.hidden {
    display: none;
}

.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .track-card {
        flex-direction: column;
        text-align: center;
    }

    .track-artwork {
        width: 200px;
        height: 200px;
    }

    .action-buttons {
        flex-direction: column;
    }
    
    .input-group {
        flex-direction: column;
        padding: 5px;
        border-radius: 20px;
        gap: 10px;
    }
    
    .input-icon {
        display: none;
    }
    
    #url-input {
        width: 100%;
        text-align: center;
    }
    
    #extract-btn {
        width: 100%;
        justify-content: center;
    }
}
