:root {
    --bg-color: #0f0f13;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary-color: #6c5ce7;
    --primary-hover: #5649c0;
    --blob-1: #6c5ce7;
    --blob-2: #00cec9;
    --glass-blur: 20px;
}

[data-theme="pink"] {
    --bg-color: #ffcfce;
    --text-primary: #ffaaaa;
    --text-secondary: #ffaaaa;
    --card-bg: #ffe2e3;
    --card-border: #ffffff;
    --primary-color: #ffaaaa;
    --primary-hover: #ffcfce;
    --blob-1: #ffcfce;
    --blob-2: #ffe2e3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

[data-theme="pink"] body {
    background-image: none;
}

/* Background Animation */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: var(--blob-1);
    top: 10%;
    left: 20%;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--blob-2);
    bottom: 10%;
    right: 10%;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0) rotate(0deg);
    }

    to {
        transform: translate(50px, 50px) rotate(20deg);
    }
}

/* App Container */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: background 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: var(--card-bg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: background 0.3s;
}

.icon-btn:hover {
    background: var(--card-bg);
}

/* Glass Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, border-color 0.3s;
}

.glass-card:hover {
    border-color: var(--primary-color);
}

/* Input Section */
.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}

input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.clear-input {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Video Info */
.video-info {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
}

.meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.meta h2 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badge {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.divider {
    height: 1px;
    background: var(--card-border);
    margin: 15px 0;
}

/* Controls */
.toggle-group {
    padding: 4px;
    border-radius: 12px;
    display: flex;
    margin-bottom: 20px;
}

.toggle-group input[type="radio"] {
    display: none;
}

.toggle-group label {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.toggle-group input:checked+label {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
}

.action-btn:hover {
    transform: scale(1.02);
}

/* History */
.history-section h3 {
    margin-bottom: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 10px;
    animation: fadeIn 0.5s ease;
}

.history-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.history-info {
    flex: 1;
}

.history-info h4 {
    font-size: 0.95rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.history-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-style: italic;
}

/* Utilities */
.hidden {
    display: none !important;
}

.loader {
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}