/* Modern Tuition Discounts Styles */
.tuition-discounts-wrapper {
    padding: 2rem 0;
}

/* Discount Cards */
.discount-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-width: 2px !important;
    overflow: hidden;
    position: relative;
}

.discount-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.discount-card .card-header {
    font-weight: 600;
    padding: 1rem;
    border-bottom: none;
}

/* Best Discount Highlighting */
.discount-card.best-discount {
    border-width: 3px !important;
    border-color: #ffc107 !important;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.3) !important;
    transform: scale(1.02);
}

.discount-card.best-discount:hover {
    transform: scale(1.05) translateY(-5px);
}

/* Ribbon for Best Value */
.ribbon-wrapper {
    position: absolute;
    top: 10px;
    right: -35px;
    width: 120px;
    height: 120px;
    overflow: hidden;
    z-index: 10;
}

.ribbon {
    position: absolute;
    top: 20px;
    right: -25px;
    width: 150px;
    padding: 8px 0;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #fff;
    font-weight: bold;
    font-size: 0.8rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: rotate(45deg);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Gradient backgrounds for urgency headers */
.bg-gradient-danger {
    background: linear-gradient(135deg, #f44336 0%, #e91e63 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ff9800 0%, #ffc107 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #2196f3 0%, #03a9f4 100%);
}

/* Active Discounts Section */
.active-discounts-section h3 {
    font-weight: 600;
    color: #333;
}

.active-discounts-section .fas.fa-fire {
    animation: flame 1.5s ease-in-out infinite;
}

/* Center discount cards on larger screens */
.active-discounts-section .row {
    justify-content: center;
}

@media (min-width: 992px) {
    .active-discounts-section .col-lg-4 {
        max-width: 350px;
    }
}

/* Student Subject Cards */
.student-subject-cards {
    margin-bottom: 2rem;
}

.student-subject-cards .card {
    transition: transform 0.2s ease;
    border: none;
}

.student-subject-cards .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Ensure minimum 2 cards per row on smallest screens */
@media (max-width: 575px) {
    .student-subject-cards .col-6 {
        max-width: 50%;
        flex: 0 0 50%;
    }
}

@keyframes flame {
    0%, 100% {
        transform: scale(1) rotate(-5deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

/* Upcoming Discounts Section */
.upcoming-discounts-section .card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Regular Prices Table */
.regular-prices-section .table {
    border: none;
}

.regular-prices-section .thead-dark {
    background: linear-gradient(135deg, #11733a 0%, #57b846 100%);
}

.regular-prices-section .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(17, 115, 58, 0.05);
}

.regular-prices-section .table-hover tbody tr:hover {
    background-color: rgba(17, 115, 58, 0.1);
    cursor: default;
}

/* CTA Section */
.tuition-discounts-wrapper .bg-primary {
    background: linear-gradient(135deg, #11733a 0%, #57b846 100%) !important;
    border: none;
}

/* Alert Styles */
.tuition-discounts-wrapper .alert {
    border-radius: 10px;
    border: none;
}

.tuition-discounts-wrapper .alert-danger {
    background-color: #ffebee;
    color: #c62828;
}

.tuition-discounts-wrapper .alert-warning {
    background-color: #fff3e0;
    color: #e65100;
}

.tuition-discounts-wrapper .alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.tuition-discounts-wrapper .alert-info {
    background-color: #e1f5fe;
    color: #0277bd;
}

/* Typography Enhancements */
.tuition-discounts-wrapper h1.display-4 {
    font-weight: 700;
    background: linear-gradient(135deg, #11733a 0%, #57b846 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tuition-discounts-wrapper h3 {
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.tuition-discounts-wrapper h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #11733a 0%, #57b846 100%);
    border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 991px) {
    .tuition-discounts-wrapper .display-4 {
        font-size: 2.5rem;
    }

    .discount-card {
        margin-bottom: 1.5rem;
    }

    .tuition-discounts-wrapper h3 {
        font-size: 1.5rem;
    }

    /* Make table more compact on tablets */
    .regular-prices-section .table th,
    .regular-prices-section .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .tuition-discounts-wrapper {
        padding: 1rem 0;
    }

    .tuition-discounts-wrapper .display-4 {
        font-size: 2rem;
    }

    .tuition-discounts-wrapper .card-body.p-5 {
        padding: 2rem !important;
    }

    /* Target both class combinations */
    .regular-prices-section .table,
    .tuition-prices-table {
        font-size: 0.7rem !important;
    }

    /* More aggressive mobile optimization */
    .regular-prices-section .table th,
    .regular-prices-section .table td,
    .tuition-prices-table th,
    .tuition-prices-table td {
        padding: 0.4rem 0.2rem !important;
        font-size: 0.7rem !important;
    }

    /* Make headers more compact */
    .regular-prices-section .table th,
    .tuition-prices-table th {
        white-space: normal !important;
        font-size: 0.65rem !important;
        line-height: 1.2 !important;
    }

    /* Hide line breaks in headers on mobile */
    .regular-prices-section .table th br,
    .tuition-prices-table th br {
        display: none;
    }

    /* Stack the strikethrough text */
    .regular-prices-section .table .small,
    .tuition-prices-table .small {
        font-size: 0.6rem !important;
        display: block !important;
    }

    /* Make price text smaller */
    .regular-prices-section .table .font-weight-bold,
    .tuition-prices-table .font-weight-bold {
        font-size: 0.75rem !important;
    }

    .discount-card .card-body {
        padding: 1rem;
    }

    /* Reduce card padding on mobile */
    .regular-prices-section .card-body {
        padding: 0.5rem !important;
    }
}

/* Extra small devices (phones < 400px) */
@media (max-width: 400px) {
    .tuition-prices-table th,
    .tuition-prices-table td {
        padding: 0.3rem 0.1rem !important;
        font-size: 0.65rem !important;
    }

    .tuition-prices-table th {
        font-size: 0.6rem !important;
    }

    .tuition-prices-table .small {
        font-size: 0.55rem !important;
    }

    /* Hide the word "Students" on very small screens */
    @media (max-width: 350px) {
        .tuition-prices-table td:first-child {
            font-size: 0.6rem !important;
        }
    }
}

/* Loading State */
.tuition-discounts-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.tuition-discounts-loading .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #11733a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.no-discounts-message {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.no-discounts-message i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Badge Enhancements */
.discount-card .badge {
    font-weight: 600;
    padding: 0.5em 0.75em;
    font-size: 0.875rem;
}

/* List Styles */
.discount-card ul.list-unstyled li {
    padding: 0.25rem 0;
    color: #495057;
}

.discount-card ul.list-unstyled li i {
    width: 20px;
    text-align: center;
}

/* Table Enhancement */
.regular-prices-section .table td,
.regular-prices-section .table th {
    vertical-align: middle;
    padding: 1rem;
}

.regular-prices-section .table th {
    border-top: none;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* Button Styles */
.btn-light {
    background-color: #ffffff;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-light:hover {
    background-color: #f8f9fa;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Print Styles */
@media print {
    .tuition-discounts-wrapper {
        page-break-inside: avoid;
    }
    
    .discount-card {
        page-break-inside: avoid;
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
    
    .bg-gradient-danger,
    .bg-gradient-warning,
    .bg-gradient-success,
    .bg-gradient-info {
        background: #f8f9fa !important;
        color: #333 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}