/* Reset default table borders */
table, th, td {
  border: none;
}

.dashboard-container {
  max-width: 850px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-heading {
  width: 100%;
  text-align: left;
}

.dashboard-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  margin-top: 20px;
}

.dashboard-sections {
  width: 100%;
}

/* table styling */
.dashboard-section {
  width: 100%;
}

/* Add breathing room after reports table */
.dashboard-section.report-section {
  margin-bottom: 200px;
}

/* Fix stats section alignment on dashboard (inherits from stats.css but needs reset) */
.dashboard-section.stats-section {
  background-color: transparent;
  width: 100%;
  position: static;
  left: auto;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
}

.table {
  font-size: 12px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  position: relative;
}

.table::before,
.table::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #dee2e6;
}

.table::after {
  bottom: 0;
}

.table th,
.table td {
  text-align: left;
  vertical-align: middle;
  padding: 0.5rem;
  white-space: normal;
}

.table th {
  font-size: 13px;
  font-weight: bold;
  background-color: #fff;
  cursor: pointer; /* Change cursor to pointer on hover */
}

.protest-status option[value="Select"] {
  color: #10a37f;
}

/* Align 'Action' column header */
.table th:last-child {
  text-align: center;
}

/* Align 'Action' column content */
.table td:last-child {
  text-align: center;
  white-space: nowrap;
}

.protest-status {
  border: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
  appearance: none;
  outline: none;
  padding: 0.25rem;
  background-color: #f8f9fa;
}

.protest-status-cell {
  background-color: #f8f9fad1 !important;
}

.protest-status:focus {
  box-shadow: none;
}

/* Download button specific styles */
#dashboard-download-btn-[id],
.dashboard-section .download-report-btn {
    font-size: 12px;
    padding: 0.2rem 0.5rem;
    color: white;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    text-shadow: none;
    appearance: none;
    border-color: rgb(76, 158, 134);
    border: 1px solid rgba(93, 190, 163, 1);
    background-color: rgba(2, 92, 50, 0.834);
}

#dashboard-download-btn-[id]:hover,
.dashboard-section .download-report-btn:hover {
    background-color: white;
    color: rgba(2, 92, 50, 0.834);
    border-color: rgba(93, 190, 163, 1);
}

.editable {
  cursor: pointer;
  transition: background-color 0.3s ease;
  background-color: #f8f9fa !important;
}

.editable:hover {
  background-color: #f8f9fa;
}

/* Updated styles for tooltips */
.table th {
  position: relative;
}

.table th::after {
  content: attr(title);
  position: absolute;
  top: -40px; /* Position above the heading */
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s, visibility 0.1s;
  z-index: 1;
}

.table th:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Responsive adjustments */
@media (min-width: 992px) {
  #main-content {
    max-width: 900px;
    width: 100%;
  }
}

@media (max-width: 991px) {
  /* Main content container styles */
  #main-content {
    max-width: 900px;
    width: 100%;
  }

  /* Transform table into a mobile-friendly block layout 
     This makes each row stack vertically */
  .table, 
  .table tbody, 
  .table tr {
    display: block;
    width: 100%;
  }

  /* Hide table headers on mobile since we use data-labels */
  .table thead {
    display: none;
  }

  /* Add visual separation between stacked table rows */
  .table tr {
    margin-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
  }

  /* Set up basic mobile cell layout using flexbox
     This creates the side-by-side label and content layout */
  .table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    text-align: right;
    border-bottom: 1px solid #eee;
    font-size: 13px;
  }

  /* Create the labels on mobile using data attributes
     These appear on the left side of each cell */
  .table td::before {
    content: attr(data-label);
    font-weight: bold;
    text-align: left;
    flex: 1;
    padding-right: 0.5rem;
  }

  /* Remove the bottom border from the last cell in each row
     and ensure its content aligns to the right */
  .table td:last-child {
    border-bottom: none;
    justify-content: flex-end;
  }

  /* Specific styling for the Protest cell to ensure proper alignment */
  .table td[data-label="Protest"] {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Style the protest status dropdown to ensure right alignment
     The direction: rtl property is crucial for text alignment within the select */
  .protest-status {
    width: 120px !important;
    max-width: none;
    margin-left: auto;
    text-align: right;
    direction: rtl;
  }

  /* Ensure dropdown options are also right-aligned */
  .protest-status option {
    direction: rtl;
    text-align: right;
  }

  /* Handle the N/A case and direct text in protest cell */
  .table td[data-label="Protest"]:not(:has(select)) {
    justify-content: flex-end;
  }

  /* Mobile-specific download button styling */
  #dashboard-download-btn, .finish-payment-btn {
    font-size: 11px;
    padding: 0.2rem 0.4rem;
  }

  /* Remove decorative table borders that don't work well on mobile */
  .table::before,
  .table::after {
    display: none;
  }

  /* Adjust tooltip positioning for mobile viewing */
  .table th::after {
    left: 0;
    transform: none;
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    margin: 0;
    /* padding: 0 20px 10px; */
  }

  /* .dashboard-heading {
    font-size: 1.85rem;
    margin-top: 30px;
    margin-bottom: 30px;
  } */

  .table {
    font-size: 11px;
  }

  .table th {
    font-size: 12px;
  }
}

@media (max-width: 576px) {
  .table {
    font-size: 12px;
  }

  #custom-delete-btn {
    font-size: 18px;
    margin-left: 0.5rem;
  }
}

/* ===========================================
   Dashboard Personal Stats - Option C: 2x2 Grid with Cool Guys
   Design: 300px tall cards, 100px icons, ghost button CTA
   =========================================== */

.dashboard-stats-section {
    margin-bottom: 32px;
}

.dashboard-stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);  /* 2x2 grid for Option C */
    gap: 24px;
}

/* Flip Card Structure */
.dashboard-stat-card {
    perspective: 1000px;
    height: 340px;  /* Taller cards for more breathing room */
}

.dashboard-stat-card:focus {
    outline: 2px solid rgb(62, 126, 108);
    outline-offset: 2px;
    border-radius: 8px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
}

.dashboard-stat-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background-color: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding-top: 20px;
}

.card-back {
    transform: rotateY(180deg);
}

/* Front Card Styles */
.dashboard-stat-card .stat-icon {
    width: 100px;  /* XXXL size for Option C */
    height: 100px;
    margin-bottom: 24px;  /* Breathing room under icon, proportional to homepage 36px */
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-stat-card .stat-icon svg {
    width: 100px;
    height: 100px;
    fill: none;
    stroke: rgb(93, 190, 163);
    stroke-width: 1; /* Design principle: thin, crisp strokes */
}

/* Cool Guys PNG Icons with green tint */
.dashboard-stat-card .stat-icon .cool-guy-icon {
    width: 100px;
    height: 100px;
    filter: invert(60%) sepia(50%) saturate(400%) hue-rotate(110deg) brightness(90%);
}

.dashboard-stat-card .stat-number {
    font-size: 42px;  /* Slightly larger for taller cards */
    font-weight: 700;
    color: #0F172A;
    line-height: 1.1;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.dashboard-stat-card .stat-label {
    font-size: 15px;  /* Slightly larger for taller cards */
    font-weight: 600;
    color: rgb(62, 126, 108);
    line-height: 1.4;
    margin-bottom: 12px;  /* White space below label to match icon spacing above */
}

/* Flip Trigger Button */
.flip-trigger {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9CA3AF;
    border-radius: 4px;
    opacity: 0.3;
    transition: opacity 0.2s, color 0.2s, transform 0.3s ease;
}

/* Brighten flip trigger on card hover */
.dashboard-stat-card:hover .flip-trigger,
.dashboard-stat-card:focus .flip-trigger {
    opacity: 1;
}

/* Cute wiggle animation on flip trigger hover */
.flip-trigger:hover {
    color: rgb(62, 126, 108);
    animation: flip-wiggle 0.6s ease-in-out;
}

@keyframes flip-wiggle {
    0% { transform: rotateY(0deg); }
    25% { transform: rotateY(25deg); }
    50% { transform: rotateY(-20deg); }
    75% { transform: rotateY(15deg); }
    100% { transform: rotateY(0deg); }
}

.flip-trigger:focus {
    outline: 2px solid rgb(62, 126, 108);
    outline-offset: 1px;
    opacity: 1;
}

/* Back Card Styles */
.back-content {
    width: 100%;
    text-align: center;
    max-height: calc(100% - 40px);  /* Leave room for flip button */
    overflow-y: auto;
}

.back-title {
    font-size: 14px;
    font-weight: 600;
    color: rgb(62, 126, 108);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.back-detail {
    font-size: 16px;
    color: #374151;
    line-height: 1.5;
}

.back-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 16px;
    color: #374151;
    text-align: left;
}

.back-list li {
    padding: 4px 0;
    border-bottom: 1px solid #F3F4F6;
}

.back-list li:last-child {
    border-bottom: none;
}

.journey-list .journey-footer {
    font-style: italic;
    color: #6B7280;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #E5E7EB;
    border-bottom: none;
}

.start-evaluation-link {
    color: rgb(62, 126, 108);
    text-decoration: none;
    font-weight: 500;
}

.start-evaluation-link:hover {
    text-decoration: underline;
}

/* Subtle hover effect on card */
.dashboard-stat-card:hover .card-front,
.dashboard-stat-card:hover .card-back {
    border-color: rgb(93, 190, 163);
}

/* ===========================================
   CTA Card Styles (4th card - Free Evaluation)
   =========================================== */

.cta-card {
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(62, 126, 108, 0.15);
}

.cta-card .card-inner {
    transform-style: flat; /* No flip */
}

.cta-front {
    background: linear-gradient(135deg, #F0FAF7 0%, #E8F5F0 100%);
    border: 1px solid rgb(93, 190, 163); /* Design principle: thin, crisp borders */
}

.cta-card:hover .cta-front {
    border-color: rgb(62, 126, 108);
    background: linear-gradient(135deg, #E8F5F0 0%, #D8EFE8 100%);
}

.cta-icon svg {
    stroke: rgb(62, 126, 108);
}

/* Add more space between icon and text on CTA card */
.cta-card .stat-icon {
    margin-bottom: 24px;
}

.cta-headline {
    font-size: 28px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 8px;
}

.cta-subtext {
    font-size: 16px;
    color: #6B7280;
    margin-bottom: 0;
}

/* ===========================================
   Dashboard Stats Responsive Design (Option C)
   =========================================== */

/* Tablets (768px - 991px) - Keep 2x2 grid, slightly smaller */
@media (min-width: 768px) and (max-width: 991px) {
    .dashboard-stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .dashboard-stat-card {
        height: 260px;
    }

    .dashboard-stat-card .stat-icon {
        width: 80px;
        height: 80px;
    }

    .dashboard-stat-card .stat-icon .cool-guy-icon {
        width: 80px;
        height: 80px;
    }

    .dashboard-stat-card .stat-number {
        font-size: 36px;
    }

    .dashboard-stat-card .stat-label {
        font-size: 14px;
    }
}

/* Mobile (max-width: 767px) - 2x2 grid with smaller icons */
@media (max-width: 767px) {
    .dashboard-stats-section {
        margin-bottom: 24px;
    }

    .dashboard-stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .dashboard-stat-card {
        height: 200px;
    }

    .card-front,
    .card-back {
        padding: 16px;
        padding-top: 16px;
    }

    .dashboard-stat-card .stat-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 10px;
        margin-top: 8px;
    }

    .dashboard-stat-card .stat-icon .cool-guy-icon {
        width: 56px;
        height: 56px;
    }

    .dashboard-stat-card .stat-number {
        font-size: 28px;
        margin-bottom: 6px;
    }

    .dashboard-stat-card .stat-label {
        font-size: 12px;
    }

    .back-title {
        font-size: 10px;
        margin-bottom: 8px;
    }

    .back-detail {
        font-size: 12px;
    }

    .back-list {
        font-size: 12px;
    }

    .flip-trigger {
        bottom: 6px;
        right: 6px;
    }

    .flip-trigger svg {
        width: 14px;
        height: 14px;
    }

    /* CTA card responsive */
    .cta-headline {
        font-size: 15px;
    }

    .cta-subtext {
        font-size: 11px;
        margin-bottom: 0;
    }
}

/* Extra small mobile (max-width: 430px) - Single column */
@media (max-width: 430px) {
    .dashboard-stats-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dashboard-stat-card {
        height: 180px;
    }

    .dashboard-stat-card .stat-icon {
        width: 64px;
        height: 64px;
    }

    .dashboard-stat-card .stat-icon .cool-guy-icon {
        width: 64px;
        height: 64px;
    }

    .dashboard-stat-card .stat-number {
        font-size: 32px;
    }

    .dashboard-stat-card .stat-label {
        font-size: 13px;
    }

    /* CTA card extra small */
    .cta-headline {
        font-size: 16px;
    }

    .cta-subtext {
        font-size: 12px;
        margin-bottom: 0;
    }
}