:root {
    --success: #22c55e;
}

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

body {
    font-family: 'Inter', sans-serif;
    /* Background and color handled by shared.css */
    line-height: 1.6;
}

.container {
    /* Inherits flex column and 100vh from shared.css */
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.app-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-subtle);
    border-radius: 1rem;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-card);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.upload-icon {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.upload-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.supported-formats {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-body);
    border-radius: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* Controls Panel */
.controls-panel {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
    box-shadow: 0 4px 6px var(--shadow-sm);
}

.settings-group {
    flex: 1 1 200px;
    min-width: 200px;
}

.settings-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.format-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: var(--bg-body);
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-subtle);
}

.format-btn {
    flex: 1 1 auto;
    min-width: 60px;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.format-btn.active {
    background: var(--bg-card);
    color: var(--accent);
    box-shadow: 0 1px 3px var(--shadow-sm);
    font-weight: 600;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-body);
    border-radius: 3px;
    appearance: none;
    border: 1px solid var(--border-subtle);
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

input[type="number"] {
    width: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.action-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    width: 100%;
    flex: 1 1 200px;
}

.action-btn:hover {
    background: var(--accent-hover);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.image-card {
    background: var(--bg-card);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 6px var(--shadow-sm);
}

.image-preview {
    height: 200px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-info {
    padding: 1rem;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.savings {
    color: var(--success);
    font-weight: 600;
}

.download-btn {
    width: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}

.download-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
}