:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #10b981;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --blur: 10px;
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    --font-main: 'Outfit', sans-serif;
}

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

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

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    animation: move 20s infinite alternate;
}

.blob-1 {
    top: 10%;
    left: 20%;
    width: 300px;
    height: 300px;
    background: #4f46e5;
    animation-delay: 0s;
}

.blob-2 {
    bottom: 20%;
    right: 20%;
    width: 400px;
    height: 400px;
    background: #ec4899;
    animation-delay: -5s;
}

.blob-3 {
    bottom: 10%;
    left: 10%;
    width: 200px;
    height: 200px;
    background: #10b981;
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(50px, -50px) scale(1.1);
    }
}

.container {
    width: 90%;
    max-width: 800px;
    text-align: center;
    z-index: 10;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 1.2rem;
    color: #cbd5e1;
    margin-bottom: 3rem;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--blur));
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Upload Section */
.upload-section {
    cursor: pointer;
    border: 2px dashed var(--glass-border);
}

.upload-section.drag-over {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-content h2 {
    margin: 1rem 0;
}

.file-info {
    margin-top: 1rem;
    color: #94a3b8;
    font-style: italic;
}

/* History Section */
#history-section {
    margin-top: 4rem;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.history-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease;
    position: relative;
}

.history-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.history-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-bottom: 1px solid var(--glass-border);
}

.history-info {
    padding: 1rem;
    text-align: left;
}

.history-date {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.history-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.history-btn:hover {
    color: var(--primary-hover);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn {
    background: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.action-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 1.2rem;
    padding: 1rem 3rem;
}

.action-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.action-btn:disabled {
    background: #475569;
    cursor: not-allowed;
    opacity: 0.7;
}

.secondary-btn {
    background: var(--secondary-color);
    color: white;
}

.secondary-btn:hover {
    background: #059669;
}

/* Result Section */
.result-section {
    margin-top: 3rem;
}

.image-container {
    margin: 2rem 0;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.image-container img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none !important;
}

/* Loader */
.loader {
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

footer {
    margin-top: 4rem;
    color: #64748b;
    font-size: 0.9rem;
}

footer i {
    color: #ef4444;
}

.notice {
    margin-top: 1rem;
    color: #fbbf24;
    font-size: 0.9rem;
    font-style: italic;
}