/* === PREMIUM GLOSSY · GREEN + BLUE THEME === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #26A69A;
    --surface: #80DEEA;
    --surface-strong: #26A69A;
    --text: #3949AB;
    --text-muted: #3d5368;
    --text-soft: #5a7085;
    --green: #00897b;
    --green-light: #00bfa5;
    --blue: #00796B;
    --blue-light: #00796B;
    --cyan: #00bcd4;
    --danger: #d82a44;
    --radius-lg: 36px;
    --radius-md: 22px;
    --radius-sm: 14px;
    --shadow: 0 18px 50px rgba(0, 40, 80, 0.10);
    --glow-blue: 0 8px 28px rgba(41, 121, 255, 0.28);
    --glow-green: 0 6px 20px rgba(0, 137, 123, 0.22);
}

body {
    background: linear-gradient(145deg, #e0ecf7 0%, #eef5fb 40%, #e4f0f6 100%);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    min-height: 100vh;

    line-height: 1.45;

}

.app-container {
    max-width: 900px;
    width: 100%;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    margin: 1rem auto;

}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.55rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--green), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.4px;
}

.logo i {
    -webkit-text-fill-color: var(--blue);
    font-size: 1.9rem;
    filter: drop-shadow(0 2px 6px rgba(41, 121, 255, 0.35));
}

/* Buttons */
.btn {
    background: rgba(230, 242, 252, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    color: var(--text);
    padding: 9px 18px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 3px 10px rgba(0, 40, 80, 0.05);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 40, 80, 0.10);
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: #fff;
    border: none;
    box-shadow: var(--glow-blue);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--blue-light), #26c6da);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.65);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.92);
}

.btn-danger {
    background: linear-gradient(135deg, #c62828, #ef5350);
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e53935, #ef9a9a);
}

.btn-success {
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: #fff;
    border: none;
    box-shadow: var(--glow-green);
}

.btn-success:hover {
    background: linear-gradient(135deg, #009688, #69f0ae);
}

/* Player */
.player-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.video-wrapper {
    position: relative;
    background: linear-gradient(160deg, #dce8f4 0%, #e8f0f8 100%);
    border-radius: 28px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.04), 0 10px 36px rgba(0, 40, 80, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.video-wrapper video,
.video-wrapper iframe {
    width: 100%;
    height: 100%;
    display: block;
    background: #dce8f4;
    border: none;
    object-fit: contain;
}

/* Audio visual mode */
.audio-visual {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: linear-gradient(160deg, #d4e8f0 0%, #e0f0f6 50%, #d8eaf4 100%);
    z-index: 2;
}

.video-wrapper.audio-mode .audio-visual {
    display: flex;
}

.video-wrapper.audio-mode video {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 1px;
    height: 1px;
}

.audio-art {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 40px rgba(41, 121, 255, 0.35),
        inset 0 2px 8px rgba(255, 255, 255, 0.35);
    animation: pulse-art 3s ease-in-out infinite;
}

.audio-art i {
    font-size: 3rem;
    color: #fff;
}

@keyframes pulse-art {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 12px 40px rgba(41, 121, 255, 0.35);
    }

    50% {
        transform: scale(1.04);
        box-shadow: 0 16px 50px rgba(0, 137, 123, 0.4);
    }
}

.audio-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 48px;
}

.audio-bars span {
    width: 7px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--blue), var(--green));
    animation: bar-dance 1.1s ease-in-out infinite;
    opacity: 0.85;
}

.audio-bars span:nth-child(1) {
    height: 18px;
    animation-delay: 0.05s;
}

.audio-bars span:nth-child(2) {
    height: 32px;
    animation-delay: 0.15s;
}

.audio-bars span:nth-child(3) {
    height: 22px;
    animation-delay: 0.25s;
}

.audio-bars span:nth-child(4) {
    height: 40px;
    animation-delay: 0.1s;
}

.audio-bars span:nth-child(5) {
    height: 28px;
    animation-delay: 0.3s;
}

.audio-bars span:nth-child(6) {
    height: 36px;
    animation-delay: 0.2s;
}

.audio-bars span:nth-child(7) {
    height: 16px;
    animation-delay: 0.35s;
}

.audio-bars span:nth-child(8) {
    height: 30px;
    animation-delay: 0.12s;
}

.video-wrapper:not(.playing) .audio-bars span {
    animation-play-state: paused;
    height: 12px !important;
}

@keyframes bar-dance {

    0%,
    100% {
        transform: scaleY(0.45);
    }

    50% {
        transform: scaleY(1);
    }
}

.audio-title-overlay {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
    max-width: 80%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading */
.loading-spinner {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(41, 121, 255, 0.15);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    opacity: 0;
    pointer-events: none;
    z-index: 15;
    transition: opacity 0.25s;
}

.video-wrapper.loading .loading-spinner {
    opacity: 1;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error */
.error-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #b71c1c;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    text-align: center;
    padding: 28px;
    z-index: 20;
}

.error-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.error-overlay i {
    font-size: 2.8rem;
    color: #e53935;
}

/* Center play */
.center-play {
    position: absolute;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    border: none;
    color: #fff;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s, opacity 0.3s;
    box-shadow: var(--glow-blue);
    z-index: 12;
    opacity: 0.95;
}

.center-play:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px rgba(41, 121, 255, 0.45);
}

.video-wrapper.paused .center-play {
    opacity: 1;
    pointer-events: auto;
}

.video-wrapper:not(.paused) .center-play {
    opacity: 0;
    pointer-events: none;
}

/* Boost badge */
.boost-indicator {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    padding: 7px 16px;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(0, 137, 123, 0.28);
    color: var(--green);
    opacity: 0;
    transform: translateY(-8px);
    transition: 0.25s;
    pointer-events: none;
    font-size: 0.88rem;
    box-shadow: 0 4px 14px rgba(0, 137, 123, 0.12);
    z-index: 12;
}

.boost-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Controls overlay */
.controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.88) 65%);
    backdrop-filter: blur(6px);
    padding: 18px 20px 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 11;
}

.controls-overlay.active,
.video-wrapper:hover .controls-overlay,
.video-wrapper.paused .controls-overlay {
    opacity: 1;
    pointer-events: auto;
}

.progress-container {
    position: relative;
    width: 100%;
    height: 7px;
    background: rgba(41, 121, 255, 0.12);
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 12px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.buffered-bar {
    position: absolute;
    height: 100%;
    background: rgba(41, 121, 255, 0.22);
    border-radius: 10px;
    width: 0%;
    pointer-events: none;
}

.progress-bar {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--blue), var(--cyan));
    border-radius: 10px;
    width: 0%;
    pointer-events: none;
    box-shadow: 0 0 16px rgba(41, 121, 255, 0.3);
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.15rem;
    padding: 6px 9px;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.18s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.control-btn:hover {
    background: rgba(41, 121, 255, 0.12);
    color: var(--green);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.volume-slider-container {
    width: 90px;
}

.volume-slider {
    width: 100%;
    accent-color: var(--blue);
    height: 4px;
    border-radius: 10px;
    cursor: pointer;
}

.volume-boost-badge {
    font-size: 0.72rem;
    background: rgba(0, 137, 123, 0.12);
    padding: 2px 9px;
    border-radius: 30px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
    color: var(--green);
}

.time-display {
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

/* Speed menu */
.speed-selector {
    position: relative;
}

.speed-menu {
    position: absolute;
    bottom: 42px;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    border-radius: 16px;
    padding: 6px 0;
    min-width: 88px;
    box-shadow: 0 12px 36px rgba(0, 40, 80, 0.14);
    opacity: 0;
    transform: scale(0.94);
    pointer-events: none;
    transition: 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.7);
    z-index: 30;
}

.speed-menu.open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.speed-option {
    padding: 8px 18px;
    font-size: 0.88rem;
    cursor: pointer;
    color: var(--text);
    transition: 0.1s;
}

.speed-option:hover {
    background: rgba(41, 121, 255, 0.08);
}

.speed-option.active {
    color: var(--blue);
    font-weight: 700;
}

/* Info */
.video-info {
    padding: 4px 2px;
}

.video-title {
    font-size: 1.55rem;
    font-weight: 650;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--green), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 4px 0 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 6px 0 8px;
}

.shortcuts-hint {
    font-size: 0.78rem;
    color: var(--text-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 4px;
    align-items: center;
}

kbd {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    padding: 1px 8px;
    border-radius: 7px;
    font-size: 0.72rem;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.85);
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Watchlist panel */
.watchlist-panel {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(14px);
    border-radius: 28px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.15rem;
    font-weight: 550;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
}

.panel-header h2 i {
    color: var(--blue);
}

.watchlist-count {
    background: rgba(41, 121, 255, 0.12);
    border-radius: 30px;
    padding: 1px 11px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
}

.watchlist-items {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-right: 4px;
}

.watchlist-items::-webkit-scrollbar {
    width: 5px;
}

.watchlist-items::-webkit-scrollbar-track {
    background: rgba(41, 121, 255, 0.06);
    border-radius: 10px;
}

.watchlist-items::-webkit-scrollbar-thumb {
    background: rgba(41, 121, 255, 0.25);
    border-radius: 10px;
}

.watchlist-item {
    display: flex;
    align-items: center;
    gap: 11px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(4px);
    padding: 9px 13px;
    border-radius: 16px;
    cursor: pointer;
    transition: 0.18s;
    border-left: 4px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.watchlist-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(3px);
}

.watchlist-item.active {
    background: rgba(41, 121, 255, 0.1);
    border-left-color: var(--blue);
}

.item-thumb {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, rgba(0, 137, 123, 0.15), rgba(41, 121, 255, 0.15));
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    flex-shrink: 0;
}

.item-info {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.item-title {
    font-weight: 550;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.item-url {
    font-size: 0.68rem;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-remove {
    background: transparent;
    border: none;
    color: var(--text-soft);
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 30px;
    font-size: 0.95rem;
    transition: 0.15s;
    flex-shrink: 0;
}

.item-remove:hover {
    color: var(--danger);
    background: rgba(211, 47, 47, 0.08);
}

.empty-watchlist {
    text-align: center;
    padding: 20px 0;
    color: var(--text-soft);
}

.empty-watchlist i {
    font-size: 1.9rem;
    opacity: 0.25;
    display: block;
    margin-bottom: 6px;
}

/* Add form */
.add-video-form {
    display: flex;
    flex-direction: column;
    gap: 11px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(4px);
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 550;
}

.form-group input {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 50px;
    padding: 10px 15px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: 0.2s;
}

.form-group input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.12);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    padding: 13px 26px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 11px;
    box-shadow: 0 12px 40px rgba(0, 40, 80, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.65);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 999;
    color: var(--text);
    font-weight: 550;
    font-size: 0.92rem;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast i {
    font-size: 1.15rem;
}

.toast.success i {
    color: var(--green);
}

.toast.error i {
    color: #e53935;
}

.toast.info i {
    color: var(--blue);
}

/* Responsive */
@media (max-width: 900px) {
    .app-container {
        padding: 14px;
        border-radius: 28px;
    }

    .controls-left,
    .controls-right {
        gap: 5px;
    }

    .volume-slider-container {
        width: 70px;
    }

    .audio-art {
        width: 90px;
        height: 90px;
    }

    .audio-art i {
        font-size: 2.3rem;
    }
}

@media (max-width: 600px) {
    .logo span {
        display: none;
    }

    .video-title {
        font-size: 1.2rem;
    }

    .center-play {
        width: 64px;
        height: 64px;
        font-size: 1.8rem;
    }

    .shortcuts-hint {
        display: none;
    }
}