/**
 * AIAC Member Generator Styles
 *
 * The wrapper uses .pg-guest-wrapper so all aiac-core guest styles apply
 * automatically (assuming aiac-core is active and its guest-style.css loads).
 * This file adds only the new elements: the DB save button, notice, and history panel.
 */

/* -------------------------------------------------------------------------
   Save to Database button
   A distinct colour so it reads as a third action separate from Generate
   and Save to Device.
------------------------------------------------------------------------- */
.aiac-rs-wrapper .pg-btn-save-db {
    background: linear-gradient(135deg, #38a169 0%, #276749 100%);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aiac-rs-wrapper .pg-btn-save-db:hover {
    background: linear-gradient(135deg, #2f855a 0%, #1c4532 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* -------------------------------------------------------------------------
   Save confirmation / error notice
------------------------------------------------------------------------- */
.aiac-rs-notice {
    margin-top: 16px;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.aiac-rs-notice.success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
}

.aiac-rs-notice.error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
}

/* -------------------------------------------------------------------------
   Version history panel
------------------------------------------------------------------------- */
.aiac-rs-history-panel,
#aiac-rs-history-panel {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-top: 24px;
}

.aiac-rs-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.aiac-rs-history-header strong {
    font-size: 15px;
    color: #2d3748;
}

#aiac-rs-history-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #718096;
    line-height: 1;
    padding: 0 4px;
}

#aiac-rs-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#aiac-rs-history-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #4a5568;
}

#aiac-rs-history-list li:last-child {
    border-bottom: none;
}

.aiac-rs-restore-btn {
    background: none;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
    color: #2d3748;
    transition: all 0.15s ease;
}

.aiac-rs-restore-btn:hover {
    background: #edf2f7;
    border-color: #a0aec0;
}

/* -------------------------------------------------------------------------
   Responsive
------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    .aiac-rs-wrapper .pg-controls {
        flex-direction: column;
    }
    .aiac-rs-wrapper .pg-btn-save-db {
        width: 100%;
    }
}
