/* Google Fonts, Modern Typography */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --background-color: #0f172a;
    --surface-color: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.background-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -10%;
    left: -10%;
    animation: float 10s infinite alternate;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    bottom: -5%;
    right: -5%;
    animation: float 12s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
    }

    100% {
        transform: translateY(50px) translateX(30px);
    }
}

/* Container */
.container {
    width: 90%;
    max-width: 800px;
    /* Reduced width for focus */
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin: 20px;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Main Content Area */
.app-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Upload Section */
.upload-section {
    width: 100%;
}

.drop-zone {
    width: 100%;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    padding: 60px 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.icon-container {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    transition: var(--transition);
}

.drop-zone:hover .icon-container {
    transform: scale(1.1);
    color: var(--primary-color);
}

.drop-zone h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: underline;
    margin-top: 20px;
}

.btn-text:hover {
    color: var(--text-main);
}

/* Processing Section */
.processing-section {
    width: 100%;
}

.card {
    background: rgba(15, 23, 42, 0.6);
    border-radius: var(--border-radius-lg);
    border: var(--glass-border);
    padding: 24px;
    width: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

.card-header h3 {
    font-size: 1.2rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: right;
}

/* Log Container */
.log-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius-md);
    padding: 15px;
    height: 150px;
    overflow-y: auto;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    color: #a5b4fc;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.log-entry {
    margin-bottom: 5px;
}

.log-entry.success {
    color: #4ade80;
}

.log-entry.error {
    color: #f87171;
}

.log-entry.info {
    color: #60a5fa;
}

/* Preview */
.preview-container {
    width: 100%;
    height: 200px;
    background: #000;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-container canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: white;
}

/* Result Section */
.result-section {
    width: 100%;
    text-align: center;
}

.success-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4ade80;
    font-size: 2.5rem;
    margin-bottom: 10px;
    border: 2px solid rgba(74, 222, 128, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(74, 222, 128, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Footer */
.app-footer {
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    opacity: 0.7;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1e293b;
    width: 90%;
    max-width: 600px;
    height: 80vh;
    border-radius: var(--border-radius-lg);
    border: var(--glass-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    transform: translateY(0);
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    padding: 20px;
    overflow: hidden;
}

.modal-body textarea {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    color: var(--text-main);
    padding: 15px;
    resize: none;
    font-family: inherit;
    line-height: 1.6;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 600px) {
    .logo h1 {
        font-size: 2rem;
    }

    .container {
        padding: 20px;
    }

    .drop-zone {
        padding: 40px 20px;
    }
}