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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, 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: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, 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: inherit;
}

.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;
}

.btn-audio {
    flex: 1;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 8px;
    padding: 16px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-audio:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.slideshow-section {
    margin: 25px 0 15px;
    text-align: left;
}

.slideshow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.slideshow-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(126, 127, 163, 0.2);
    border: 1px solid rgba(126, 127, 163, 0.4);
    color: #e0e2ff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.btn-zip {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-zip:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.slideshow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
    margin-top: 10px;
    max-height: 440px;
    overflow-y: auto;
    padding: 4px;
}

.slideshow-grid::-webkit-scrollbar {
    width: 6px;
}

.slideshow-grid::-webkit-scrollbar-thumb {
    background: rgba(126, 127, 163, 0.4);
    border-radius: 3px;
}

.slideshow-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #141522;
    border: 1px solid rgba(126, 127, 163, 0.3);
    aspect-ratio: 9 / 16;
    transition: all 0.3s;
    cursor: pointer;
}

.slideshow-item:hover {
    transform: scale(1.03);
    border-color: #667eea;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.slideshow-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slideshow-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slideshow-item-overlay span {
    font-size: 11px;
    color: #e0e2ff;
    font-weight: 600;
}

.btn-photo-download {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 11px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-photo-download:hover {
    background: white;
    color: #0d0e14;
}

.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; }
}
