:root {
    --bg-dark: #0f172a;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #06b6d4;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --success-hover: #059669;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--primary);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: var(--secondary);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.2); }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    margin-top: 2rem;
}

.logo {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.header h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.header p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    border: 2px dashed rgba(139, 92, 246, 0.5);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(139, 92, 246, 0.05);
}

.file-label:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
}

.upload-options {
    display: flex;
    gap: 1rem;
    border: 2px dashed transparent;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.upload-options.dragover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

@media (max-width: 600px) {
    .upload-options {
        flex-direction: column;
    }
}

.upload-options .file-label {
    flex: 1;
    padding: 2rem 1rem;
    text-align: center;
}

.file-label-alt {
    border: 2px dashed rgba(6, 182, 212, 0.5);
    background: rgba(6, 182, 212, 0.05);
}

.file-label-alt:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--secondary);
}

.file-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#files-input {
    display: none;
}

.text-center {
    text-align: center;
}

.thumbnail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    max-height: 150px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.thumbnail-container::-webkit-scrollbar {
    width: 6px;
}
.thumbnail-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.thumbnail-item {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
}

.thumbnail-more {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.2);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    border: 1px dashed var(--primary);
}

input[type="number"] {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1.1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.primary-btn, .success-btn {
    width: 100%;
    padding: 1.2rem;
    border-radius: 12px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #475569;
    box-shadow: none;
}

.success-btn {
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    margin-top: 1.5rem;
}

.success-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.hidden {
    display: none !important;
}

#progress-container {
    margin-top: 2rem;
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

#progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    transition: width 0.3s ease;
}

.status-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.success-message {
    color: var(--success);
    margin-top: 1rem;
    font-weight: 500;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

.mt-4 {
    margin-top: 2rem;
}

.seo-content {
    padding: 2rem;
}

.seo-content h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.seo-content p {
    color: var(--text-muted);
    line-height: 1.6;
}

footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    margin-top: auto;
}

footer p {
    color: var(--text-muted);
}

footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--primary);
}
