:root {
    --primary-color: #1976d2;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --light-text-color: #fff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.app-header {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-title { font-size: 1.5rem; margin: 0; }
.user-info { display: flex; align-items: center; gap: 15px; }
button { font-family: inherit; cursor: pointer; }

.primary-btn {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
}
.secondary-btn {
    background-color: #e0e0e0;
    color: var(--text-color);
    border: 1px solid #ccc;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
}

.screen { display: none; padding: 20px; }
.screen.active { display: block; }

#uploadScreen { text-align: center; }
.upload-area {
    max-width: 500px;
    margin: 40px auto;
    padding: 40px;
    border: 2px dashed #ccc;
    border-radius: 12px;
    background-color: #fff;
}
.upload-icon { font-size: 3rem; }

.batch-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.toggle-option { display: flex; align-items: center; gap: 8px; }

.batch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}
.thumbnail-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.thumbnail-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumbnail-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.2rem;
}
.status-badge {
    position: absolute;
    top: 5px; right: 5px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
}
.status-success { background-color: #4CAF50; }
.status-edited { background-color: #ff9800; }
.status-error { background-color: #f44336; }

.adjust-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.canvas-container {
    width: 100%;
    max-width: 800px;
    margin: auto;
    background-color: #333;
}
#adjustCanvas { display: block; width: 100%; }

.aspect-ratio-controls {
    text-align: center;
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
}
.ratio-options { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.ratio-btn { background: #eee; border: 1px solid #ddd; padding: 8px 16px; border-radius: 20px; }
.ratio-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
}
.modal-content ol { padding-left: 20px; }
.modal-content li { margin-bottom: 10px; }
.modal-content button { width: 100%; margin-top: 15px; }

.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}
.progress-bar {
    width: 0%;
    height: 20px;
    background-color: #4CAF50;
    transition: width 0.4s ease;
}
.progress-text {
    text-align: center;
    padding: 5px;
    font-size: 14px;
}