/* Basic styling for DingyTagger */

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

.layout {
    display: flex;
    min-height: 100vh;
    gap: 15px;
    padding: 15px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.container {
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.sidebar {
    width: 300px;
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 30px);
    overflow-y: auto;
    position: sticky;
    top: 15px;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 20px;
}

.header-bar h1 {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 24px;
}

h1 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#health-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

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

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

/* Error banner styles */
.error-banner {
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

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

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

.error-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: inherit;
}

.error-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* API Key Styles - Compact */
#api-key-container {
    margin-top: 15px;
    padding: 8px;
    border-radius: 4px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    font-size: 12px;
}

#api-key-input {
    width: 100%;
    padding: 4px;
    margin-bottom: 5px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-size: 12px;
}

#api-key-submit {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

#api-key-submit:hover {
    background-color: #218838;
}

.api-key-set {
    color: #28a745;
    font-weight: bold;
    font-size: 12px;
    margin: 0;
}

/* Search Styles */
#search-container {
    display: flex;
    gap: 10px;
}

#search-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

#search-results {
    margin-top: 15px;
}

.health-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

/* Compact table layout for bookmarks */
.bookmark-list {
    display: table;
    width: 100%;
    border-collapse: collapse;
}

.bookmark-item {
    display: table-row;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.bookmark-item:hover {
    background-color: #f8f9fa;
}

.bookmark-cell {
    display: table-cell;
    padding: 8px;
    vertical-align: top;
    border-bottom: 1px solid #eee;
}

.bookmark-cell.title {
    width: 40%;
}

.bookmark-cell.url {
    width: 30%;
}

.bookmark-cell.tags {
    width: 20%;
}

.bookmark-cell.date {
    width: 10%;
}

.bookmark-title {
    font-weight: 600;
    margin: 0 0 4px 0;
    font-size: 14px;
}

.bookmark-title a {
    color: #3498db;
    text-decoration: none;
}

.bookmark-title a:hover {
    text-decoration: underline;
}

.bookmark-url {
    font-size: 12px;
    color: #666;
    margin: 0;
    word-break: break-all;
}

.bookmark-description {
    font-size: 12px;
    color: #555;
    margin: 4px 0 0 0;
    line-height: 1.3;
}

.bookmark-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.tag {
    background-color: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.bookmark-date {
    font-size: 11px;
    color: #6c757d;
    margin: 0;
}

/* Tags sidebar styles */
.sidebar h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

#new-tag-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

#new-tag-input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#create-tag-button {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

#create-tag-button:hover {
    background-color: #2980b9;
}

#create-tag-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.tag-item {
    background-color: #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
    cursor: grab;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.tag-item:hover {
    background-color: #dee2e6;
    transform: translateX(2px);
}

.tag-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.tag-item.drag-over {
    background-color: #3498db;
    color: white;
}

/* Bookmark item drop zone */
.bookmark-item {
    transition: all 0.2s ease;
    position: relative;
}

.bookmark-item.drop-target {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.bookmark-item.flash-success {
    background-color: #d4edda;
    border-color: #28a745;
    animation: flash-success 0.6s ease-in-out;
}

@keyframes flash-success {
    0% { background-color: #d4edda; border-color: #28a745; }
    50% { background-color: #c3e6cb; border-color: #28a745; }
    100% { background-color: #ffffff; border-color: #e9ecef; }
}

/* Tag removal button */
.tag.removable {
    position: relative;
    padding-right: 20px;
}

.tag-remove {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

.tag-remove:hover {
    background-color: #dc3545;
    color: white;
}

/* Pagination styles */
#tags-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.pagination-info {
    font-size: 12px;
    color: #666;
}

.pagination-buttons {
    display: flex;
    gap: 10px;
}

.pagination-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.pagination-btn:disabled {
    background-color: #dee2e6;
    cursor: not-allowed;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #5a6268;
}
