/* Base styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
    color: #333;
}

/* Headers */
h1, h2 {
    color: #333;
    margin-bottom: 15px;
}

/* Sections */
.section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Form elements */
.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
    justify-content: space-between;
}

/* Common styles for interactive elements */
.input-field {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 14px;
}

select.input-field {
    background-color: white;
}

input[type="url"].input-field,
input[type="text"].input-field {
    flex: 1;
}

.btn {
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s, opacity 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Table styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th {
    background-color: #f5f5f5;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #ddd;
    height: 50px;
    box-sizing: border-box;
}

.data-table tr:hover {
    background-color: #f8f8f8;
}

/* Scrollable container */
.table-container {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 15px;
}

/* Status messages */
.status-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.success-message {
    color: #28a745;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.loading-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Checkbox styling */
.article-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Logo */
.logo {
    max-width: 200px;
    margin-bottom: 20px;
}

.manually-added {
    background-color: #FCF1DD;
}

.manually-added:hover {
    background-color: #f5e4c7;
}

.flatpickr-input {
    background-color: white !important;
}

.form-group {
    margin-bottom: 1rem;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5vh auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    height: 85vh;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

/* Modal header area */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    margin: 0;
    flex-grow: 1;
}

.modal-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.modal-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.save-btn {
    color: #28a745;
}

.save-btn:hover {
    color: #1e7e34;
}

.close-btn {
    color: #aaa;
}

.close-btn:hover {
    color: #666;
}

#article-html-content {
    width: 100%;
    height: calc(100% - 80px);
    font-family: monospace;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
}

.btn-edit-html {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 8px;
    color: #007bff;
    font-size: 12px;
    margin-right: 5px;
}

.btn-edit-html:hover {
    color: #0056b3;
}

.modal-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    width: 100%;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.tab-btn:hover {
    color: #007bff;
}

.tab-btn.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
    font-weight: 500;
}

.modal-content-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.tab-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
}

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

.status-indicator {
    display: inline-flex;
    gap: 5px;
    margin-left: 5px;
}

.status-indicator i {
    font-size: 14px;
}

.status-indicator.loading {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

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

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

.status-indicator.unsaved {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-indicator.saved {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.modal-content-area textarea {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    padding: 10px;
}

#article-text-content {
    background-color: #f8f9fa;
}

/* Status row styles */
.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* Additional status indicator styles */
.status-indicator.unsaved {
    background-color: #cce5ff;
    color: #004085;
}

/* Additional modal button styles */
.modal .btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.modal .btn-primary {
    background-color: #0d6efd;
    color: white;
}

.modal .btn-primary:hover {
    background-color: #0b5ed7;
}

.modal .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.modal .btn-secondary:hover {
    background-color: #5c636a;
}

/* Article action buttons */
.article-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: #f0f0f0;
}

.btn-edit-text:hover {
    color: #28a745;
}