/* Programs Page Styles - Scoped to avoid conflicts */
.programs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.programs-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.programs-container .programs-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.programs-container .programs-description {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Grid Layout */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Program Cards */
.program-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Removed hover animations for professional look */

.program-card .card-header {
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.program-card .card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.program-card .card-age {
    font-size: 1rem;
    font-weight: 500;
    color: #28a745;
    margin: 0;
    padding: 0.25rem 0.75rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 15px;
    display: inline-block;
}

.program-card .card-age.highlight {
    color: #28a745;
    font-style: italic;
    font-size: 0.95rem;
    background: rgba(40, 167, 69, 0.15);
}

.program-card .card-body {
    padding: 0.75rem 1rem;
    flex-grow: 1;
}

.program-card .card-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

.program-card .card-footer {
    padding: 0.75rem 1rem 1rem;
    margin-top: auto;
}

/* Use Moodle's default button styles but scoped */
.programs-container .apply-btn {
    width: 100%;
    text-align: center;
    padding: 0.5rem 1rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .programs-container {
        padding: 1.5rem 1rem;
    }

    .programs-container .programs-title {
        font-size: 2rem;
    }

    .programs-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .program-card .card-title {
        font-size: 1.3rem;
    }

    .program-card .card-description {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .programs-container {
        padding: 1rem 0.75rem;
    }

    .programs-container .programs-title {
        font-size: 1.75rem;
    }

    .program-card .card-header {
        padding: 1.25rem 1.25rem 0.75rem;
    }

    .program-card .card-body {
        padding: 0.75rem 1.25rem;
    }

    .program-card .card-footer {
        padding: 0.75rem 1.25rem 1.25rem;
    }

    /* Responsive styles for course program cards */
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .courses-grid .program-card {
        padding: 1rem;
    }

    .courses-grid .program-card .course-title {
        font-size: 1.1rem;
    }

    .courses-grid .program-card .course-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .courses-grid .program-card .course-actions .btn {
        margin: 0;
    }
}

/* Course Count */
.course-count {
    font-size: 0.85rem;
    color: #666;
    margin: 0.5rem 0 0 0;
    font-style: italic;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    margin-bottom: 1rem;
}

.breadcrumb-link {
    color: #4ecdc4;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: #44a08d;
    text-decoration: none;
}

.course-count-info {
    font-size: 1rem;
    color: #7fb069;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Course Listing Styles - Using program-card to avoid Moodle conflicts */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

/* Updated program-card styles for course listings */
.courses-grid .program-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    margin-bottom: 0;
}

/* Specific spacing for cards in courses-grid */
.courses-grid .program-card .card-header {
    padding: 0.5rem 0 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0.5rem;
}

.courses-grid .program-card .card-body {
    padding: 0.5rem 0;
    flex-grow: 1;
}

.courses-grid .program-card .card-footer {
    padding: 0.5rem 0 0 0;
    margin-top: auto;
}

/* Removed hover animations for professional look */

.course-image {
    height: 180px;
    overflow: hidden;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Course content within program cards */
.courses-grid .program-card .course-content {
    padding: 0; /* Remove extra padding since parent has padding */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.course-header {
    margin-bottom: 1rem;
}

/* Course title within program cards */
.courses-grid .program-card .course-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.course-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.course-title a:hover {
    color: #4ecdc4;
    text-decoration: none;
}

/* Course code within program cards */
.courses-grid .program-card .course-code {
    font-size: 0.85rem;
    color: #7fb069;
    font-weight: 500;
    margin: 0 0 1rem 0;
    background: rgba(127, 176, 105, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
}

/* Course body within program cards */
.courses-grid .program-card .course-body {
    flex-grow: 1;
    margin-bottom: 1rem;
}

/* Course summary within program cards */
.courses-grid .program-card .course-summary {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Course meta within program cards */
.courses-grid .program-card .course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

.courses-grid .program-card .enrollment-count,
.courses-grid .program-card .start-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Course actions within program cards */
.courses-grid .program-card .course-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto; /* Push to bottom of card */
}

/* Button styles within program cards */
.courses-grid .program-card .course-actions .btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin: 0 0.25rem;
    border-radius: 6px;
}

/* No Courses State */
.no-courses {
    text-align: center;
    padding: 3rem 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 2rem;
}

.no-courses-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-courses h3 {
    color: #333;
    margin-bottom: 1rem;
}

.no-courses p {
    color: #666;
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile Responsiveness for Course Listing */
@media (max-width: 768px) {
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .course-actions {
        flex-direction: column;
    }

    .course-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .course-content {
        padding: 1rem;
    }

    .course-image {
        height: 150px;
    }
}

/* Transfer System Styles - Scoped to avoid conflicts */
.programs-container .enrolled-badge {
    background: #28a745;
    color: white;
    cursor: default;
    border: none;
}

.programs-container .transfer-pending {
    background: #ffc107;
    color: #212529;
    cursor: default;
    border: none;
}

.enrollment-notice {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(108, 117, 125, 0.1);
    border-radius: 6px;
    text-align: center;
}

.transfer-form-container {
    max-width: 600px;
    margin: 2rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.transfer-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.transfer-info p {
    margin: 0.5rem 0;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #666;
}

/* Alert styles */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert h4,
.alert h5 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.alert ul {
    margin-bottom: 0;
}

.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-warning {
    color: #212529;
    background-color: #ffc107;
}

/* Using Moodle's native icon system */
.course-meta .icon {
    margin-right: 0.25rem;
    vertical-align: middle;
}

.enrollment-notice .icon {
    margin-right: 0.25rem;
}

.enrolled-badge .icon,
.transfer-pending .icon {
    margin-right: 0.25rem;
}

/* Enrollment Management Styles */
.enrollment-management {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.enrollment-management .card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.enrollment-management .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1.25rem;
    color: #333;
}

.enrollment-management .table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.enrollment-management .table th,
.enrollment-management .table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

.enrollment-management .table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background: #f8f9fa;
    font-weight: 600;
}

.enrollment-management .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.05);
}

.enrollment-management .badge-success {
    color: #fff;
    background-color: #28a745;
}

.enrollment-management .badge-danger {
    color: #fff;
    background-color: #dc3545;
}

.enrollment-management .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.enrollment-management .btn-warning {
    color: #212529;
    background-color: #ffc107;
    border-color: #ffc107;
}

.enrollment-management .btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

/* Responsive Table */
@media (max-width: 768px) {
    .enrollment-management {
        padding: 1rem 0.5rem;
    }

    .enrollment-management .table {
        font-size: 0.875rem;
    }

    .enrollment-management .table th,
    .enrollment-management .table td {
        padding: 0.5rem 0.25rem;
    }

    .enrollment-management .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .enrollment-management .table {
        font-size: 0.8rem;
    }

    .enrollment-management .table th,
    .enrollment-management .table td {
        padding: 0.4rem 0.2rem;
    }

    .enrollment-management .card-header {
        padding: 0.75rem 1rem;
        font-size: 1.1rem;
    }

    .enrollment-management .btn-sm {
        padding: 0.15rem 0.3rem;
        font-size: 0.75rem;
    }
}

/* Course Listing Page Specific Styles */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.course-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

/* Removed hover animations for professional look */

.course-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.course-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.course-title a:hover {
    color: #4ecdc4;
    text-decoration: none;
}

.course-code {
    font-size: 0.85rem;
    color: #7fb069;
    font-weight: 500;
    margin: 0 0 1rem 0;
    background: rgba(127, 176, 105, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
}

.course-summary {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

.enrollment-count,
.start-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.course-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.courses-grid .course-actions .btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin: 0 0.25rem;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.courses-grid .course-actions .btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

/* Button Styles - Professional solid colors */
.btn-primary {
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
}

.btn-primary:hover {
    background: #0056b3;
    color: white;
    border-color: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
    color: white;
    border-color: #545b62;
}

.btn-info {
    background: #17a2b8;
    color: white;
    border: 1px solid #17a2b8;
}

.btn-info:hover {
    background: #138496;
    color: white;
    border-color: #138496;
}

.btn-success {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.btn-success:hover {
    background: #1e7e34;
    color: white;
    border-color: #1e7e34;
}

.btn-secondary[disabled] {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary[disabled]:hover {
    transform: none;
    box-shadow: none;
}

/* Mobile Responsiveness for Course Listing */
@media (max-width: 768px) {
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .course-actions {
        flex-direction: column;
    }

    .course-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .course-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .course-card {
        padding: 0.75rem;
    }

    .course-title {
        font-size: 1.1rem;
    }

    .course-meta {
        font-size: 0.8rem;
    }
}

/* Back button styling */
.mb-3 {
    margin-bottom: 1rem;
}

.btn-secondary.mb-3 {
    background: #6c757d;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.btn-secondary.mb-3:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

/* New Batch Tiles Design */
.batch-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.15rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.batch-tile {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
    padding: 1.15rem;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.batch-tile-language {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.3px;
}

.batch-tile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    text-align: center;
    margin-top: 0.35rem;
}

.batch-tile-day {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 0.4rem 0;
    line-height: 1.1;
    text-transform: capitalize;
}

.batch-tile-time {
    font-size: 0.9rem;
    font-weight: 300;
    margin: 0.2rem 0;
    opacity: 0.95;
    letter-spacing: 0.2px;
}

.batch-tile-teacher {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.6rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.batch-tile-date {
    font-size: 1.65rem;
    font-weight: 300;
    text-align: left;
    margin-top: auto;
    opacity: 0.9;
}

.batch-tile-status {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.batch-tile-status.enrolled {
    background: #2196F3;
    color: white;
}

.batch-tile-status.already-enrolled {
    background: rgba(255, 255, 255, 0.9);
    color: #666;
}

/* Responsive Design for Batch Tiles */
@media (max-width: 1200px) {
    .batch-tiles-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .batch-tile-day {
        font-size: 1.4rem;
    }
    
    .batch-tile-time {
        font-size: 0.85rem;
    }
    
    .batch-tile-date {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .batch-tiles-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.9rem;
    }
    
    .batch-tile {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .batch-tile-language {
        font-size: 0.8rem;
        top: 0.85rem;
        right: 0.85rem;
    }
    
    .batch-tile-day {
        font-size: 1.3rem;
    }
    
    .batch-tile-time {
        font-size: 0.8rem;
    }
    
    .batch-tile-teacher {
        font-size: 0.75rem;
        padding: 0.35rem 0.85rem;
        margin-top: 0.5rem;
    }
    
    .batch-tile-date {
        font-size: 1.4rem;
    }
    
    .batch-tile-status {
        font-size: 0.68rem;
        padding: 0.32rem 0.68rem;
    }
}

@media (max-width: 480px) {
    .batch-tiles-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .batch-tile {
        padding: 0.85rem;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .batch-tile-language {
        font-size: 0.7rem;
        top: 0.7rem;
        right: 0.7rem;
    }
    
    .batch-tile-day {
        font-size: 1.05rem;
        margin-bottom: 0.3rem;
    }
    
    .batch-tile-time {
        font-size: 0.7rem;
        margin: 0.15rem 0;
    }
    
    .batch-tile-teacher {
        font-size: 0.65rem;
        padding: 0.28rem 0.7rem;
        margin-top: 0.4rem;
    }
    
    .batch-tile-date {
        font-size: 1.15rem;
    }
    
    .batch-tile-status {
        font-size: 0.6rem;
        padding: 0.28rem 0.6rem;
        top: 0.65rem;
        left: 0.65rem;
    }
}

/* Responsive heading for mobile */
@media (max-width: 768px) {
    h2.mb-4 {
        font-size: 1.3rem;
        line-height: 1.3;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    h2.mb-4 {
        font-size: 1.15rem;
        line-height: 1.3;
        margin-bottom: 1.2rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 380px) {
    h2.mb-4 {
        font-size: 1.05rem;
        line-height: 1.3;
        margin-bottom: 1rem;
        word-break: break-word;
    }
    
    .batch-tiles-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.65rem;
    }
    
    .batch-tile {
        padding: 0.75rem;
        border-radius: 10px;
    }
    
    .batch-tile-language {
        font-size: 0.65rem;
        top: 0.6rem;
        right: 0.6rem;
    }
    
    .batch-tile-content {
        margin-top: 0.25rem;
    }
    
    .batch-tile-day {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
        line-height: 1;
    }
    
    .batch-tile-time {
        font-size: 0.65rem;
        margin: 0.1rem 0;
        line-height: 1.2;
    }
    
    .batch-tile-teacher {
        font-size: 0.6rem;
        padding: 0.25rem 0.6rem;
        margin-top: 0.35rem;
    }
    
    .batch-tile-date {
        font-size: 1.05rem;
    }
    
    .batch-tile-status {
        font-size: 0.55rem;
        padding: 0.25rem 0.55rem;
        top: 0.6rem;
        left: 0.6rem;
    }
}
