/* Modern Glassmorphism Design System */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-gradient: linear-gradient(45deg, #1a1a2e, #16213e, #1f4287);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-color: #4ecca3;
    --danger-color: #e23e57;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
    width: 100%;
}

/* Header Section */
.hero {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Glass Card Component */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    padding: 2.5rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.45);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Input Section */
.input-section {
    position: relative;
    max-width: 800px;
    margin: 0 auto 3rem;
    z-index: 10;
}

.input-wrapper {
    position: relative;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.url-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    color: white;
    font-size: 1.1rem;
    transition: var(--transition);
    min-width: 300px;
}

.url-input:focus {
    outline: none;
    border-color: #a5b4fc;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 4px rgba(165, 180, 252, 0.1);
}

.url-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(5px);
}

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

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 4rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.feature-item {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Result Section */
.result-container {
    max-width: 800px;
    margin: 2rem auto;
    display: none;
}

.result-container.active {
    display: block;
    animation: slideUp 0.5s ease-out;
}

.video-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.video-thumb {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.video-thumb img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.video-thumb:hover img {
    transform: scale(1.05);
}

.video-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.meta-row {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-download {
    background: var(--accent-color);
    color: #1a1a2e;
    font-weight: 700;
}

.btn-download:hover {
    background: #5eeec0;
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.4);
}

/* Status & Toast */
.status-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

.status-indicator.offline .status-dot {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px var(--danger-color);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30, 30, 40, 0.95);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    border-color: var(--danger-color);
}

.toast.success {
    border-color: var(--accent-color);
}

/* Loaders */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
    margin-top: auto;
}

.admin-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 15px;
}

.admin-link {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.admin-link:hover {
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .video-card {
        grid-template-columns: 1fr;
    }
    
    .logo {
        font-size: 2.5rem;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .container {
        padding: 20px 15px;
    }
}
