@font-face {
    font-family: 'Fresca';
    src: url('/static/fonts/FrescaRegular.woff2') format('woff2'),
         url('/static/fonts/FrescaRegular.woff') format('woff'),
         url('/static/fonts/FrescaRegular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Witch Halloween';
    src: url('/static/fonts/Witch Halloween.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

body {
    font-family: 'Fresca', sans-serif;
    background: #0d0e14;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 16px;
    position: relative;
    overflow-x: hidden;
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
    pointer-events: auto;
    cursor: default;
}

.container {
    position: relative;
    z-index: 100;
    max-width: 900px;
    width: 100%;
    padding: 40px 30px;
    text-align: center;
}

h1 {
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    font-family: 'Witch Halloween', sans-serif;
    text-align: center;
    background: linear-gradient(
        to right,
        #40ffaa,
        #4079ff,
        #40ffaa,
        #4079ff,
        #40ffaa
    );
    background-size: 300% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 8s ease-in-out infinite;
    cursor: pointer;
    user-select: none;
}

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

h1:hover {
    animation-play-state: paused;
}

.subtitle {
    font-size: 18px;
    color: #b9bbd9;
    margin-bottom: 40px;
    font-weight: 400;
    text-align: center;
}

.search-box {
    background: rgba(15, 16, 25, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    border: 1px solid rgba(126, 127, 163, 0.3);
    transition: all 0.3s;
    position: relative;
    z-index: 100;
}

.search-box:focus-within {
    border-color: rgba(126, 127, 163, 0.6);
    box-shadow: 0 0 20px rgba(126, 127, 163, 0.2);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 18px 20px;
    font-size: 16px;
    color: #ffffff;
    outline: none;
    font-family: 'Fresca', sans-serif;
}

.search-input::placeholder {
    color: #7e7fa3;
}

.btn-paste {
    background: rgba(126, 127, 163, 0.3);
    border: 1px solid rgba(126, 127, 163, 0.5);
    border-radius: 8px;
    padding: 18px 24px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-paste:hover {
    background: rgba(126, 127, 163, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(126, 127, 163, 0.3);
}

.btn-download {
    background: rgba(126, 127, 163, 0.3);
    border: 1px solid rgba(126, 127, 163, 0.5);
    border-radius: 8px;
    padding: 18px 32px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.btn-download:hover {
    background: rgba(126, 127, 163, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(126, 127, 163, 0.3);
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.video-card {
    background: rgba(15, 16, 25, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 25px;
    margin-top: 30px;
    border: 1px solid rgba(126, 127, 163, 0.3);
    display: none;
    animation: slideIn 0.5s ease;
    position: relative;
    z-index: 100;
}

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

.video-preview {
    width: 100%;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-info {
    text-align: left;
    margin-bottom: 15px;
}

.video-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.video-author {
    font-size: 14px;
    color: #b9bbd9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-author i {
    color: #fe2c55;
}

.download-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 16px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    flex: 1;
    background: rgba(126, 127, 163, 0.2);
    border: 1px solid rgba(126, 127, 163, 0.4);
    border-radius: 8px;
    padding: 16px;
    color: #b9bbd9;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(126, 127, 163, 0.3);
    color: white;
}

.loading {
    display: none;
    margin-top: 20px;
    color: #b9bbd9;
    font-size: 16px;
}

.loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.error-message {
    background: rgba(254, 44, 85, 0.1);
    border: 1px solid rgba(254, 44, 85, 0.3);
    color: #ff6b8a;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
    text-align: left;
}

.error-message i {
    margin-right: 8px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 40px;
}

.feature {
    background: rgba(15, 16, 25, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 20px 16px;
    border: 1px solid rgba(126, 127, 163, 0.2);
}

.feature i {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 12px;
}

.feature-text {
    font-size: 14px;
    color: #b9bbd9;
    font-weight: 500;
}

@media (max-width: 600px) {
    h1 {
        font-size: 36px;
    }

    .search-box {
        flex-direction: column;
    }

    .btn-paste {
        width: auto;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
    }

    .download-buttons {
        flex-direction: column;
    }
}
