/* --- Base Container Styles --- */
.whats-next-section,
#whats-next-section {
    /* CHANGED: Reduced top margin further */
    margin-top: 4px !important;
    margin-bottom: 32px !important;
    max-width: 800px !important;
    margin-left: auto;
    margin-right: auto;
    /* CHANGED: Reduced overall padding for a smaller look */
    padding: 5px 20px 30px 20px !important;
    /* Light blue-gray background to make it stand out */
    background-color: #f1f5f9;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    /* Default: no internal scroll for short content */
    max-height: none;
    overflow: visible;
    /* Prepare modern thin scrollbar (only shows when overflow is enabled by a conditional rule) */
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: #b6c3d6 transparent;
}

/* Enable scrolling only when content is likely tall enough:
    - 3 or more info boxes (inserted directly under .whats-next-content)
    - OR 5 or more cards inside the cards container */
.whats-next-section:has(.whats-next-content > :nth-child(3 of .info-box)),
#whats-next-section:has(.whats-next-content > :nth-child(3 of .info-box)),
.whats-next-section:has(.whats-next-cards-container > :nth-child(5 of .whats-next-card)),
#whats-next-section:has(.whats-next-cards-container > :nth-child(5 of .whats-next-card)) {
    max-height: 560px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
}

/* Mobile: slightly shorter max height when scroll is enabled */
@media (max-width: 640px) {

    .whats-next-section:has(.whats-next-content > :nth-child(3 of .info-box)),
    #whats-next-section:has(.whats-next-content > :nth-child(3 of .info-box)),
    .whats-next-section:has(.whats-next-cards-container > :nth-child(5 of .whats-next-card)),
    #whats-next-section:has(.whats-next-cards-container > :nth-child(5 of .whats-next-card)) {
        max-height: 420px !important;
    }
}

/* Stylish, modern scrollbar (WebKit/Blink) */
.whats-next-section::-webkit-scrollbar,
#whats-next-section::-webkit-scrollbar {
    width: 10px;
}

.whats-next-section::-webkit-scrollbar-track,
#whats-next-section::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 8px;
}

.whats-next-section::-webkit-scrollbar-thumb,
#whats-next-section::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c7d2fe 0%, #b6c3d6 100%);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.whats-next-section::-webkit-scrollbar-thumb:hover,
#whats-next-section::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #aab4f5 0%, #9fb0c7 100%);
}

.whats-next-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    /* CHANGED: Reduced margin below title */
    margin-bottom: 8px;
}

/* --- Responsive Card Container (Two Columns) --- */
.whats-next-cards-container {
    display: flex;
    flex-wrap: wrap;
    /* Reduced gap between cards */
    gap: 12px;
    justify-content: flex-start;
    /* Avoid equal-height stretching; let each card size to its content */
    align-items: flex-start;
}

/* Default to one column on smaller screens */
.whats-next-card {
    width: 100%;
    min-width: 250px;
    /* CHANGED: Reduced card padding slightly more */
    padding: 10px;
    border-radius: 12px;
    border-left: 4px solid;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    /* Ensure this card does not stretch to tallest sibling */
    align-self: flex-start;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Two columns for screens wider than 640px */
@media (min-width: 640px) {
    .whats-next-card {
        width: calc(50% - 6px);
        /* 50% width minus half the gap */
    }
}

.whats-next-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.apostille-originals-status-info-box {
    border-color: #c4b5fd;
    background: #f7f4ff;
}

.apostille-originals-status-list {
    margin: 8px 0 0;
    padding-left: 18px;
}

.apostille-originals-status-list li {
    margin: 4px 0;
}

.card-header {
    /* CHANGED: Reduced margin below header to be very small */
    margin-bottom: 4px;
}

/* NEW: Style for Material Icons */
.card-icon {
    /* CHANGED: Increased size for better visibility */
    font-size: 1.5em !important;
    margin-right: 6px;
    /* Ensure icon color is set by the parent card color class */
}

.card-label {
    font-size: 12px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.card-title {
    font-weight: 700;
    font-size: 18px;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* --- Action Button Styles with !important applied to essential properties --- */
.card-button {
    /* Sizing and Text */
    color: #ffffff !important;
    font-weight: 600 !important;
    /* Smaller padding remains */
    padding: 6px 14px !important;
    /* Smaller font size remains */
    font-size: 13px !important;

    /* Appearance */
    border-radius: 9999px !important;
    /* FIX: Corrected non-standard !important application for box-shadow */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    cursor: pointer !important;
    width: 100% !important;
    /* CHANGED: Reduced margin above button to be very small */
    margin-top: 4px !important;

    /* Behavior */
    transition: background-color 0.2s, transform 0.2s;
}

.card-button:hover {
    transform: translateY(-1px);
}

/* --- Card Color Schemes (Softened Colors & Button backgrounds use !important) --- */

/* Orange (Quote/Payment) */
.color-orange {
    background-color: #fffaf0;
    border-color: #ffb74d;
    color: #e65100;
}

.color-orange .card-title {
    color: #e65100;
}

.color-orange .card-icon {
    color: #ffb74d;
}

.color-orange .card-button {
    background-color: #ffb74d !important;
}

.color-orange .card-button:hover {
    background-color: #ffa726 !important;
}

/* Green (Completed/Review) */
.color-green {
    background-color: #f0fff0;
    border-color: #a5d6a5;
    color: #388e3c;
}

.color-green .card-title {
    color: #388e3c;
}

.color-green .card-icon {
    color: #a5d6a5;
}

.color-green .card-button {
    background-color: #a5d6a5 !important;
}

.color-green .card-button:hover {
    background-color: #81c784 !important;
}

/* Sky (Messages) */
.color-sky {
    background-color: #f0f8ff;
    border-color: #81d4fa;
    color: #0288d1;
}

.color-sky .card-title {
    color: #0288d1;
}

.color-sky .card-icon {
    color: #81d4fa;
}

.color-sky .card-button {
    background-color: #81d4fa !important;
}

.color-sky .card-button:hover {
    background-color: #4fc3f7 !important;
}

/* Red (Urgent Files/Reupload) */
.color-red {
    background-color: #fffafa;
    border-color: #ef9a9a;
    color: #c62828;
}

.color-red .card-title {
    color: #c62828;
}

.color-red .card-icon {
    color: #ef9a9a;
}

.color-red .card-button {
    background-color: #ef9a9a !important;
}

.color-red .card-button:hover {
    background-color: #e57373 !important;
}

/* Purple (Notarization) */
.color-purple {
    background-color: #f9f0ff;
    border-color: #ce93d8;
    color: #7b1fa2;
}

.color-purple .card-title {
    color: #7b1fa2;
}

.color-purple .card-icon {
    color: #ce93d8;
}

.color-purple .card-button {
    background-color: #ce93d8 !important;
}

.color-purple .card-button:hover {
    background-color: #ba68c8 !important;
}

/* Blue (Shipping) */
.color-blue {
    background-color: #f0f8ff;
    border-color: #90caf9;
    color: #1976d2;
}

.color-blue .card-title {
    color: #1976d2;
}

.color-blue .card-icon {
    color: #90caf9;
}

.color-blue .card-button {
    background-color: #90caf9 !important;
}

.color-blue .card-button:hover {
    background-color: #64b5f6 !important;
}

/* Lime (Evaluation) */
.color-lime {
    background-color: #fafff0;
    border-color: #c5e1a5;
    color: #689f38;
}

.color-lime .card-title {
    color: #689f38;
}

.color-lime .card-icon {
    color: #c5e1a5;
}

.color-lime .card-button {
    background-color: #c5e1a5 !important;
}

.color-lime .card-button:hover {
    background-color: #aed581 !important;
}

/* Gray (No Action Needed) */
.color-gray {
    background-color: #f9f9f9;
    border-color: #bdbdbd;
    color: #616161;
}

.color-gray .card-title {
    color: #616161;
}

.color-gray .card-icon {
    color: #bdbdbd;
}

.color-gray .card-button {
    background-color: #bdbdbd !important;
}

.color-gray .card-button:hover {
    background-color: #9e9e9e !important;
}

/* --- Centralized Note and Steps Styles --- */
.whats-next-card .card-note {
    margin: 8px 12px 2px 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: #334155;
    /* slate-700 */
    line-height: 1.45;
    background: #f8fafc;
    /* slate-50 */
    border-left: 3px solid #94a3b8;
    /* slate-400 */
    border-radius: 6px;
}

.whats-next-card .card-note-title {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #475569;
    /* slate-600 */
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.whats-next-card .card-note-title::before {
    content: '✔';
    font-size: 14px;
    color: #64748b;
    /* slate-500 */
}

.whats-next-card .card-steps {
    margin: 0;
    padding-left: 18px;
}

.whats-next-card .card-steps li {
    margin: 4px 0;
}