/* ==========================================
   CSS Design System - YouTube Link Copier
   ========================================== */

/* CSS Variables */
:root {
    /* Colors */
    --color-primary: #FF0033;
    --color-primary-light: #FF3355;
    --color-primary-dark: #CC0029;
    --color-secondary: #282828;
    --color-accent: #AAAAAA;

    /* Background Colors */
    --bg-dark: #0f0f0f;
    --bg-card: rgba(30, 30, 30, 0.8);
    --bg-input: rgba(45, 45, 45, 0.9);
    --bg-hover: rgba(255, 255, 255, 0.05);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #717171;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #FF0033 0%, #FF6B6B 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    --gradient-bg: radial-gradient(ellipse at top, #1a1a2e 0%, #0f0f0f 50%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(255, 0, 51, 0.3);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
}

/* Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    background-image: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Decorations */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--color-primary);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: #6366f1;
    bottom: -150px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: #ec4899;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing-xl);
    flex: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.youtube-icon {
    width: 48px;
    height: 48px;
    color: var(--color-primary);
    filter: drop-shadow(0 0 10px rgba(255, 0, 51, 0.5));
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    animation: fadeInUp 0.6s ease-out backwards;
}

.glass-card:nth-child(2) {
    animation-delay: 0.1s;
}

.glass-card:nth-child(3) {
    animation-delay: 0.2s;
}

.glass-card:nth-child(4) {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header h2 svg {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
}

/* Input Group */
.input-group {
    display: flex;
    gap: var(--spacing-sm);
}

.input-group input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-normal);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 51, 0.2);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm), 0 0 20px rgba(255, 0, 51, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-small {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-icon-svg {
    width: 18px;
    height: 18px;
}

/* Loading Spinner */
.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* URL Formats */
.url-formats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.format-title {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.url-formats code {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

/* API Hint */
.api-hint {
    margin-top: var(--spacing-md);
    font-size: 0.875rem;
}

.api-hint a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.api-hint a:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
}

/* Progress Section */
.progress-section {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.progress-header h3 {
    font-size: 1rem;
    font-weight: 500;
}

#progressText {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    transition: width 0.3s ease-out;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.results-info h2 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.2rem;
    font-weight: 600;
}

.results-info h2 svg {
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}

.video-count {
    background: var(--gradient-primary);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Shorts Section Styles */
.shorts-section {
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.shorts-section .results-info h2 svg {
    color: #a855f7;
}

.shorts-count {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%) !important;
}

.btn-shorts {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    color: white;
    box-shadow: var(--shadow-sm), 0 0 20px rgba(168, 85, 247, 0.3);
}

.btn-shorts:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(168, 85, 247, 0.4);
}

.btn-shorts:active {
    transform: translateY(0);
}

.btn-shorts svg {
    width: 18px;
    height: 18px;
}

.btn-shorts-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    background: rgba(168, 85, 247, 0.1);
    color: var(--text-primary);
}

.btn-shorts-secondary:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
}

.btn-shorts-secondary svg {
    width: 18px;
    height: 18px;
}

.short-item {
    border-color: rgba(168, 85, 247, 0.15);
}

.short-item:hover {
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.05);
}

.short-index {
    background: rgba(168, 85, 247, 0.1) !important;
    color: #a855f7 !important;
}

.btn-copy-short:hover {
    background: #a855f7 !important;
    border-color: #a855f7 !important;
}

.results-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Video List */
.video-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: var(--spacing-sm);
}

.video-list::-webkit-scrollbar {
    width: 6px;
}

.video-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.video-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.video-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.video-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    transition: all var(--transition-fast);
    animation: slideIn 0.3s ease-out backwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.video-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.video-index {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 0, 51, 0.1);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
}

.video-info {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-link a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.video-link a:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 0.85rem;
}

.video-duration {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
}

.video-url {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-url:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
}

.video-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.btn-copy-single {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy-single:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.btn-copy-single svg {
    width: 16px;
    height: 16px;
}

/* Copy Toast */
.copy-toast {
    position: fixed;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: #10b981;
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transition: all var(--transition-normal);
}

.copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.copy-toast svg {
    width: 20px;
    height: 20px;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: var(--spacing-md);
    }

    .logo {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .logo h1 {
        font-size: 1.3rem;
        text-align: center;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group button {
        width: 100%;
    }

    .url-formats {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-actions {
        width: 100%;
    }

    .results-actions button {
        flex: 1;
    }

    .video-item {
        flex-wrap: wrap;
    }

    .video-info {
        width: calc(100% - 56px);
    }

    .video-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .youtube-icon {
        width: 36px;
        height: 36px;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .glass-card {
        padding: var(--spacing-md);
    }
}