/* Design System Tokens */
:root {
    --bg-dark: #0a0e17;
    --card-bg: rgba(20, 28, 47, 0.4);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Vibrant Neon Palette */
    --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --primary-color: #00f2fe;
    --secondary-color: #4facfe;
    --accent-gradient: linear-gradient(135deg, #f857a6 0%, #ff5858 100%);
    --accent-color: #f857a6;
    
    --success-color: #10b981;
    --error-color: #ef4444;
    
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Ambient animated background orbs */
.glow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    animation: orbFloat 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary-color);
    top: -10%;
    right: -10%;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: var(--accent-color);
    bottom: -20%;
    left: -10%;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 50px) scale(1.1); }
}

/* Star background effect */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 110px, #ddd, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 150px 180px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.25;
    z-index: -2;
}

/* Container */
.container {
    width: 100%;
    max-width: 800px;
    padding: 2.5rem 1.5rem;
    position: relative;
    z-index: 10;
}

/* Header styling */
.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-wrapper {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: var(--primary-gradient);
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.3);
    position: relative;
}

.logo-wrapper::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    background: var(--primary-gradient);
    z-index: -1;
    opacity: 0.5;
    filter: blur(8px);
}

.logo-icon {
    font-size: 2rem;
    color: var(--bg-dark);
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Premium Glassmorphism Card */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.main-card:hover {
    border-color: rgba(0, 242, 254, 0.2);
    box-shadow: 0 20px 60px rgba(0, 242, 254, 0.05);
}

/* Drag & Drop zone */
.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 0;
}

.dropzone-content {
    position: relative;
    z-index: 1;
}

.dropzone:hover {
    border-color: var(--primary-color);
    background: rgba(0, 242, 254, 0.02);
    transform: translateY(-2px);
}

.dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(0, 242, 254, 0.05);
}

.upload-icon {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition-smooth);
}

.dropzone:hover .upload-icon {
    transform: translateY(-5px);
}

.dropzone h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

/* Forms */
.injector-form {
    margin-top: 1.5rem;
    animation: fadeIn 0.4s ease-out;
}

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

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary-color);
}

.form-group input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

/* Input with action */
.input-with-action {
    display: flex;
    gap: 0.5rem;
}

.input-with-action input {
    flex: 1;
}

/* Buttons */
button, .btn-primary {
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    border-radius: 12px;
    outline: none;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--bg-dark);
    border: none;
    padding: 0.85rem 1.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.85rem 1.25rem;
}

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

.btn-cancel {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-color);
    padding: 0.85rem 1.5rem;
}

.btn-cancel:hover {
    background: rgba(239, 68, 68, 0.05);
    border-color: var(--error-color);
}

/* Image upload cards grid */
.image-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .image-upload-grid {
        grid-template-columns: 1fr;
    }
}

.image-upload-card {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.25rem;
}

.image-upload-card label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.75rem;
}

.image-preview-zone {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

.image-preview-zone.banner-zone {
    aspect-ratio: 2 / 1;
}

.image-preview-zone:hover {
    border-color: var(--primary-color);
}

.preview-placeholder {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.15);
    transition: var(--transition-smooth);
}

.image-preview-zone:hover .preview-placeholder {
    color: var(--primary-color);
    transform: scale(1.1);
}

.image-preview-zone img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    inset: 0;
    z-index: 2;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 23, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    opacity: 0;
    z-index: 3;
    transition: var(--transition-smooth);
}

.image-preview-zone:hover .preview-overlay {
    opacity: 1;
}

/* Action bar at the bottom */
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid var(--card-border);
    padding-top: 1.5rem;
}

/* Progress Zone */
.progress-zone {
    text-align: center;
    padding: 3rem 1.5rem;
    animation: fadeIn 0.4s ease-out;
}

.spinner-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 242, 254, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 4px solid transparent;
    border-bottom: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-zone h3 {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.progress-zone p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Result Zone */
.result-zone {
    text-align: center;
    padding: 1rem 0;
    animation: fadeIn 0.4s ease-out;
}

.success-icon {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.3));
}

.result-zone h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.result-zone p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.download-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 550px;
    margin: 0 auto 2.5rem auto;
    text-align: left;
}

@media (max-width: 550px) {
    .download-card {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
    }
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    font-size: 2.2rem;
    color: var(--primary-color);
}

.file-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-badge {
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary-color);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.btn-download {
    text-decoration: none;
}

/* Footer styling */
.app-footer {
    text-align: center;
    margin-top: 2.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Download Warning Tip Box */
.download-tip-box {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 550px;
    margin: -1.5rem auto 2.5rem auto;
    text-align: left;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.03);
    animation: fadeIn 0.4s ease-out;
}

.tip-icon {
    font-size: 1.2rem;
    color: #f59e0b;
    margin-top: 0.15rem;
}

.tip-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tip-text strong {
    color: #f59e0b;
    font-weight: 600;
}

.tip-text code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: monospace;
    color: var(--text-primary);
}

.tip-text em {
    color: var(--text-primary);
    font-style: normal;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Utility classes */
.hidden {
    display: none !important;
}
