/* ========================================
   STUDENT APPLICATIONS CSS
   Mobile-First Responsive Design
   ======================================== */

/* ========================================
   1. UTILITY CLASSES FOR ICONS
   ======================================== */

/* Icon sizing utilities */
.icon-lg {
    font-size: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-md {
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-sm {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile icon sizing */
@media (max-width: 768px) {
    .icon-lg {
        font-size: 1.75rem;
    }

    .icon-md {
        font-size: 1.25rem;
    }

    .icon-sm {
        font-size: 0.9rem;
    }
}

/* ========================================
   2. PROGRESS BAR STYLING
   ======================================== */

.course-progress-wrapper {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.course-progress-wrapper .progress-bar {
    transition: width 0.6s ease;
    border-radius: 10px;
}

/* Mobile: Full width */
@media (max-width: 576px) {
    .course-progress-wrapper {
        height: 6px;
        margin-bottom: 1.5rem !important;
    }
}

/* ========================================
   2. ALERT STYLING & ICONS
   ======================================== */

.course-alert-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    flex-shrink: 0;
}

.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 1.5rem;
}

.alert-danger {
    background-color: #fff5f5;
    color: #c53030;
}

.alert-warning {
    background-color: #fffaf0;
    color: #c05621;
}

.alert-success {
    background-color: #f0fdf4;
    color: #15803d;
}

.alert-info {
    background-color: #f0f9ff;
    color: #0369a1;
}

/* Alert heading styling */
.alert-heading {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Mobile alert styling */
@media (max-width: 768px) {
    .course-alert-icon {
        font-size: 1.25rem;
        min-width: 2rem;
    }

    .alert {
        margin-bottom: 1rem;
        font-size: 0.95rem;
    }

    .alert-heading {
        font-size: 1rem;
    }

    .alert .d-flex {
        flex-direction: column;
    }

    .alert .course-alert-icon {
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }
}

/* ========================================
   3. COURSE CARDS STYLING
   ======================================== */

.course-card {
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #ffffff;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.course-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-4px);
    border-color: #00a4b8;
}

.course-card .card-title {
    color: #1a2c5e;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.course-card .card-body {
    padding: 1.5rem;
}

.course-item {
    margin-bottom: 1rem;
}

/* Mobile course card */
@media (max-width: 768px) {
    .course-card .card-body {
        padding: 1rem;
    }

    .course-card .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .course-item {
        margin-bottom: 0.75rem;
    }
}

/* ========================================
   4. TABLE STYLING - COURSE DURATIONS
   ======================================== */

.table {
    margin-bottom: 0;
}

.table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.table th {
    font-weight: 600;
    color: #1a2c5e;
    font-size: 0.95rem;
    padding: 1rem;
    border-color: #dee2e6;
}

.table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-color: #e9ecef;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9ff;
}

.table-responsive {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow-x: auto;
    margin-bottom: 1rem;
}

/* Badges in table */
.table .badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
    font-weight: 500;
}

/* Mobile table adjustments */
@media (max-width: 768px) {
    .table-responsive {
        margin: -1rem -1rem 1rem -1rem;
        border-radius: 0;
    }

    .table th,
    .table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }

    .table th {
        font-size: 0.8rem;
    }

    .table .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }

    /* Hide less important columns on mobile */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

/* Very small devices */
@media (max-width: 480px) {
    .table th,
    .table td {
        padding: 0.5rem 0.3rem;
        font-size: 0.75rem;
    }

    .table .badge {
        font-size: 0.7rem;
    }
}

/* ========================================
   5. SELECT/DROPDOWN STYLING
   ======================================== */

.intake-date-select,
.form-select,
.form-control {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.intake-date-select:focus,
.form-select:focus,
.form-control:focus {
    border-color: #00a4b8;
    box-shadow: 0 0 0 0.2rem rgba(0, 164, 184, 0.15);
}

.form-select-sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.875rem;
}

/* Mobile select */
@media (max-width: 768px) {
    .intake-date-select,
    .form-select,
    .form-control {
        padding: 0.6rem 0.75rem;
        font-size: 1rem;
    }
}

/* ========================================
   6. BUTTONS STYLING
   ======================================== */

.select-course-btn {
    background-color: #00a4b8;
    border-color: #00a4b8;
    color: white;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 90px;
}

.select-course-btn:hover:not(.selected) {
    background-color: #0089a1;
    border-color: #0089a1;
    transform: translateY(-2px);
}

.select-course-btn.selected {
    background-color: #2ecc71;
    border-color: #27ae60;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.select-course-btn:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

.select-course-btn .btn-text {
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Mobile buttons */
@media (max-width: 768px) {
    .select-course-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
        min-width: auto;
    }

    .btn-lg {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ========================================
   7. ACTION CELL STYLING
   ======================================== */

.course-action-cell {
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .course-action-cell {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* ========================================
   8. COURSE SUMMARY/SELECTED COURSES LIST
   ======================================== */

.course-summary-list {
    max-height: 500px;
    overflow-y: auto;
    border-radius: 8px;
}

.course-summary-list .list-group {
    border: none;
}

.course-summary-list .list-group-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.course-summary-list .list-group-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.course-summary-list .list-group-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.course-summary-list h6 {
    color: #1a2c5e;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.course-summary-list small {
    display: block;
    line-height: 1.6;
}

.course-summary-list .btn-outline-danger {
    flex-shrink: 0;
}

/* Mobile summary list */
@media (max-width: 768px) {
    .course-summary-list .list-group-item {
        padding: 0.75rem;
    }

    .course-summary-list .list-group-item h6 {
        font-size: 0.95rem;
    }

    .course-summary-list .list-group-item small {
        font-size: 0.8rem;
    }

    .course-summary-list .list-group-item .ms-2 {
        margin-left: 0 !important;
        margin-top: 0.5rem;
    }

    .course-summary-list .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }

    .course-summary-list .btn-outline-danger {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* ========================================
   9. SEARCH & FILTER SECTION
   ======================================== */

.input-group {
    border-radius: 6px;
    overflow: hidden;
}

.input-group-text {
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    color: #6c757d;
}

#courseSearch,
#courseFilter {
    border: 1px solid #dee2e6;
}

#courseSearch:focus,
#courseFilter:focus {
    border-color: #00a4b8;
    box-shadow: 0 0 0 0.2rem rgba(0, 164, 184, 0.15);
}

/* Mobile search filter */
@media (max-width: 768px) {
    #courseSearch,
    #courseFilter {
        margin-bottom: 0.75rem;
    }

    .row.mb-4 {
        margin-bottom: 1rem !important;
    }

    .row.mb-4 > div {
        margin-bottom: 0.75rem;
    }
}

/* ========================================
   10. CARD HEADER & BODY
   ======================================== */

.card {
    border-radius: 12px;
    border: none;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.badge.p-3 {
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem;
}

/* Mobile card */
@media (max-width: 768px) {
    .card-header {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    .badge.p-3 {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem;
    }
}

/* ========================================
   11. NAVIGATION BUTTONS (FOOTER)
   ======================================== */

.d-grid.gap-2 {
    gap: 1rem;
}

/* Mobile navigation buttons - Stack vertically */
@media (max-width: 768px) {
    .d-grid.gap-2 {
        gap: 0.5rem;
    }

    .d-md-flex {
        display: grid !important;
    }

    .d-grid.gap-2 > * {
        width: 100%;
    }

    .justify-content-md-between {
        justify-content: flex-start;
    }

    .btn-lg {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-lg:last-child {
        margin-bottom: 0;
    }
}

/* ========================================
   12. HORIZONTAL RULE
   ======================================== */

hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid #e9ecef;
}

@media (max-width: 768px) {
    hr {
        margin: 1.5rem 0;
    }
}

/* ========================================
   13. HEADINGS & TEXT
   ========================================

h1, h2, h3, h4, h5, h6 {
    color: #1a2c5e;
    font-weight: 600;
}

.text-muted {
    color: #6c757d !important;
}

.text-success {
    color: #2ecc71 !important;
}

.text-danger {
    color: #e74c3c !important;
}

.text-info {
    color: #3498db !important;
}

/* Mobile text sizing */
@media (max-width: 768px) {
    h5 {
        font-size: 1.1rem;
    }

    h6 {
        font-size: 1rem;
    }

    p {
        font-size: 0.95rem;
    }

    small {
        font-size: 0.8rem;
    }
}

/* ========================================
   14. CONTAINERS & SPACING
   ======================================== */

.container-fluid,
.container {
    padding-left: 1rem;
    padding-right: 1rem;
}

.row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

/* Extra spacing utilities */
.mb-5 {
    margin-bottom: 3rem;
}

.my-5 {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

/* Mobile spacing adjustments */
@media (max-width: 768px) {
    .container-fluid,
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .row {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }

    .mb-5 {
        margin-bottom: 2rem;
    }

    .my-5 {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

/* ========================================
   15. RESPONSIVE LAYOUT ADJUSTMENTS
   ======================================== */

/* Tablet (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .table th,
    .table td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Large screens (1025px+) */
@media (min-width: 1025px) {
    .col-lg-10 {
        flex: 0 0 83.33%;
        max-width: 83.33%;
    }

    .table th,
    .table td {
        padding: 1rem;
    }
}

/* ========================================
   16. UTILITY CLASSES FOR MOBILE
   ======================================== */

/* Ensure proper text wrapping on mobile */
@media (max-width: 576px) {
    .text-end {
        text-align: left;
    }

    .gap-2 {
        gap: 0.5rem !important;
    }

    .fw-bold {
        font-weight: 600 !important;
    }

    .small {
        font-size: 0.8rem !important;
    }
}

/* ========================================
   17. PAYMENT METHOD CARDS STYLING
   ======================================== */

.payment-card {
    border: 2px solid #dee2e6 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    background: #ffffff;
    position: relative;
    border-radius: 12px;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
}

.payment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.payment-card:checked {
    border-color: #00a4b8 !important;
    background-color: #f0f9ff !important;
}

.payment-card input[type="radio"]:checked + .payment-card {
    border-color: #00a4b8 !important;
    background-color: #f0f9ff !important;
}

.payment-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.payment-card-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-align: center;
    display: block;
}

.payment-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 0;
}

/* Payment card color variants */
.payment-card.card-stripe {
    border-color: #667eea;
    background: #f8f9ff;
}

.payment-card.card-stripe:checked {
    border-color: #667eea;
    background: #f0f5ff;
}

.payment-card.card-stripe .payment-badge {
    background: #667eea;
}

.payment-card.card-stripe .payment-card-icon {
    color: #667eea;
}

.payment-card.card-paypal {
    border-color: #003087;
    background: #f0f5ff;
}

.payment-card.card-paypal:checked {
    border-color: #003087;
    background: #f0f5ff;
}

.payment-card.card-paypal .payment-badge {
    background: #003087;
}

.payment-card.card-paypal .payment-card-icon {
    color: #003087;
}

.payment-card.card-eway {
    border-color: #15ADA8;
    background: #f0fffe;
}

.payment-card.card-eway:checked {
    border-color: #15ADA8;
    background: #f0fffe;
}

.payment-card.card-eway .payment-badge {
    background: #15ADA8;
}

.payment-card.card-eway .payment-card-icon {
    color: #15ADA8;
}

.payment-card.card-bank {
    border-color: #28a745;
    background: #f0fff4;
}

.payment-card.card-bank:checked {
    border-color: #28a745;
    background: #f0fff4;
}

.payment-card.card-bank .payment-badge {
    background: #28a745;
}

.payment-card.card-bank .payment-card-icon {
    color: #28a745;
}

/* Mobile payment cards */
@media (max-width: 768px) {
    .payment-card {
        padding: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }

    .payment-badge {
        width: 28px;
        height: 28px;
        font-size: 1rem;
        top: -6px;
        right: -6px;
    }

    .payment-card-icon {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
    }

    .payment-card-title {
        font-size: 0.9rem;
    }
}

/* ========================================
   18. INFO BOX STYLING
   ======================================== */

.info-box {
    background: #fafbfc;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.info-box h6 {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.info-box p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Mobile info box */
@media (max-width: 768px) {
    .info-box {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .info-box h6 {
        font-size: 0.95rem;
    }

    .info-box p {
        font-size: 0.9rem;
    }
}

/* ========================================
   19. SPINNER & LOADING STATES
   ======================================== */

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* ========================================
   20. TEXT SIZE UTILITIES
   ======================================== */

.text-lg {
    font-size: 1.25rem;
    font-weight: 600;
}

.text-md {
    font-size: 1.1rem;
}

.text-sm {
    font-size: 0.9rem;
}

/* Mobile text utilities */
@media (max-width: 768px) {
    .text-lg {
        font-size: 1.1rem;
    }

    .text-md {
        font-size: 1rem;
    }

    .text-sm {
        font-size: 0.85rem;
    }
}

/* Print styles */
@media print {
    .btn,
    .btn-group,
    .card-header,
    .course-alert-icon {
        display: none;
    }

    .table {
        border-collapse: collapse;
    }

    .badge {
        border: 1px solid #000;
        background-color: transparent !important;
        color: #000 !important;
    }
}
