/* =============================================================
   PEER ANALYSIS — Enhanced Dynamic Analysis Page
   peer-analysis.css  v1
   ============================================================= */

/* ───────────────────────────────────────────────────────────
   Peer Groups Page (custom-peer-group.html)
   ─────────────────────────────────────────────────────────── */
.peer-analysis-container {
    max-width: 1320px;
    margin: 0 auto;
}

.peer-analysis-card {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 28px 32px;
    margin-bottom: 24px;
}

.peer-analysis-card h2 {
    font-size: 1.3em;
    color: #1f2937;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.peer-analysis-card h2 i {
    color: #0056d2;
}

.peer-analysis-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ───────────────────────────────────────────────────────────
   Controls card

/* ═══════════════════════════════════════════════════════════════════════════
   PEER GROUPS PAGE STYLES (custom-peer-group.html)
   ═══════════════════════════════════════════════════════════════════════════ */

.pg-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.pg-card-header h2 {
    margin: 0 !important;
}

.pg-header-actions {
    display: flex;
    gap: 8px;
}

/* Section styling */
.pg-section {
    padding: 4px 0;
    margin-bottom: 4px;
}

.pg-section-first {
    padding-top: 0;
}

.pg-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05em;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e5e7eb;
}

.pg-section-header i {
    color: #0056d2;
    font-size: 1.1em;
}

/* Current Bank Display (similar to peer analysis page) */
.pg-home-bank {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 12px;
    margin-bottom: 12px;
    background: #f0f6ff;
    border: 1px solid #c3d9f8;
    border-radius: 8px;
    font-size: 14px;
    overflow: hidden;
    min-width: 0;
}

.pg-home-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #0056d2;
}

.pg-home-label {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    flex-shrink: 0;
}

.pg-home-name {
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.pg-home-cert {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.pg-divider {
    height: 1px;
    background: linear-gradient(to right, #e5e7eb 0%, #e5e7eb 50%, transparent 100%);
    margin: 8px 0;
}

/* Label styling */
.pg-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.pg-label i {
    color: #0056d2;
    width: 16px;
}

/* Target bank display card */
.pg-target-bank-display {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-left: 4px solid #0056d2;
    border-radius: 10px;
    padding: 16px 20px;
}

.pg-target-bank-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pg-target-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0056d2 0%, #0066f5 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0,86,210,0.2);
}

.pg-target-info {
    flex: 1;
    min-width: 0;
}

.pg-target-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-target-details {
    font-size: 13px;
    color: #64748b;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pg-target-detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pg-target-detail-item i {
    color: #94a3b8;
    font-size: 12px;
}

.pg-target-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    font-size: 14px;
    font-style: italic;
}

.pg-target-placeholder i {
    font-size: 18px;
    opacity: 0.7;
}

/* Input styling */
.pg-input, .pg-select, .pg-textarea {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    color: #1f2937;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.pg-input:focus, .pg-select:focus, .pg-textarea:focus {
    border-color: #0056d2;
    box-shadow: 0 0 0 3px rgba(0,86,210,.08);
}

.pg-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.pg-search-input {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%230056d2" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg>');
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 42px;
}

/* Chips container for selected banks */
.pg-chips-container {
    min-height: 60px;
    padding: 12px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    transition: border-color 0.2s, background 0.2s;
}

.pg-chips-container:hover {
    border-color: #0056d2;
    background: #f0f7ff;
}

.pg-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 13px;
    font-style: italic;
    width: 100%;
    justify-content: center;
    padding: 8px;
}

.pg-placeholder i {
    font-size: 16px;
    opacity: 0.7;
}

/* Bank chip styling */
.pg-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #0056d2 0%, #0066f5 100%);
    color: #fff;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,86,210,0.2);
    transition: all 0.2s;
    max-width: 280px;
}

.pg-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,86,210,0.3);
}

.pg-chip-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pg-chip-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-chip-info {
    font-size: 11px;
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-chip-remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    transition: background 0.2s;
}

.pg-chip-remove:hover {
    background: rgba(255,255,255,0.4);
}

/* Count badge */
.pg-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: #0056d2;
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-left: auto;
}

/* Save button */
.pg-save-btn {
    margin-top: 8px;
    padding: 14px 24px !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(16,185,129,0.3);
    transition: all 0.2s !important;
}

.pg-save-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}

.pg-save-btn:disabled {
    background: #d1d5db !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* Delete button hover effect */
#delete-group-btn:hover {
    background: #c82333 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220,53,69,0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pg-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .pg-chip {
        max-width: 100%;
    }
    
    .pg-section {
        padding: 10px 0;
    }
    
    .pg-target-bank-card {
        flex-direction: column;
        text-align: center;
    }
    
    .pg-target-details {
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL AND TOAST COMPONENTS (moved from inline styles)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Modal overlay */
.pg-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

/* Modal content box */
.pg-modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* Modal title */
.pg-modal-title {
    margin: 0 0 12px;
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 700;
}

.pg-modal-title i {
    color: #dc3545;
}

/* Modal text */
.pg-modal-text {
    color: #555;
    margin: 0 0 24px;
}

/* Modal actions row */
.pg-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Modal cancel button */
.pg-btn-cancel {
    padding: 10px 20px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.pg-btn-cancel:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* Modal delete button */
.pg-btn-delete {
    padding: 10px 20px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.pg-btn-delete:hover {
    background: #c82333;
}

/* Toast notification */
.pg-toast {
    display: none;
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    min-width: 280px;
    max-width: 480px;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    font-size: 15px;
    text-align: center;
    transition: opacity 0.4s;
}

/* Required field indicator */
.pg-required {
    color: #dc3545;
}

/* Delete button in header */
.pg-delete-header-btn {
    display: none;
    padding: 8px 16px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s;
}

.pg-delete-header-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Hidden modal class */
.modal-hidden {
    display: none !important;
}
