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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.navbar {
    background: #2c3e50;
    color: white;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.nav-logo h1 {
    font-size: 24px;
    padding: 15px 0;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0;
}

.nav-menu li a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 20px 25px;
    transition: background 0.3s;
}

.nav-menu li a:hover {
    background: #34495e;
}

.nav-menu li a.active {
    background: #3498db;
    border-bottom: 3px solid #2980b9;
}

.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
    min-height: calc(100vh - 160px);
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.page-header p {
    color: #7f8c8d;
}

/* Combination Row Styles */
.combination-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.combination-row {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    gap: 20px;
    align-items: center;
}

.image-box {
    flex: 1;
    text-align: center;
}

.image-box h4 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 14px;
}

.image-preview {
    width: 100%;
    height: 200px;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
    cursor: pointer;
    transition: border-color 0.3s;
}

.image-preview:hover {
    border-color: #3498db;
}

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

.image-preview.selected {
    border-color: #3498db;
    border-width: 3px;
}

.image-info {
    margin-top: 8px;
    font-size: 12px;
    color: #7f8c8d;
}

.action-box {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.gallery-item {
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.gallery-item:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.gallery-item.selected {
    border-color: #3498db;
    border-width: 3px;
    background: #ebf5fb;
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 3px;
    background: #f8f9fa;
}

.gallery-item .item-info {
    margin-top: 8px;
    font-size: 11px;
    color: #7f8c8d;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-card.pending {
    border-left: 4px solid #f39c12;
}

.stat-card.processing {
    border-left: 4px solid #3498db;
}

.stat-card.completed {
    border-left: 4px solid #27ae60;
}

.stat-card.failed {
    border-left: 4px solid #e74c3c;
}

/* Table */
table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-collapse: collapse;
}

table th {
    background: #34495e;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 500;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
}

table tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.modal-header h3 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0;
}

.close {
    font-size: 32px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0 10px;
}

.close:hover {
    color: #000;
}

.modal-body {
    flex: 1;
    overflow: auto;
    text-align: center;
}

.modal-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.modal-info {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    text-align: left;
}

.modal-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

/* Selection Panel */
.selection-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.selection-section {
    margin-bottom: 25px;
}

.selection-section h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.custom-prompt {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-height: 80px;
    resize: vertical;
}
