/* Edit Mode Button */
#edit-preferences-btn {
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    transition: background-color 0.3s;
}

#edit-preferences-btn:hover {
    background-color: #0056b3;
}

/* Save Configuration Button */
#save-config-btn {
    cursor: pointer;
    background-color: #27ae60 !important;
    color: white !important;
    border: none !important;
    padding: 10px 15px !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    transition: background-color 0.3s !important;
    margin-left: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

#save-config-btn:hover {
    background-color: #229954 !important;
}

#save-config-btn:disabled {
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

#save-config-btn i {
    font-size: 13px !important;
}

/* Drag Handle */
.drag-handle {
    cursor: grab;
    padding-right: 10px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    vertical-align: middle; 
}

.edit-mode-active .drag-handle {
    opacity: 0.7;
}
.table-container.drag-disabled .drag-handle {
    display: none !important;
}

.drag-handle:hover {
    opacity: 1;
}

/* Editable Row styles */
.editable-row {
    cursor: pointer;
}



/* Currency Row being edited */
.currency-row.editing {
    background-color: #f0f8ff; /* A light alice blue */
    font-weight: bold;
}

.currency-row:hover {
    background-color: #f8f9fa;
}

.currency-row.is-editing-below {
    box-shadow: 0 -2px 0 #007bff;
}

/* Inline Editor Styles */

.currency-editor-form {
    max-width: 450px;
    margin: 0 auto;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.editor-body {
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.editor-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.editor-setting-row:last-child {
    border-bottom: none;
}

.horizontal-controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.rate-adjuster-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.editor-setting-row label {
    font-weight: 500;
    color: #495057;
}

.diff-settings-section {
    display: flex;
    flex-direction: column;
}

.editor-section-divider {
    border-top: 1px solid #e9ecef;
    margin: 8px 0;
}

.rate-adjuster-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rate-adjust-editor {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-weight: bold;
    color: #495057;
    line-height: 24px;
    text-align: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.rate-adjust-editor:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

.rate-value-editor {
    font-weight: 600;
    font-size: 1em;
    min-width: 55px;
    text-align: center;
    color: #007bff;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.footer-actions {
    display: flex;
    gap: 12px;
}

.btn-save, .btn-cancel, .btn-remove {
    padding: 8px 18px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, box-shadow 0.2s;
}

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

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

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

.btn-cancel:hover {
    background-color: #5a6268;
}

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

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

/* Remove Confirmation Dialog */
.remove-confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.remove-confirmation-dialog {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
}

.confirmation-message {
    font-size: 16px;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    line-height: 1.5;
}

.confirmation-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-cancel-remove, .btn-confirm-remove {
    padding: 10px 24px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-cancel-remove {
    background-color: #6c757d;
    color: white;
}

.btn-cancel-remove:hover {
    background-color: #5a6268;
}

.btn-confirm-remove {
    background-color: #dc3545;
    color: white;
}

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

.btn-cancel-remove:active, .btn-confirm-remove:active {
    transform: scale(0.98);
}

/* Add Currency Button */
#add-currency-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.add-currency-btn {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.add-currency-btn i {
    font-size: 13px;
}

/* Currency Search Container */
#currency-search-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

#currency-search-input {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
    outline: none;
}

#currency-search-input:focus {
    border-color: #3498db;
}

/* Add Currency Dropdown */
.add-currency-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #3498db;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 2000;  /* Increased from 1000 to appear above sticky header */
    margin-top: 4px;
    width: 300px;
}

.add-currency-dropdown .currency-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.add-currency-dropdown .currency-dropdown-item:last-child {
    border-bottom: none;
}

.add-currency-dropdown .currency-dropdown-item:hover {
    background-color: #f0f8ff;
}

/* Ensure table container has relative positioning for the button */
.table-container.edit-mode-active {
    position: relative;
}

.calc-type-label {
    font-weight: 500;
    color: #333;
}

.calc-type-switch {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 20px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.calc-type-switch input[type="radio"] {
    display: none;
}

.calc-type-switch label {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    color: #555;
    font-size: 14px;
}

.calc-type-switch input[type="radio"]:checked + label {
    background-color: #fff;
    color: #007bff;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 20px;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
