/* WCAG Accessibility Improvements */
/* Skip navigation link for screen readers */
.skip-nav {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
}

.skip-nav:focus {
  top: 6px;
}

/* Focus indicators for keyboard navigation */
*:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* Remove default focus outline for mouse users */
*:focus:not(:focus-visible) {
  outline: none;
}

body {
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
  padding-top: 20px;
  padding-bottom: 20px;
}

#logo img {
  margin: -5px 10px 0 0;
  height: 28px;
}

nav {
  margin-bottom: 20px;
}

.gg-callout {
  border-color: #ddd;
  border-image: none;
  border-radius: 3px;
  border-style: solid;
  border-width: 1px 1px 1px 10px;
  margin: 0 0 20px 0;
  padding: 20px;
}

.gg-callout .close {
  right: 0;
  top: 0;
}

.gg-callout h4 {
  margin-bottom: 5px;
  margin-top: 0;
}

.gg-callout-error, .gg-callout-alert {
  border-left-color: #d9534f;
}

.gg-callout-error h4, .gg-callout-alert h4, .gg-callout-error span, .gg-callout-alert span {
  color: #d9534f;
}

.gg-callout-notice {
  border-left-color: #5cb85c;
}

.gg-callout-notice h4 {
  color: #000;
}

#error-explanation, .field_with_errors input {
  border-color: #d9534f;
}

.field_with_errors {
  display: inline;
}

table.align-middle td {
  vertical-align: middle;
}

/* Dashboard Styles */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.dashboard-header {
  margin-bottom: 40px;
}

.dashboard-title {
  color: #2c3e50;
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 10px;
}

.dashboard-subtitle {
  color: #7f8c8d;
  font-size: 1.1rem;
  margin: 0;
}

.accounts-section {
  margin-bottom: 50px;
}

.section-title {
  color: #34495e;
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ecf0f1;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.account-card {
  background: #fff;
  border: 1px solid #e1e8ed;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
}

/* .account-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
} */

.account-card.overdue {
  border-left: 4px solid #e74c3c;
}

.account-card.due-soon {
  border-left: 4px solid #f39c12;
}

.account-card.current {
  border-left: 4px solid #27ae60;
}

.account-card.closed {
  background: #f8f9fa;
  border-color: #dee2e6;
  opacity: 0.8;
}

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #ecf0f1;
}

.service-info {
  flex: 1;
}

.service-address {
  color: #2c3e50;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 5px 0;
}

.service-id {
  color: #495057;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.4;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-closed {
  background: #f8d7da;
  color: #721c24;
}

.account-details {
  margin-bottom: 25px;
}

.balance-section, .due-date-section, .closed-date-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.balance-label, .due-label, .closed-label {
  color: #495057;
  font-weight: 500;
}

.balance-amount {
  font-size: 1.4rem;
  font-weight: 700;
  color: #27ae60;
}

.balance-amount.overdue {
  color: #e74c3c;
}

.due-date, .closed-date {
  font-weight: 600;
}

.due-date.overdue {
  color: #e74c3c;
}

.due-date.due-soon {
  color: #f39c12;
}

.due-date.current {
  color: #27ae60;
}

.paperless-indicator, .autopay-indicator {
  display: flex;
  align-items: center;
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.paperless-indicator i, .autopay-indicator i {
  margin-right: 8px;
  width: 16px;
  height: 16px;
}

.account-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-actions .btn {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  flex: 1;
  min-width: 100px;
  min-height: 44px;
}

.account-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.no-accounts-message {
  text-align: center;
  padding: 60px 20px;
  background: #f8f9fa;
  border-radius: 12px;
  margin: 40px 0;
}

.no-accounts-message h2 {
  color: #6c757d;
  font-weight: 300;
  margin-bottom: 15px;
}

.no-accounts-message p {
  color: #adb5bd;
  font-size: 1.1rem;
}

.closed-accounts .section-title {
  color: #6c757d;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .account-card:hover {
    transform: none;
  }
  
  .account-actions .btn:hover {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .status-badge {
    border: 2px solid;
  }
  
  .account-card {
    border-width: 2px;
  }
}

/* Bank Accounts Section */
.bank-accounts .section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-all-link {
  font-size: 1rem;
  font-weight: 500;
  color: #007bff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.view-all-link:hover {
  background-color: #f8f9fa;
  text-decoration: none;
}

.bank-accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.bank-account-card {
  background: #fff;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.bank-account-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bank-account-header {
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f3f4;
}

.account-nickname {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
  flex: 1;
}

.account-number {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #6c757d;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 4px;
}

.bank-account-details {
  margin-bottom: 15px;
}

.account-holder {
  color: #495057;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.bank-account-details .autopay-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #fff3cd;
  color: #856404;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

.bank-account-details .autopay-indicator i {
  font-size: 0.8rem;
}

.bank-account-actions {
  display: flex;
  justify-content: flex-end;
}

.bank-account-actions .btn {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.no-bank-accounts-message {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 40px;
}

.no-bank-accounts-message h2 {
  color: #6c757d;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 15px;
}

.no-bank-accounts-message p {
  color: #adb5bd;
  margin-bottom: 20px;
}

/* Account Details Page Styles */
.breadcrumb {
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.breadcrumb-link {
  color: #007bff;
  text-decoration: none;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  margin: 0 8px;
  color: #6c757d;
}

.breadcrumb-current {
  color: #6c757d;
}

.account-details-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.account-summary {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 20px 25px;
}

.account-summary .balance-section {
  margin-bottom: 8px;
}

.account-summary .due-date-section {
  margin-bottom: 0;
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.details-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
}

.details-sections .accounts-section {
  margin-bottom: 0;
}

.details-sections .details-card {
  margin: 0;
}

.operation-card {
  text-align: center;
  padding: 20px;
}

.operation-card h4 {
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.operation-card p {
  color: #6c757d;
  font-size: 0.9rem;
  margin: 0 0 15px 0;
  line-height: 1.4;
}

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

.details-card {
  padding: 25px;
}

.details-card-title {
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #ecf0f1;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f3f4;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 500;
  color: #495057;
  flex: 0 0 40%;
}

.detail-value {
  color: #2c3e50;
  text-align: right;
  flex: 1;
}

.usage-chart {
  padding: 25px;
}

.chart-container {
  display: flex;
  align-items: end;
  justify-content: space-between;
  height: 200px;
  gap: 8px;
  padding: 20px 0;
  border-bottom: 2px solid #dee2e6;
  position: relative;
}

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.bar-container {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 120px;
}

.bar {
  background: linear-gradient(to top, #007bff, #66b3ff);
  width: 80%;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  transition: all 0.3s ease;
}

.bar:hover {
  background: linear-gradient(to top, #0056b3, #4da6ff);
}

.bar-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #495057;
  margin-top: 8px;
}

.bar-value {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 4px;
}

.transaction-history {
  padding: 0;
  overflow: hidden;
}

.table-responsive {
  margin: 0;
}

.table {
  margin: 0;
  font-size: 0.9rem;
}

.table th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
  padding: 15px;
}

.table td {
  padding: 12px 15px;
  vertical-align: middle;
}

.amount-cell.negative {
  color: #28a745;
}

.balance-cell {
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard-title {
    font-size: 2rem;
  }
  
  .accounts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .account-actions {
    flex-direction: column;
  }
  
  .btn {
    flex: none;
    width: 100%;
  }
  
  .account-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .bank-accounts .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .bank-accounts-grid {
    grid-template-columns: 1fr;
  }
  
  .bank-account-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .operations-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
  }
  
  .operation-card {
    padding: 15px;
  }
  
  .operation-card h4 {
    font-size: 1rem;
    margin-bottom: 8px;
  }
  
  .operation-card p {
    font-size: 0.8rem;
    margin-bottom: 12px;
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
  
  .details-sections {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .detail-label {
    flex: none;
  }
  
  .detail-value {
    text-align: left;
  }
  
  .chart-container {
    height: 120px;
    gap: 4px;
    padding: 15px 0;
  }
  
  .bar-container {
    min-height: 60px;
  }
  
  .bar-label {
    font-size: 0.7rem;
    margin-top: 6px;
  }
  
  .bar-value {
    font-size: 0.65rem;
    margin-top: 2px;
  }
  
  .usage-chart {
    padding: 15px;
  }
  
  .table-responsive {
    font-size: 0.8rem;
  }
  
  .table th,
  .table td {
    padding: 8px 6px;
  }
}
