/**
 * STUDENT POST TYPE STYLES
 * Similar to Team styling but tailored for students
 */

/* =====================================================
   Single Student Page Layout
   ===================================================== */

.single-student {
    .site-main {
        .site-content-fluid {
            padding: 0;
        }
    }
}

article.post-student {
    .single-content {
        > .row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 60px;
            align-items: start;

            @media (max-width: 768px) {
                grid-template-columns: 1fr;
                gap: 40px;
            }
        }
    }
}

/* Left Column - Images */
.student-wrap-left {
    .col-inner {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    figure {
        margin: 0;
        overflow: hidden;
        background: #f5f5f5;

        img {
            display: block;
            width: 100%;
            height: auto;
            transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }

        &:hover {
            img {
                transform: scale(1.05);
            }
        }
    }

    .student-solo-image {
        img {
            aspect-ratio: 3 / 4;
            object-fit: cover;
        }
    }

    .student-family-image {
        img {
            aspect-ratio: 16 / 9;
            object-fit: cover;
        }
    }

    .student-family-image-wrapper {
        position: relative;
        overflow: hidden;

        .student-family-label {
            position: absolute;
            top: 10px;
            right: 10px;
            background: rgba(0, 0, 0, 0.6);
            color: white;
            padding: 6px 12px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        &:hover {
            .student-family-label {
                opacity: 1;
            }
        }
    }
}

/* Right Column - Information */
.student-wrap-right {
    .col-inner {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    .entry-header {
        margin-bottom: 0;

        .entry-title {
            font-size: 36px;
            font-weight: 700;
            line-height: 1.2;
            margin: 0 0 15px 0;

            @media (max-width: 768px) {
                font-size: 28px;
            }
        }
    }
}

/* Meta Information */
.student-meta-top {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;

    .student-grade-year {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;

        span {
            padding: 5px 12px;
            background: #f0f0f0;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
    }

    .student-country-badge {
        padding: 6px 14px;
        background: #007bff;
        color: white;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}

/* Bio Section */
.student-bio {
    font-size: 15px;
    line-height: 1.8;
    color: #555;

    p {
        margin: 0 0 10px 0;

        &:last-child {
            margin-bottom: 0;
        }
    }
}

/* Information Wrapper */
.student_info_wrapper {
    padding: 20px 0;
    border: 1px solid #eee;
    border-left: 3px solid #007bff;
    padding-left: 20px;
    margin: 20px 0;

    .student-personal-info {
        display: grid;
        gap: 15px;
    }

    .student-info-item {
        display: grid;
        gap: 8px;

        strong {
            font-size: 14px;
            font-weight: 600;
            color: #333;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        p {
            margin: 0;
            font-size: 15px;
            color: #666;
            line-height: 1.6;
        }
    }
}

/* Student Sections */
.student-section {
    padding: 30px 0;
    border-bottom: 1px solid #eee;

    &:last-child {
        border-bottom: none;
    }

    .student-section-title {
        font-size: 22px;
        font-weight: 700;
        margin: 0 0 20px 0;
        color: #333;
        text-transform: uppercase;
        letter-spacing: 1px;
        position: relative;
        padding-bottom: 15px;

        &::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 40px;
            height: 3px;
            background: #007bff;
        }
    }

    .student-section-content {
        font-size: 15px;
        line-height: 1.8;
        color: #555;

        p {
            margin: 0 0 15px 0;

            &:last-child {
                margin-bottom: 0;
            }
        }

        ul,
        ol {
            margin: 0 0 15px 20px;
            padding: 0;

            li {
                margin-bottom: 8px;
                line-height: 1.8;
            }
        }

        strong {
            font-weight: 600;
            color: #333;
        }

        em {
            font-style: italic;
            color: #777;
        }
    }
}

/* Video Testimonial */
.student-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: 8px;

    iframe,
    embed,
    video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 8px;
    }
}

/* Universities Table */
.student-universities-section {
    width: 100%;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #eee;
}

.student-universities-wrapper {
    overflow-x: auto;

    .student-universities-table {
        width: 100%;
        border-collapse: collapse;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border-radius: 8px;
        overflow: hidden;

        thead {
            background: #f8f9fa;
            border-bottom: 2px solid #dee2e6;

            tr {
                &:hover {
                    background: #f8f9fa;
                }
            }

            th {
                padding: 16px;
                font-size: 12px;
                font-weight: 700;
                text-transform: uppercase;
                letter-spacing: 0.5px;
                color: #333;
                text-align: left;
                border-right: 1px solid #dee2e6;

                &:last-child {
                    border-right: none;
                }
            }
        }

        tbody {
            tr {
                border-bottom: 1px solid #dee2e6;
                transition: background 0.3s ease;

                &:hover {
                    background: #f8f9fa;
                }

                &:last-child {
                    border-bottom: none;
                }

                td {
                    padding: 14px 16px;
                    font-size: 14px;
                    color: #666;
                    vertical-align: middle;
                    border-right: 1px solid #dee2e6;

                    &:last-child {
                        border-right: none;
                    }

                    &.university-name {
                        font-weight: 600;
                        color: #333;
                    }

                    &.university-status {
                        font-weight: 600;
                        text-transform: uppercase;
                        font-size: 12px;
                        padding: 8px 12px;
                        border-radius: 4px;
                        display: inline-block;

                        &.status-accepted {
                            background: #d4edda;
                            color: #155724;
                        }

                        &.status-rejected {
                            background: #f8d7da;
                            color: #721c24;
                        }

                        &.status-pending {
                            background: #fff3cd;
                            color: #856404;
                        }

                        &.status-waitlist {
                            background: #d1ecf1;
                            color: #0c5460;
                        }
                    }

                    &.university-amount {
                        font-weight: 600;
                        color: #28a745;
                    }

                    &.university-percentage {
                        font-weight: 600;
                        color: #007bff;
                    }
                }
            }
        }
    }
}

/* =====================================================
   Student Loop / Grid View
   ===================================================== */

.student-block {
    background: white;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;

    &:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
}

.student-transition {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #f7f8fa;

    img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
        transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }

    &:hover {
        img {
            transform: scale(1.08);
        }
    }
}

.student-content {
    padding: 20px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.student-caption {
    margin-bottom: 15px;
    flex: 1;

    .student-loop-title {
        margin: 0 0 10px 0;
        font-size: 18px;
        font-weight: 700;
        line-height: 1.3;

        a {
            color: #333;
            text-decoration: none;
            transition: color 0.3s ease;

            &:hover {
                color: #007bff;
            }
        }
    }

    .student-grade-year {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;

        span {
            padding: 4px 10px;
            background: #f0f0f0;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            color: #666;
        }
    }
}

.student-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;

    .student-button {
        flex: 1;

        a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 10px 15px;
            background: #007bff;
            color: white;
            text-decoration: none;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            transition: all 0.3s ease;

            &:hover {
                background: #0056b3;
                transform: translateY(-2px);
                box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
            }

            &.more-link {
                width: 100%;
            }

            i {
                margin-left: 6px;
                font-size: 12px;
            }
        }
    }
}

/* Style 1: Actions on Hover Below */
/* Style 2: Actions Overlay on Image */
.template-student-block-style-2 {
    .student-transition {
        position: relative;

        .student-actions {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 20px;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
            display: flex;
            gap: 10px;
            opacity: 1;
            transform: translateY(0);
            transition: all 0.4s ease;
        }

        .student-button {
            a {
                background: white;
                color: #007bff;
                flex: 1;
                padding: 12px 15px;

                &:hover {
                    background: #007bff;
                    color: white;
                }
            }
        }
    }

    .student-content {
        .student-caption {
            margin-bottom: 0;
        }
    }
}

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 768px) {
    article.post-student {
        .single-content {
            > .row {
                gap: 30px;
            }
        }
    }

    .student-wrap-right {
        .col-inner {
            gap: 20px;
        }

        .entry-header {
            .entry-title {
                font-size: 24px;
            }
        }
    }

    .student_info_wrapper {
        padding: 15px 0 15px 15px;
    }

    .student-universities-wrapper {
        .student-universities-table {
            font-size: 13px;

            thead th,
            tbody td {
                padding: 12px 10px;
            }
        }
    }

    .student-block {
        .student-transition {
            aspect-ratio: 4 / 5;
            min-height: 260px;
        }

        .student-content {
            padding: 15px;
        }
    }
}

@media (max-width: 480px) {
    .student-transition {
        min-height: 220px;
    }

    .student_info_wrapper {
        border: none;
        border-top: 2px solid #007bff;
        padding: 15px 0 0 0;
    }

    .student-universities-wrapper {
        .student-universities-table {
            thead {
                display: none;
            }

            tbody {
                tr {
                    display: block;
                    border: 1px solid #dee2e6;
                    border-radius: 6px;
                    margin-bottom: 15px;
                    padding: 10px;

                    td {
                        display: block;
                        padding: 8px 0;
                        border: none;
                        border-right: none;
                        text-align: left;

                        &::before {
                            content: attr(data-label);
                            font-weight: 700;
                            color: #333;
                            display: block;
                            margin-bottom: 5px;
                            font-size: 12px;
                            text-transform: uppercase;
                        }
                    }
                }
            }
        }
    }
}

/* =====================================================
   Pathway Filter Tabs
   ===================================================== */

.student-pathway-filter {
    margin: 0 0 30px 0;
    padding: 18px 0;
    border-bottom: 2px solid #f0f0f0;
    background: #fff;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    left: 0;
    right: 0;
    z-index: 5;
}

.student-pathway-filter .filter-tabs {
    display: flex !important;
    gap: 12px;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: calc(100% - 40px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    white-space: nowrap;
}

.student-pathway-filter .filter-tabs::-webkit-scrollbar {
    height: 6px;
}

.student-pathway-filter .filter-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.student-pathway-filter .filter-tabs::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: 6px;
}

.student-pathway-filter .filter-tab {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 10px 20px;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.student-pathway-filter .filter-tab:hover {
    background-color: #e8e8e8;
    transform: translateY(-2px);
}

.student-pathway-filter .filter-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Pathway Sections for Single Page */
.student-pathway-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e0e0e0;

    &:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .pathway-section-header {
        margin-bottom: 30px;
        padding-bottom: 15px;
        border-bottom: 3px solid #667eea;

        h2 {
            margin: 0;
            color: #333;
            font-size: 24px;
            font-weight: 700;
        }
    }

        .pathway-students-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;

        @media (max-width: 1024px) {
            grid-template-columns: repeat(2, 1fr);
            gap: 18px;
        }

        @media (max-width: 768px) {
            grid-template-columns: repeat(1, 1fr);
            gap: 15px;
        }
    }
}

/* Force student lists into responsive multi-column grid (fallback if template markup differs) */
.pathway-students-list,
.students-list,
.student-list,
.antra-students ul,
ul.pathway-students-list,
ul.students-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pathway-students-list li,
.students-list li,
.student-list li,
.antra-students ul li,
ul.pathway-students-list li,
ul.students-list li {
    display: block !important;
    margin: 0 !important;
}

@media (max-width: 1400px) {
    .pathway-students-list,
    .students-list,
    .student-list,
    ul.pathway-students-list,
    ul.students-list {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px !important;
    }
}

@media (max-width: 1024px) {
    .pathway-students-list,
    .students-list,
    .student-list,
    ul.pathway-students-list,
    ul.students-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

@media (max-width: 768px) {
    .pathway-students-list,
    .students-list,
    .student-list,
    ul.pathway-students-list,
    ul.students-list {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 14px !important;
    }
}


/* =====================================================
   Total Scholarship Display
   ===================================================== */

.student-total-scholarship {
    margin: 20px 0;

    .scholarship-highlight {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 16px 20px;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        gap: 15px;

        @media (max-width: 768px) {
            flex-direction: column;
            text-align: center;
        }

        .scholarship-label {
            font-size: 14px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            opacity: 0.95;
        }

        .scholarship-amount {
            font-size: 24px;
            font-weight: 700;
            white-space: nowrap;
        }
    }
}

/* =====================================================
   Scholarship Summary (Below Universities)
   ===================================================== */

.student-scholarship-summary {
    margin-top: 40px;
    margin-bottom: 20px;

    .scholarship-summary-box {
        background: #f8f9fa;
        border: 2px solid #667eea;
        border-radius: 8px;
        padding: 20px;

        h4 {
            margin: 0 0 15px 0;
            color: #333;
            font-size: 16px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .scholarship-total {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 15px;

            @media (max-width: 768px) {
                flex-direction: column;
                text-align: center;
            }

            .summary-label {
                font-size: 14px;
                font-weight: 600;
                color: #666;
            }

            .summary-amount {
                font-size: 20px;
                font-weight: 700;
                color: #667eea;
            }
        }
    }
}

/* =====================================================
   Respect Elementor column classes
   The widget outputs a wrapper with class `antra-student-columns-{n}`
   These rules let Elementor control columns via that class.
   ===================================================== */

.antra-student-columns-1 .antra-student.antra-list-wrapper,
.antra-student-columns-1 ul.antra-student.antra-list-wrapper {
    display: grid !important;
    grid-template-columns: repeat(1, 1fr) !important;
    gap: 14px !important;
}

.antra-student-columns-2 .antra-student.antra-list-wrapper,
.antra-student-columns-2 ul.antra-student.antra-list-wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px !important;
}

.antra-student-columns-3 .antra-student.antra-list-wrapper,
.antra-student-columns-3 ul.antra-student.antra-list-wrapper {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
}

.antra-student-columns-4 .antra-student.antra-list-wrapper,
.antra-student-columns-4 ul.antra-student.antra-list-wrapper,
.antra-student-columns-5 .antra-student.antra-list-wrapper,
.antra-student-columns-5 ul.antra-student.antra-list-wrapper {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px !important;
}

/* Allow the list items and blocks to size to grid cells */
.antra-student.antra-list-wrapper > li,
.antra-student.antra-list-wrapper > li .student-block,
ul.antra-student.antra-list-wrapper > li,
ul.antra-student.antra-list-wrapper > li .student-block {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* Fallback: if no column class present use 3 columns */
.antra-student.antra-list-wrapper:not([class*="columns-"]) {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
}

/* Extra broad selectors to catch Elementor's different column class names */
[class*="antra-student-columns-"] .antra-student.antra-list-wrapper,
[class*="antra-student-columns-"] ul.antra-student.antra-list-wrapper,
[class*="columns-"] .antra-student.antra-list-wrapper,
[class*="columns-"] ul.antra-student.antra-list-wrapper,
.elementor-widget-antra-students .antra-student.antra-list-wrapper,
.elementor-widget-antra-students ul.antra-student.antra-list-wrapper {
    display: grid !important;
}

/* Make the broad selector responsive by using media queries */
@media (min-width: 1401px) {
    [class*="antra-student-columns-"] .antra-student.antra-list-wrapper { grid-template-columns: repeat(4,1fr) !important; gap:24px !important; }
}
@media (max-width: 1400px) {
    [class*="antra-student-columns-"] .antra-student.antra-list-wrapper { grid-template-columns: repeat(3,1fr) !important; gap:20px !important; }
}
@media (max-width: 1024px) {
    [class*="antra-student-columns-"] .antra-student.antra-list-wrapper { grid-template-columns: repeat(2,1fr) !important; gap:18px !important; }
}
@media (max-width: 768px) {
    [class*="antra-student-columns-"] .antra-student.antra-list-wrapper { grid-template-columns: repeat(1,1fr) !important; gap:14px !important; }
}

/* =====================================================
   Our Students - hard overrides (plain CSS)
   ===================================================== */
.antra-student.antra-list-wrapper > li,
ul.antra-student.antra-list-wrapper > li {
    height: 100% !important;
}

.antra-student.antra-list-wrapper > li .student-block,
ul.antra-student.antra-list-wrapper > li .student-block {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #fff !important;
}

.antra-student.antra-list-wrapper > li .student-transition,
ul.antra-student.antra-list-wrapper > li .student-transition {
    aspect-ratio: 4 / 5 !important;
    min-height: 260px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f3f4f6 !important;
}

.antra-student.antra-list-wrapper > li .student-transition img,
ul.antra-student.antra-list-wrapper > li .student-transition img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}

.antra-student.antra-list-wrapper > li .student-content,
ul.antra-student.antra-list-wrapper > li .student-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex: 1 1 auto !important;
    padding: 18px !important;
    gap: 14px !important;
}

.antra-student.antra-list-wrapper > li .student-caption,
ul.antra-student.antra-list-wrapper > li .student-caption {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
}

.antra-student.antra-list-wrapper > li .student-actions,
ul.antra-student.antra-list-wrapper > li .student-actions {
    margin-top: 0 !important;
    margin-left: auto !important;
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    flex: 0 0 auto !important;
}

.antra-student.antra-list-wrapper > li .student-button,
ul.antra-student.antra-list-wrapper > li .student-button {
    width: 100% !important;
    display: block !important;
}

.antra-student.antra-list-wrapper > li .student-button a,
ul.antra-student.antra-list-wrapper > li .student-button a {
    width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    white-space: nowrap !important;
    padding: 10px 16px !important;
}

/* Keep style-2 button visible but prevent overlay issues */
.template-student-block-style-2 .student-transition .student-actions {
    position: static !important;
    padding: 10px 12px !important;
    background: transparent !important;
}

@media (max-width: 768px) {
    .antra-student.antra-list-wrapper > li .student-transition,
    ul.antra-student.antra-list-wrapper > li .student-transition {
        min-height: 220px !important;
    }

    .antra-student.antra-list-wrapper > li .student-content,
    ul.antra-student.antra-list-wrapper > li .student-content {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .antra-student.antra-list-wrapper > li .student-actions,
    ul.antra-student.antra-list-wrapper > li .student-actions {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .antra-student.antra-list-wrapper > li .student-button a,
    ul.antra-student.antra-list-wrapper > li .student-button a {
        width: 100% !important;
    }
}
