:root {
    --bg-color: #0d0f12;
    --panel-bg: #14171c;
    --border-color: #232830;
    --text-primary: #f0f2f5;
    --text-secondary: #8c9ba5;
    --accent-color: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --green-color: #10b981;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-badge {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.green {
    background-color: var(--green-color);
    box-shadow: 0 0 8px var(--green-color);
}

.app-content {
    display: flex;
    gap: 20px;
    flex: 1;
    margin-top: 20px;
    min-height: 0; /* Important for scroll contexts */
}

.panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.input-panel {
    width: 40%;
    flex-shrink: 0;
}

.monitor-panel {
    flex: 1;
    min-width: 0;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -0.2px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

textarea {
    width: 100%;
    height: 120px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.1);
    transition: border-color 0.2s, background-color 0.2s;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.upload-zone.dragover {
    border-color: var(--accent-color);
    background-color: var(--accent-glow);
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.upload-prompt p {
    font-size: 13px;
}

.icon {
    color: var(--text-secondary);
}

.upload-preview {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.upload-preview img {
    max-height: 90px;
    max-width: 100%;
    border-radius: 6px;
    object-fit: contain;
}

.remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ef4444;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

/* Radio pill selection */
.radio-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pill:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.pill.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.parameters-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.submit-btn {
    margin-top: 24px;
    width: 100%;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: transform 0.1s, opacity 0.2s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.submit-btn:hover {
    opacity: 0.95;
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    box-shadow: none;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Task Monitor Right Panel Elements */
.status-dashboard {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 12px;
}

.status-badge-inline {
    background-color: var(--accent-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: white;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #818cf8, #6366f1);
    border-radius: 3px;
    transition: width 0.4s ease-out;
}

.logs-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: #090a0d;
}

.logs-header {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logs-terminal {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.log-line.system {
    color: #60a5fa;
}

.log-line.error {
    color: #f87171;
}

.log-line.success {
    color: var(--green-color);
}

/* Result section */
.result-section {
    margin-top: 24px;
    flex-shrink: 0;
}

.result-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 600;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background-color: rgba(0, 0, 0, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.dl-btn {
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
