/* =========================================================
   Base Container
========================================================= */
.profile-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(69, 100, 178, 0.08);
}

/* Lock page when modal is open */
body.modal-open {
    overflow: hidden;
    height: 100vh;
}

/* =========================================================
   Download Section (Top)
========================================================= */
.download-section {
    margin-bottom: 1.5rem;
}

/* =========================================================
   Table
========================================================= */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    background: #ffffff;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
}

/* Table Head */
.table thead th {
    background: #4564b2;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px;
    border-bottom: 1px solid #e2e8ff;
    text-align: center;
    vertical-align:middle;
}

/* Table Body */
.table tbody td {
    padding: 12px;
    font-size: 0.9rem;
    color: #1f2937;
    border-bottom: 1px solid #eef2ff;
    vertical-align: middle;
}

/* Remove Bootstrap borders */
.table-bordered > :not(caption) > * {
    border: none;
}

/* =========================================================
   Status Badges
========================================================= */
.status-label {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #ffffff;
}

.status-active { background: #4564b2; }
.status-future { background: #025316; }
.status-pending { background: #f59e0b; }
.status-expired { background: #ef4444; }
.status-past_due { background: #fb923c; }
.status-cancelled { background: #6b7280; }

/* =========================================================
   Download Links (Text-only, everywhere)
========================================================= */
.profile-link.download-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    background: transparent;
    border: none !important;
    padding: 0 !important;

    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
}

.profile-link.download-link i {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

/* Hover effect */
.profile-link.download-link:hover {
    color: #364fa0;
    text-decoration: underline;
}

.profile-link.download-link:hover i {
    transform: translateY(1px);
}

/* Keep table links compact */
.table td .profile-link.download-link {
    white-space: nowrap;
}

/* =========================================================
   Empty State
========================================================= */
.empty-title {
    color: #6b7280;
    margin-bottom: 12px;
}

/* =========================================================
   Mobile
========================================================= */
@media (max-width: 576px) {
    .profile-link.download-link span {
        display: none;
    }
}



/* Modal Close Button */
.modal-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 25px;
    font-weight: bold;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #000;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #e74c3c;
    color: #fff;
    transform: scale(1.1);
}

/* Responsive Close Button */
@media (max-width: 768px) {
    .modal-close-btn {
        font-size: 42px;
        width: 60px;
        height: 60px;
        line-height: 56px;
    }
}

/* Profile Header Flex */
.profile-header-view-my-plans {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px; /* optional spacing */
}


.profile-link.download-link.download-green {
    color: #22c55e;
}

.profile-link.download-link.download-green:hover {
    color: #000;
    background-color: #70da97;
    text-decoration: underline;
    transform: scale(1.1);
}
/* =========================================================
   Mobile Card Layout for Table (Improved Spacing)
========================================================= */
@media (max-width: 768px) {

    /* Hide table header */
    .table thead {
        display: none;
    }

    /* Convert table to block layout */
    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    /* Card container */
    .table tr {
        background: #ffffff;
        border-radius: 12px;
        margin-bottom: 16px;
        padding: 14px 18px;              /* ⬅ better side spacing */
        box-shadow: 0 6px 18px rgba(69, 100, 178, 0.08);
    }

    /* Card rows */
    .table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;

        padding: 10px 0;                 /* vertical only */
        border-bottom: 1px solid #eef2ff;
        font-size: 0.9rem;
        gap: 12px;                       /* ⬅ label/value gap */
    }

    .table tbody td:last-child {
        border-bottom: none;
        padding-top: 14px;
    }

    /* Labels */
    .table tbody td::before {
        content: attr(data-label);
        min-width: 110px;                /* ⬅ keeps alignment */
        font-weight: 600;
        color: #6b7280;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        flex-shrink: 0;
    }

    /* Values align nicely */
    .table tbody td > * {
        textigger: 1;
        text-align: right;
    }

    /* Download button stays clean */
    .table tbody td a.download-link {
        margin-left: auto;
        font-size: 0.95rem;
        white-space: nowrap;
    }
}

/* =========================================================
   Mobile Header Improvements
========================================================= */
@media (max-width: 768px) {

    .profile-header-view-my-plans {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .profile-title {
        font-size: 1.25rem;
    }

    .profile-header-view-my-plans .download-link {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
        border-radius: 10px;
        background: #22c55e !important;
        color: #fff !important;
        text-decoration: none;
    }

    .profile-header-view-my-plans .download-link:hover {
        background: #16a34a !important;
        transform: none;
    }
}

/* Extra small screens */
@media (max-width: 576px) {
    .profile-section {
        padding: 16px;
    }
}

.view-plan-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.view-plan-modal-content {
    background: #fff;
    border-radius: 14px;
    width: 95%;
    max-width: 900px;

    max-height: 90vh;      /* KEY */
    overflow-y: auto;      /* KEY */

    position: relative;
}
@media (max-width: 768px) {
    .view-plan-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        -webkit-overflow-scrolling: touch;
    }
}

/* =========================================================
   Desktop Table Alternate Row Colors
========================================================= */
.table tbody tr:nth-child(odd) {
    background-color: #e0e8f7;
}

.table tbody tr:nth-child(even) {
    background-color: #9bb4f4;
}

/* Improve text contrast on green rows */
.table tbody tr:nth-child(even) td {
    color: #000;
}

@media (max-width: 768px) {

    /* Alternate card background */
    .table tr:nth-child(odd) {
        background-color: #f8fafe;
    }

    .table tr:nth-child(even) {
        background-color: #9bb4f4;
        
    }

    /* Text color for green cards */
    .table tr:nth-child(even) td,
    .table tr:nth-child(even) td::before {
        color: #000;
    }

}

