/**
 * Credit Profile Styles
 * Styles for BCU credit profile functionality in Surlink Financial
 */

/* Credit Profile Tab Styling */
.credit-profile-tab {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white !important;
  font-weight: 600;
  border: none;
  transition: all 0.3s ease;
}

.credit-profile-tab:hover {
  background: linear-gradient(135deg, #2a5298 0%, #3a62a8 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

.credit-profile-tab.active {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  box-shadow: 0 4px 12px rgba(30, 60, 114, 0.5);
}

/* Credit Profile Container */
.credit-profile-container {
  padding: 2rem;
  min-height: 400px;
  position: relative;
}

/* Loading State */
.credit-profile-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 1rem;
}

.credit-profile-loading p {
  color: #666;
  font-size: 1.1rem;
}

/* No Data State */
.credit-profile-no-data {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.credit-profile-empty-icon {
  margin-bottom: 1.5rem;
  color: #cbd5e0;
}

.credit-profile-no-data h3 {
  color: #1e3c72;
  margin-bottom: 1rem;
  font-size: 1.8rem;
  font-weight: 700;
}

.credit-profile-no-data .lead {
  font-size: 1.2rem;
  color: #4a5568;
  margin-bottom: 1rem;
}

.credit-profile-no-data p {
  color: #718096;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* Pending State */
.credit-profile-pending {
  max-width: 700px;
  margin: 2rem auto;
}

.credit-profile-pending .alert {
  padding: 2rem;
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.credit-profile-pending h4 {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  font-size: 1.3rem;
}

.credit-profile-pending p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* Generated Profile State */
.credit-profile-data {
  padding: 1rem 0;
}

.credit-profile-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
}

.credit-profile-header h3 {
  color: #1e3c72;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Credit Score Section */
.credit-score-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.credit-score-circle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.credit-score-info h4 {
  color: #1e3c72;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.credit-score-info p {
  color: #4a5568;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* Score Scale */
.score-scale {
  margin-top: 1.5rem;
}

.scale-bar {
  display: flex;
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scale-segment {
  flex: 1;
}

.scale-segment.bad {
  background: linear-gradient(135deg, #a71d2a 0%, #dc3545 100%);
}

.scale-segment.poor {
  background: linear-gradient(135deg, #dc3545 0%, #ff9800 100%);
}

.scale-segment.fair {
  background: linear-gradient(135deg, #ff9800 0%, #ffc107 100%);
}

.scale-segment.good {
  background: linear-gradient(135deg, #ffc107 0%, #5cb85c 100%);
}

.scale-segment.excellent {
  background: linear-gradient(135deg, #5cb85c 0%, #28a745 100%);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #718096;
  padding: 0 0.25rem;
}

/* Summary Cards */
.credit-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.credit-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.credit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.credit-card-icon {
  background: linear-gradient(135deg, #e8f4f8 0%, #d1eaf5 100%);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #2a5298;
}

.credit-card-content {
  flex: 1;
}

.credit-card-content h5 {
  color: #4a5568;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.credit-card-value {
  color: #1e3c72;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  line-height: 1;
}

.credit-card-content small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* Institutions Section */
.credit-institutions {
  margin-top: 2rem;
}

.credit-institutions h4 {
  color: #1e3c72;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}

.institutions-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.institution-item {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.institution-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateX(4px);
}

.institution-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.institution-header h5 {
  color: #1e3c72;
  font-size: 1.2rem;
  margin: 0;
  font-weight: 600;
}

.institution-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.institution-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.detail-label {
  color: #718096;
  font-size: 0.9rem;
}

.detail-value {
  color: #2d3748;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Rating Badges */
.badge {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bg-success {
  background: linear-gradient(135deg, #28a745 0%, #5cb85c 100%);
  color: white;
}

.bg-info {
  background: linear-gradient(135deg, #17a2b8 0%, #5dccda 100%);
  color: white;
}

.bg-warning {
  background: linear-gradient(135deg, #ffc107 0%, #ffdb4d 100%);
  color: #333;
}

.bg-danger {
  background: linear-gradient(135deg, #dc3545 0%, #ff6b7a 100%);
  color: white;
}

.bg-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #8a9299 100%);
  color: white;
}

/* Responsive Design */
@media (max-width: 992px) {
  .credit-score-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .credit-score-circle {
    justify-content: center;
  }

  .credit-summary-cards {
    grid-template-columns: 1fr;
  }

  .institution-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .credit-profile-container {
    padding: 1rem;
  }

  .credit-profile-header h3 {
    font-size: 1.5rem;
  }

  .credit-score-section {
    padding: 1.5rem;
  }

  .credit-card-value {
    font-size: 1.5rem;
  }

  .institution-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Spinner (Bootstrap-like) */
.spinner-border {
  display: inline-block;
  width: 3rem;
  height: 3rem;
  vertical-align: text-bottom;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

.spinner-border.text-primary {
  color: #2a5298;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Profile Dates Styling */
.profile-dates {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-dates p {
  margin: 0;
  font-size: 0.9rem;
}

/* Action Buttons */
.credit-profile-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.credit-profile-actions .btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.credit-profile-actions .btn-primary {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white;
}

.credit-profile-actions .btn-primary:hover {
  background: linear-gradient(135deg, #2a5298 0%, #3a62a8 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

.credit-profile-actions .btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
}

.credit-profile-actions .btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.credit-profile-actions .btn-secondary {
  background: #6b7280;
  color: white;
}

.credit-profile-actions .btn-secondary:hover {
  background: #4b5563;
  transform: translateY(-2px);
}

/* Delete Profile Modal */
.delete-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
}

.delete-modal-overlay.active {
  opacity: 1;
}

.delete-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.delete-modal-overlay.active .delete-modal-content {
  transform: scale(1);
}

.delete-modal-content .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.delete-modal-content .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #111827;
}

.delete-modal-content .modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: #6b7280;
  transition: color 0.2s ease;
}

.delete-modal-content .modal-close-btn:hover {
  color: #111827;
}

.delete-modal-content .modal-body {
  padding: 2rem;
}

/* Dark Mode Styles */
html[data-theme="dark"] .credit-profile-loading p {
  color: #a0a0a0;
}

html[data-theme="dark"] .credit-profile-no-data h3 {
  color: #93c5fd;
}

html[data-theme="dark"] .credit-profile-no-data .lead {
  color: #d1d5db;
}

html[data-theme="dark"] .credit-profile-no-data p {
  color: #9ca3af;
}

html[data-theme="dark"] .credit-profile-header h3 {
  color: white;
}

html[data-theme="dark"] .credit-institutions h4 {
  color: white;
}

html[data-theme="dark"] .delete-modal-content {
  background: var(--background, #1a1a1a);
  color: var(--text-color, #e5e5e5);
}

html[data-theme="dark"] .delete-modal-content .modal-header {
  border-bottom: 1px solid var(--border-color, #333);
}

html[data-theme="dark"] .delete-modal-content .modal-header h3 {
  color: var(--text-color, #e5e5e5);
}

html[data-theme="dark"] .delete-modal-content .modal-close-btn {
  color: var(--text-secondary, #a0a0a0);
}

html[data-theme="dark"] .delete-modal-content .modal-close-btn:hover {
  color: var(--text-color, #e5e5e5);
}

/* Dark Mode - Credit Profile Terms Modal */
html[data-theme="dark"] #creditProfileTermsModal .modal-content {
  background: var(--surface, #1a1a1a);
  color: var(--text-color, #e5e5e5);
}

html[data-theme="dark"] #creditProfileTermsModal h3 {
  color: #93c5fd !important;
}

html[data-theme="dark"] #creditProfileTermsModal h4 {
  color: #93c5fd !important;
}

html[data-theme="dark"] #creditProfileTermsModal p,
html[data-theme="dark"] #creditProfileTermsModal ul,
html[data-theme="dark"] #creditProfileTermsModal li,
html[data-theme="dark"] #creditProfileTermsModal span {
  color: var(--text-secondary, #d1d5db) !important;
}

html[data-theme="dark"] #creditProfileTermsModal a {
  color: #60a5fa !important;
}

html[data-theme="dark"] #creditProfileTermsModal label {
  color: var(--text-secondary, #d1d5db) !important;
}

html[data-theme="dark"] #creditProfileTermsModal .modal-content > div:nth-child(2) > div[style*="background: #f0f4f8"] {
  background: rgba(56, 189, 248, 0.1) !important;
  border-left-color: #60a5fa !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .profile-dates {
    flex-direction: column;
  }

  .credit-profile-actions {
    flex-direction: column;
  }

  .credit-profile-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
