* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #D7E0DD;
    min-height: 100vh;
    color: #E0E6E9;
    padding: 20px;
}
.container { max-width: 1200px; margin: 0 auto; }
.header {
    text-align: center;
    margin-bottom: 40px;
}
.header img {
    max-width: 250px;
    height: auto;
    margin-bottom: 10px;
}
.header p {
    color: #A3ADB3;
    font-size: 18px;
}
.main-card {
    background: linear-gradient(145deg, #1A1A1A, #0D0D0D);
    border-radius: 20px;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    border: 1px solid #333333;
}
.card-header {
    background: linear-gradient(90deg, #1E1E1E, #2A2A2A);
    color: #79CDDE; /* Replaced accent color */
    padding: 30px;
    box-shadow: inset 0 -5px 15px rgba(0, 0, 0, 0.6);
}
.card-body { padding: 30px; color: #E0E6E9; }
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.form-group { display: flex; flex-direction: column; }
.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #A3ADB3;
}
.form-control {
    padding: 12px;
    border: 2px solid #333333;
    background-color: #1A1A1A;
    border-radius: 8px;
    font-size: 16px;
    color: #E0E6E9;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.form-control:focus {
    outline: none;
    border-color: #79CDDE; /* Replaced accent color */
    box-shadow: 0 0 10px rgba(121, 205, 222, 0.6); /* Replaced accent color */
}
.file-upload {
    margin: 30px 0;
    padding: 60px;
    border: 3px dashed #79CDDE; /* Replaced accent color */
    border-radius: 15px;
    text-align: center;
    background: linear-gradient(135deg, #1A1A1A, #2C2C2C);
    cursor: pointer;
    transition: all 0.3s;
    color: #A3ADB3;
}
.file-upload:hover {
    border-color: #E0E6E9;
    background: linear-gradient(135deg, #2C2C2C, #3A3A3A);
}
.file-upload.dragging {
    border-color: #79CDDE; /* Replaced accent color */
    background: linear-gradient(135deg, #3A3A3A, #4A4A4A);
}
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: #333333;
    color: #E0E6E9;
    border: 2px solid #79CDDE;
}

.btn-secondary:hover {
    background: #404040;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(121, 205, 222, 0.3);
}
.btn-primary {
    background: linear-gradient(90deg, #79CDDE, #44A6BC); /* Replaced accent color with a slight gradient */
    color: #FFFFFF;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(121, 205, 222, 0.4); /* Replaced accent color */
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-danger {
    background-color: #E57373;
    color: #FFFFFF;
}
.btn-danger:hover { background-color: #EF5350; }
.btn-danger:disabled { background-color: #E57373; opacity: 0.6; cursor: not-allowed; }
.progress-section {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(145deg, #1A1A1A, #0D0D0D);
    border-radius: 15px;
    border: 1px solid #333333;
    color: #E0E6E9;
}
.progress-bar-container {
    height: 30px;
    background: #333333;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #79CDDE, #44A6BC); /* Replaced accent color with a slight gradient */
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1A1A1A;
    font-weight: 600;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin: 20px 0; }
.stat-card {
    padding: 20px;
    background: linear-gradient(145deg, #1A1A1A, #2C2C2C);
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #333333;
    color: #E0E6E9;
}
.stat-card h3 {
    font-size: 32px;
    color: #79CDDE; /* Replaced accent color */
    margin-bottom: 5px;
    text-shadow: 0 0 8px rgba(121, 205, 222, 0.7); /* Replaced accent color */
}
.log-container {
    max-height: 200px;
    overflow-y: auto;
    background: #1A1A1A;
    color: #E0E6E9;
    padding: 15px;
    border-radius: 8px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 14px;
    margin-top: 15px;
    border: 1px solid #333333;
}
.output-section {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(145deg, #1A1A1A, #0D0D0D);
    border-radius: 15px;
    border: 1px solid #333333;
    color: #E0E6E9;
}
.output-preview {
    margin-top: 15px;
    padding: 15px;
    background: #1A1A1A;
    border: 1px solid #333333;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: #E0E6E9;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}
.advanced-toggle {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(90deg, #1A1A1A, #2C2C2C);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #333333;
    color: #A3ADB3;
    transition: background 0.3s;
}
.advanced-toggle:hover {
    background: linear-gradient(90deg, #2C2C2C, #3A3A3A);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}
.advanced-settings {
    margin-top: 15px;
    padding: 20px;
    background: #1A1A1A;
    border-radius: 8px;
    border: 1px solid #333333;
    color: #E0E6E9;
}
.hidden { display: none !important; }
.message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 600;
}
.error {
    background: #4A1B1B;
    border: 1px solid #8A2D2D;
    color: #FFC0C0;
}
.success {
    background: #1B4A1B;
    border: 1px solid #2D8A2D;
    color: #C0FFC0;
}
.info {
    background: #1B1B4A;
    border: 1px solid #2D2D8A;
    color: #C0C0FF;
}
#fileListContainer {
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
    background: #1A1A1A;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #333333;
    color: #A3ADB3;
}
#fileListContainer li {
    list-style-type: none;
    padding: 5px;
    border-bottom: 1px solid #333333;
}
#fileListContainer li:last-child { border-bottom: none; }
.file-status {
    font-style: italic;
    color: #79CDDE; /* Replaced accent color */
    font-size: 0.9em;
    margin-left: 10px;
}
.log-container {
    max-height: 200px;
    overflow-y: auto;
    background: #1A1A1A;
    color: #E0E6E9;
    padding: 15px;
    border-radius: 8px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 14px;
    margin-top: 15px;
    border: 1px solid #333333;
}
.log-entry {
    margin-bottom: 8px;
    line-height: 1.4;
}
.log-timestamp {
    color: #79CDDE;
    font-weight: 600;
}
.log-prompt {
    background: #2A2A2A;
    border: 1px solid #79CDDE;
    border-radius: 6px;
    padding: 10px;
    margin: 5px 0;
}
.log-label {
    color: #79CDDE;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}
.prompt-content {
    background: #1A1A1A;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
    color: #E0E6E9;
    margin: 5px 0 0 0;
}

/* Custom Instructions textarea styling */
#customInstructions {
    width: 100%;
    resize: vertical;
    min-height: 80px;
}

/* Model dropdown container */
.model-select-container {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.model-select-container .form-control {
    flex: 1;
    min-width: 0; /* Allow shrinking below content width */
}

.model-select-container .btn-secondary {
    flex-shrink: 0; /* Prevent button from shrinking */
    height: 44px; /* Match form-control height with padding */
    width: 44px; /* Square button */
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Ensure Ollama endpoint input doesn't break layout */
#apiEndpoint {
    word-break: break-all; /* Allow breaking long URLs */
}

/* File Management Styles */
.file-table {
    width: 100%;
    border-collapse: collapse;
    background: #1A1A1A;
    border-radius: 8px;
    overflow: hidden;
}

.file-table thead tr {
    background: #2A2A2A !important;
    border-bottom: 2px solid #333333;
}

.file-table th {
    padding: 12px;
    text-align: left;
    color: #79CDDE;
    font-weight: 600;
}

.file-table tbody tr {
    border-bottom: 1px solid #333333;
    transition: background 0.2s;
}

.file-table tbody tr:hover {
    background: #252525;
}

.file-table tbody tr:last-child {
    border-bottom: none;
}

.file-table td {
    padding: 12px;
    color: #E0E6E9;
}

.file-table .file-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

#selectAllFiles {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.file-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.file-action-btn {
    padding: 6px 12px;
    border: 1px solid #333333;
    background: #2A2A2A;
    color: #E0E6E9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.file-action-btn:hover {
    background: #3A3A3A;
    border-color: #79CDDE;
}

.file-action-btn.download {
    color: #79CDDE;
}

.file-action-btn.delete {
    color: #FF6B6B;
}

#fileListEmpty {
    padding: 60px 20px;
    text-align: center;
    color: #6B7280;
}

#fileListLoading {
    padding: 40px;
    text-align: center;
    color: #A3ADB3;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}