/* Tools Tab Styles */

/* Catalog Control */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

.checkbox-label span {
    user-select: none;
}

/* Generate Tab Styles */
.generate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.generate-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.75rem;
}

.generate-content {
    padding: 1rem;
}

.download-instructions {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    line-height: 1.6;
}

.download-instructions p {
    margin: 0 0 0.5rem 0;
}

.download-instructions p:last-child {
    margin-bottom: 0;
}

.install-note-small {
    font-size: 0.9rem;
    color: #999;
}

.download-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.download-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    transition: all 0.2s ease;
}

.download-link-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.download-link-info {
    flex: 1;
}

.download-link-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.download-link-description {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
    margin-top: 0.25rem;
}

.download-link-button {
    padding: 0.5rem 1.5rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.download-link-button:hover {
    background: #0056b3;
}

.download-separator {
    text-align: center;
    color: #999;
    font-size: 0.875rem;
    padding: 0.5rem 0;
    margin: 0.5rem 0;
}

.download-zip-item {
    border-color: #28a745;
    background: #f0fff4;
}

.download-zip-item:hover {
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

.download-zip-item .download-link-button {
    background: #28a745;
}

.download-zip-item .download-link-button:hover {
    background: #218838;
}

.download-link-item.download-unavailable {
    border-color: #ccc;
    background: #f5f5f5;
    opacity: 0.7;
}

.download-link-unavailable-badge {
    padding: 0.5rem 1rem;
    background: #999;
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Tools Tab Styles */
.tool-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tool-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
}

.tool-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.upload-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.upload-area:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.file-upload-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.file-upload-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.file-upload-item-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.file-upload-item-size {
    color: #666;
    font-size: 0.9rem;
    margin-left: 1rem;
}

.file-upload-item-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 1rem;
}

.file-upload-item-remove:hover {
    background: #c82333;
}

.debug-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.debug-section {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
}

.debug-section h3 {
    margin-top: 0;
    color: #495057;
}

.debug-console {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.console-entry {
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.console-entry.info {
    color: #4fc3f7;
}

.console-entry.warning {
    color: #ffb74d;
}

.console-entry.error {
    color: #f48fb1;
}

.console-entry.success {
    color: #81c784;
}

.console-controls {
    display: flex;
    gap: 0.5rem;
}

/* Index management styles */
.index-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background: white;
    transition: all 0.2s;
    position: relative;
}

.index-entry:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.index-entry-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    cursor: pointer;
}

.index-entry-name {
    font-weight: 600;
    color: #333;
    flex: 1;
    font-family: monospace;
}

.usage-indicator {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.usage-dropdown {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    margin-top: 2px;
    max-height: 200px;
    overflow-y: auto;
    min-width: 300px;
}

.usage-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.usage-item:last-child {
    border-bottom: none;
}

.usage-item:hover {
    background: #f8f9fa;
}

.usage-item.unused {
    color: #dc3545;
    font-style: italic;
}

.usage-item.unused:hover {
    background: #f8d7da;
}

.usage-bank {
    font-weight: 600;
    color: #007bff;
    min-width: 80px;
}

.usage-patch {
    color: #333;
    flex: 1;
}

.usage-note {
    color: #666;
    font-size: 0.9rem;
}

.usage-text {
    color: #dc3545;
    font-style: italic;
}

.bank-selector {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.bank-selector label {
    display: inline-block;
    margin-right: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.bank-selector select {
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    min-width: 200px;
}

.bank-selector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.index-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.index-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.index-search input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.index-entries {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.index-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.index-entry:last-child {
    border-bottom: none;
}

.index-entry-name {
    flex: 1;
    font-family: monospace;
}

.index-entry-actions {
    display: flex;
    gap: 0.25rem;
}

.add-entry-form {
    display: flex;
    gap: 0.5rem;
}

.add-entry-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Keyboard tooltip */
.keyboard-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.keyboard-tooltip img {
    filter: invert(1);
}

/* My Edits Section */
.my-edits-section {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
}

.my-edits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.my-edits-header h3 {
    margin: 0;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.my-edits-actions {
    display: flex;
    gap: 0.5rem;
}

.my-edits-stats {
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.my-edits-list {
    background: white;
    border-radius: 4px;
    min-height: 100px;
    max-height: 400px;
    overflow-y: auto;
}

.my-edits-empty {
    padding: 2rem;
    text-align: center;
    color: #666;
}

.my-edits-empty .hint {
    font-size: 0.9rem;
    color: #999;
    margin-top: 0.5rem;
}

.my-edits-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.my-edits-item:last-child {
    border-bottom: none;
}

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

.my-edits-item-info {
    flex: 1;
    min-width: 0;
}

.my-edits-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-edits-item-meta {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.my-edits-item-meta .manufacturer {
    color: #007bff;
}

.my-edits-item-meta .separator {
    color: #ccc;
}

.my-edits-item-meta .timestamp {
    color: #999;
}

.my-edits-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .my-edits-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .my-edits-item-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }
    
    .my-edits-item-meta {
        flex-wrap: wrap;
    }
}
