/* Editor Rápido - CSS Front-end */

/* Inline edit icons */
.editor-rapido-edit-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 8px;
    border-radius: 3px;
    color: #666;
    opacity: 0.7;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.editor-rapido-edit-icon:hover {
    color: #333;
    opacity: 1;
}

.editor-rapido-edit-icon svg {
    display: block;
}

/* Edit icons visibility is controlled by PHP permission checks */

/* Inline edit container */
.editor-rapido-inline-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.editor-rapido-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.editor-rapido-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.editor-rapido-save-btn,
.editor-rapido-cancel-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.editor-rapido-save-btn {
    background: #007cba;
    color: white;
}

.editor-rapido-save-btn:hover {
    background: #005a87;
}

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

.editor-rapido-cancel-btn:hover {
    background: #545b62;
}

.editor-rapido-loading {
    color: #007cba;
    font-size: 12px;
    font-style: italic;
}

.editor-rapido-message {
    margin-top: 5px;
    font-size: 12px;
    min-height: 16px;
}

.editor-rapido-message.success {
    color: #28a745;
}

.editor-rapido-message.error {
    color: #dc3545;
}

/* Make editable elements relative for better icon positioning */
.editor-rapido-editable {
    position: relative;
    /* display: inline-block; */
}

/* Ensure title stays left-aligned */
.product_title.editor-rapido-editable {
    text-align: left;
}

/* Position edit icon for short description inline */
.editor-rapido-edit-icon-right {
    margin-left: 8px;
}

/* History link styles */
.editor-rapido-history-container {
    position: relative;
    text-align: right;
    margin-bottom: 10px;
}

.editor-rapido-history-link {
    color: #007cba;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border: 1px solid #007cba;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.editor-rapido-history-link:hover {
    background-color: #007cba;
    color: white;
}

/* History modal styles */
.editor-rapido-history-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
}

.editor-rapido-history-modal.show {
    display: flex;
}

.editor-rapido-history-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.editor-rapido-history-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-rapido-history-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.editor-rapido-history-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.editor-rapido-history-modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.editor-rapido-history-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.editor-rapido-history-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.editor-rapido-history-empty {
    text-align: center;
    padding: 40px;
    color: #666;
}

.editor-rapido-history-table {
    width: 100%;
    border-collapse: collapse;
}

.editor-rapido-history-table th,
.editor-rapido-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.editor-rapido-history-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.editor-rapido-history-table tbody tr:hover {
    background-color: #f8f9fa;
}

.editor-rapido-history-field {
    font-weight: 500;
    color: #007cba;
}

.editor-rapido-history-old-value,
.editor-rapido-history-new-value {
    font-family: monospace;
    font-size: 13px;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
    word-break: break-word;
}

.editor-rapido-history-old-value {
    color: #dc3545;
}

.editor-rapido-history-new-value {
    color: #28a745;
}

.editor-rapido-history-date {
    color: #666;
    font-size: 12px;
}

.editor-rapido-history-user {
    font-weight: 500;
}

.editor-rapido-history-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.editor-rapido-history-page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.editor-rapido-history-page-btn:hover:not(:disabled) {
    background-color: #007cba;
    color: white;
    border-color: #007cba;
}

.editor-rapido-history-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.editor-rapido-history-current-page {
    font-weight: 600;
    color: #007cba;
}
