:root {
    --primary: #4a6fa5;
    --secondary: #6b8cbc;
    --light: #f5f7fa;
    --dark: #2c3e50;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --gray: #6c757d;
    --border: #dee2e6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-card h1 {
    color: var(--primary);
    margin-bottom: 10px;
}

.login-card p {
    color: var(--gray);
    margin-bottom: 30px;
}

.login-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--gray);
}

/* Layout */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: var(--dark);
    color: white;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 18px;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 14px;
    opacity: 0.7;
}

.sidebar-nav {
    padding: 10px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--primary);
}

.main-content {
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background-color: var(--primary);
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    font-size: 16px;
}

.card-body {
    padding: 20px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s;
    text-decoration: none;
}

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

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

.btn-success:hover {
    background-color: #218838;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
    margin-top: 5px;
}

/* Layout */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
    min-width: 300px;
}

/* Utility */
.hidden {
    display: none;
}

.text-muted {
    color: var(--gray);
}

/* Progress */
.progress-bar {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    font-size: 14px;
    color: var(--gray);
}

/* Status & Log */
.status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary);
}

.status.error {
    border-left-color: var(--danger);
    background-color: #f8d7da;
    color: #721c24;
}

.status.success {
    border-left-color: var(--success);
    background-color: #d4edda;
    color: #155724;
}

.log {
    max-height: 300px;
    overflow-y: auto;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 14px;
    margin-top: 20px;
}

.log-item {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e9ecef;
}

.log-time {
    color: var(--gray);
    font-size: 12px;
}

/* Tabs */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.content-header h1 {
    color: var(--dark);
    margin-bottom: 10px;
}

.content-header p {
    color: var(--gray);
}

/* Image Preview */
.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    min-height: 50px;
}

.image-item {
    width: 150px;
    height: 100px;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
}

.image-item.selected {
    border-color: var(--primary);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    font-size: 12px;
    text-align: center;
}

/* List Items */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 5px;
    margin-bottom: 10px;
    background: white;
}

.list-item-content h4 {
    margin-bottom: 5px;
    color: var(--dark);
}

.list-item-content p {
    color: var(--gray);
    font-size: 14px;
}

.list-item-actions {
    display: flex;
    gap: 10px;
}

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

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

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

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col {
        width: 100%;
        margin-bottom: 15px;
    }
}