:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.7);
    --primary: #238636;
    --primary-hover: #2ea043;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --border: #30363d;
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: #0d1117;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 1.5rem 2rem;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 100%;
}

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

header h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

.badge {
    background: linear-gradient(135deg, #79c0ff, #d2a8ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 0.6em;
    vertical-align: super;
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

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

/* Upload Section */
.upload-section {
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
}

.upload-section.drag-active {
    border-color: var(--primary);
    background: rgba(35, 134, 54, 0.1);
}

.upload-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.upload-placeholder svg {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.preview-img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 4px;
    display: block;
}

.btn-icon.remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Settings */
.settings-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 1rem;
    box-sizing: border-box;
    /* Ensures padding doesn't affect width */
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.info-box {
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 1rem;
}

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

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

.btn.primary:disabled {
    background-color: #333;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn.secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    margin-top: 1rem;
}

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

.full-width {
    width: 100%;
}

/* Result Section */
.result-section {
    margin-top: 2rem;
    padding: 2rem;
    animation: slideUp 0.5s ease;
}

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

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.price {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: bold;
}

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

.preview-card h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.full-width-card {
    grid-column: 1 / -1;
}

.preview-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    overflow: auto;
    /* Allow scrolling if zoomed */
    border: 1px solid var(--border);
}

.result-img {
    max-width: 100%;
    max-height: 300px;
}

.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header-actions h4 {
    margin: 0;
}

.zoom-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 4px;
}

.btn.small {
    padding: 0.25rem 0.6rem;
    font-size: 0.9rem;
    background: #21262d;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn.small:hover {
    background: #30363d;
}

.download-actions {
    display: flex;
    gap: 1rem;
}

.download {
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

.ai-analysis {
    background: #0d1117;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    color: #79c0ff;
}

.error-message {
    color: #ff7b72;
    background: rgba(255, 123, 114, 0.1);
    border: 1px solid #ff7b72;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}