/**
 * Enterprise Smart Values Widget Styles
 *
 * @package PeeperFrog_User_Portal
 * @since 5.2.0
 */

.pfup-enterprise-smart-values {
    border-radius: 8px;
    min-height: 400px;
}

/* Loading State */
.pfup-esv-loading {
    text-align: center;
    padding: 60px 20px;
}

.pfup-esv-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Permission Denied */
.pfup-esv-permission-denied {
    text-align: center;
    padding: 60px 20px;
}

.pfup-esv-error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

/* Header */
.pfup-esv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.pfup-esv-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

/* Template List */
.pfup-esv-template-group {
    margin-bottom: 30px;
}

.pfup-esv-template-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.pfup-esv-variants {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.pfup-esv-variant-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.2s;
}

.pfup-esv-variant-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pfup-esv-variant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pfup-esv-variant-title {
    font-weight: 600;
    font-size: 14px;
}

.pfup-esv-variant-actions {
    display: flex;
    gap: 8px;
}

.pfup-esv-variant-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #666;
}

.pfup-esv-updated {
    margin-left: auto;
}

.pfup-esv-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* Modal */
.pfup-esv-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pfup-esv-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.pfup-esv-modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.pfup-esv-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.pfup-esv-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.pfup-esv-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.pfup-esv-modal-close:hover {
    color: #000;
}

.pfup-esv-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.pfup-esv-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
}

/* Form Elements */
.pfup-esv-form-group {
    margin-bottom: 20px;
}

.pfup-esv-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.pfup-esv-form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.pfup-esv-input,
.pfup-esv-select,
.pfup-esv-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.pfup-esv-input:focus,
.pfup-esv-select:focus,
.pfup-esv-textarea:focus {
    outline: none;
    border-color: #007bff;
}

.pfup-esv-color {
    width: 60px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.required {
    color: #e74c3c;
}

/* Sections */
.pfup-esv-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
}

.pfup-esv-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pfup-esv-section-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* Field Rows */
.pfup-esv-field-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.pfup-esv-field-row .pfup-esv-input:first-child {
    flex: 0 0 200px;
}

.pfup-esv-field-row .pfup-esv-input:nth-child(2) {
    flex: 1;
}

/* Action Rows */
.pfup-esv-action-row {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.pfup-esv-action-header {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.pfup-esv-action-header .pfup-esv-input {
    flex: 1;
}

.pfup-esv-action-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.pfup-esv-form-row {
    display: flex;
    flex-direction: column;
}

.pfup-esv-form-row label {
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

/* Buttons */
.pfup-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pfup-btn-primary {
    background: #007bff;
    color: white;
}

.pfup-btn-primary:hover {
    background: #0056b3;
}

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

.pfup-btn-secondary:hover {
    background: #545b62;
}

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

.pfup-btn-danger:hover {
    background: #c82333;
}

.pfup-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .pfup-esv-variants {
        grid-template-columns: 1fr;
    }

    .pfup-esv-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .pfup-esv-action-fields {
        grid-template-columns: 1fr;
    }

    .pfup-esv-field-row {
        flex-direction: column;
    }

    .pfup-esv-field-row .pfup-esv-input {
        flex: 1 !important;
    }
}
