/**
 * University Styles
 *
 * @package IntHub
 * @since 1.0.0
 */

/* University Card Styles */
.university-card {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.university-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.university-card.hidden {
    display: none;
}

/* Filter Styles */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #004aad;
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.1);
}

/* University Grid */
#universities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    #universities-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* University Info Styles */
.university-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.university-info-item svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* Country Badge */
.country-badge {
    background: #004aad;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Scholarship Count */
.scholarship-count {
    display: flex;
    align-items: center;
    color: #fa3c80;
    font-size: 0.875rem;
    font-weight: 500;
}

.scholarship-count svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.25rem;
}

/* University Single Page Styles */
.university-hero {
    position: relative;
    height: 24rem;
    overflow: hidden;
}

.university-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 74, 173, 0.8), rgba(250, 60, 128, 0.8));
}

.university-hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    color: white;
}

/* Quick Info Sidebar */
.quick-info-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
}

.quick-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.quick-info-item svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #fa3c80;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.quick-info-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.quick-info-value {
    font-weight: 500;
    color: #111827;
}

/* Course List */
.course-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.course-item svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #fa3c80;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Map Container */
.map-container {
    border-radius: 8px;
    overflow: hidden;
}

.map-container iframe {
    width: 100%;
    height: 300px;
    border: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .quick-info-card {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .university-hero {
        height: 20rem;
    }
    
    .university-hero-content h1 {
        font-size: 2rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #004aad;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.no-results svg {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: #004aad;
    color: white;
    border-color: #004aad;
}

.pagination .current {
    background: #004aad;
    color: white;
    border-color: #004aad;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
.university-card:focus-within {
    outline: 2px solid #004aad;
    outline-offset: 2px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: 2px solid #004aad;
    outline-offset: 2px;
}

/* University Tabs Styles */
.university-tabs {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.university-tabs-nav {
    display: flex;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.university-tabs-nav::-webkit-scrollbar {
    display: none;
}

.university-tab-button {
    flex: 1;
    min-width: max-content;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.university-tab-button:hover {
    color: #004aad;
    background: rgba(0, 74, 173, 0.05);
}

.university-tab-button.active {
    color: #004aad;
    background: white;
    font-weight: 600;
}

.university-tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #004aad, #fa3c80);
}

.university-tab-content {
    padding: 2rem;
}

.university-tab-pane {
    display: none;
}

.university-tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab Content Specific Styles */
.tab-section {
    margin-bottom: 2rem;
}

.tab-section:last-child {
    margin-bottom: 0;
}

.tab-section-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #06326e !important;
    margin-bottom: 1rem !important;
    display: flex !important;
    align-items: center !important;
}

.tab-section-title svg {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.5rem;
    color: #fa3c80;
}

.university-tab-pane ol {
    list-style: decimal;
    padding-left: 1.5rem;
}

.university-tab-pane ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.university-tab-pane li {
    margin-bottom: 0.5rem;
}

.university-tab-pane p {
    margin-bottom: 1rem;
}

.university-tab-pane h2,
.university-tab-pane h3,
.university-tab-pane h4,
.university-tab-pane h5,
.university-tab-pane h6 {
    margin-bottom: 1rem;
}

.university-tab-pane blockquote {
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid #e5e7eb;
}

.university-tab-pane img {
    max-width: 100%;
    height: auto;
}

.university-tab-pane iframe {
    width: 100%;
    height: auto;
}

.university-tab-pane .wp-block-embed__wrapper {
    position: relative;
}

.university-tab-pane .wp-block-embed__wrapper:before {
    content: "";
    display: block;
    padding-top: 56.25%;
}

.university-tab-pane .wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.university-tab-pane h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #06326e;
    margin-bottom: 1.5rem;
}

.university-tab-pane h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #06326e;
    margin-bottom: 1rem;
}

.university-tab-pane h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #06326e;
    margin-bottom: 0.75rem;
}

.university-tab-pane h4 {
    font-size: 1.125rem;
    font-weight: 500;
    color: #06326e;
    margin-bottom: 0.5rem;
}

.university-tab-pane h5 {
    font-size: 1rem;
    font-weight: 500;
    color: #06326e;
    margin-bottom: 0.25rem;
}

.university-tab-pane h6 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #06326e;
    margin-bottom: 0.25rem;
}

.university-tab-pane table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.university-tab-pane th {
    background: #f9fafb;
    color: #06326e;
    font-weight: 600;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.university-tab-pane td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.university-tab-pane tr:nth-child(even) {
    background: #f9fafb;
}



/* Responsive Tab Design */
@media (max-width: 768px) {
    .university-tabs-nav {
        flex-direction: column;
    }

    .university-tab-button {
        flex: none;
        text-align: left;
        border-bottom: 1px solid #e5e7eb;
    }

    .university-tab-button:last-child {
        border-bottom: none;
    }

    .university-tab-button.active::after {
        height: 100%;
        width: 4px;
        top: 0;
        bottom: auto;
        right: auto;
        background: linear-gradient(to bottom, #004aad, #fa3c80);
    }

    .university-tab-content {
        padding: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .filter-group,
    .pagination {
        display: none;
    }

    .university-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }

    .university-tabs-nav {
        display: none;
    }

    .university-tab-pane {
        display: block !important;
        page-break-before: always;
    }

    .university-tab-pane:first-child {
        page-break-before: auto;
    }
}

/* Tab Navigation Scrollable */
.university-tabs-nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding-bottom: 8px;
    margin-bottom: -8px;
}

.university-tabs-nav::-webkit-scrollbar {
    height: 6px;
}

.university-tabs-nav::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.university-tabs-nav::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.university-tabs-nav::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.university-tabs-button {
    flex-shrink: 0;
    white-space: nowrap;
    min-width: fit-content;
    margin-right: 8px;
}

.university-tabs-button:last-child {
    margin-right: 0;
}

/* Scroll indicators */
.university-tabs-nav::before,
.university-tabs-nav::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 8px;
    width: 20px;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.university-tabs-nav::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
}

.university-tabs-nav::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0));
}

/* Hide scroll indicators when not needed */
.university-tabs-nav.no-scroll::before,
.university-tabs-nav.no-scroll::after {
    opacity: 0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .university-tabs-nav {
        padding: 0 16px;
        margin: 0 -16px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .university-tabs-nav::-webkit-scrollbar {
        display: none;
    }
    
    .university-tab-button {
        font-size: 14px;
        padding: 8px 12px;
        margin-right: 6px;
    }
}

/* Smooth scroll for tab navigation */
.university-tabs-nav.scrolling {
    scroll-behavior: smooth;
}
