/* ===== Institute CSS ===== */
:root {
    --primary: #2A3B4C;
    --primary-light: #3E5A6F;
    --secondary: #6B5B95;
    --accent: #C44569;
    --accent-light: #E6A4B4;
    --success: #2E7D5E;
    --warning: #E6B800;
    --dark: #1A2634;
    --light: #F5F7FA;
    --gray-100: #F8FAFD;
    --gray-200: #E9ECF0;
    --gray-300: #DDE1E7;
    --gradient-1: linear-gradient(135deg, #2A3B4C, #3E5A6F);
    --gradient-2: linear-gradient(135deg, #6B5B95, #C44569);
    --gradient-3: linear-gradient(135deg, #2E7D5E, #6B5B95);
    --gradient-4: linear-gradient(135deg, #E6A4B4, #C44569);
}

/* ===== Main Container Spacing ===== */
main.container {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* ===== Preview Banner ===== */
.preview-banner {
    background: linear-gradient(135deg, #FFD166, #FFB347);
    padding: 1rem 0;
    position: relative;
    z-index: 100;
    border-radius: 15px 15px 0 0;
    margin-bottom: 0;
}

.preview-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.preview-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.preview-text {
    flex: 1;
    color: var(--dark);
    font-weight: 500;
}

.preview-actions {
    display: flex;
    gap: 0.8rem;
}

/* ===== Institute Hero Section (Detail Page) ===== */
.institute-hero {
    background: linear-gradient(135deg, #1A2634 0%, #2A3B4C 50%, #3E5A6F 100%);
    min-height: 450px;
    position: relative;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 2rem;
    padding: 3rem 0;
    border-radius: 20px;
}

.preview-banner + .institute-hero {
    border-radius: 0 0 20px 20px;
    margin-top: 0;
}

.institute-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(198, 69, 105, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(107, 91, 149, 0.15) 0%, transparent 40%),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 2px, transparent 2px, transparent 6px);
}

.shape-1 {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: floatShape1 20s infinite;
}

.shape-2 {
    position: absolute;
    bottom: -120px;
    left: -120px;
    width: 350px;
    height: 350px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    animation: floatShape2 25s infinite reverse;
}

.shape-3 {
    position: absolute;
    top: 30%;
    left: 20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    animation: floatShape3 15s infinite;
}

@keyframes floatShape1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-30px, 30px) rotate(240deg); }
}

@keyframes floatShape2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(40px, 40px) rotate(180deg); }
}

@keyframes floatShape3 {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ===== Institutes Hero Section (List Page) ===== */
.institutes-hero {
    background: linear-gradient(135deg, #1A2634 0%, #2A3B4C 50%, #3E5A6F 100%);
    min-height: 350px;
    position: relative;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 1rem;
    padding: 4rem 0;
    border-radius: 20px;
}

.institutes-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 50%, rgba(198, 69, 105, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(107, 91, 149, 0.15) 0%, transparent 50%);
}

.hero-badge .badge {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Institute Logo */
.institute-logo-wrapper {
    position: relative;
    display: inline-block;
}

.institute-logo {
    max-width: 250px;
    max-height: 250px;
    border: 5px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.institute-logo:hover {
    transform: scale(1.02);
    border-color: rgba(255,255,255,0.3);
}

.institute-default-logo {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #6B5B95, #C44569);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: white;
    border: 5px solid rgba(255,255,255,0.2);
}

.verified-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #2E7D5E;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 3px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.institute-location {
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
}

.institute-description {
    font-size: 1.2rem;
    max-width: 600px;
}

/* ===== Filter Section - EXACT SAME OUTER LAYER AS TRAINER PAGE ===== */
.filter-section {
    background: white;
    border-radius: 60px;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
    margin-top: -1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 10;
    font-size: 1.1rem;
}

.search-wrapper .form-control {
    padding-left: 3rem;
    height: 56px;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.search-wrapper .form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.25rem rgba(107, 91, 149, 0.1);
}

.search-wrapper .form-control::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

/* ===== Results Header ===== */
.results-header {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* ===== Main Content Container ===== */
.container.py-4 {
    padding-top: 0.5rem;
    padding-bottom: 2rem;
}

/* ===== Section Icons ===== */
.section-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(107, 91, 149, 0.1), rgba(198, 69, 105, 0.1));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    font-size: 1.3rem;
}

.section-icon.small {
    width: 35px;
    height: 35px;
    font-size: 1rem;
}

.gradient-text {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

/* ===== Contact List ===== */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: var(--gray-100);
}

.contact-icon-wrapper {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(107, 91, 149, 0.1), rgba(198, 69, 105, 0.1));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    transition: all 0.3s ease;
}

.contact-item:hover .contact-icon-wrapper {
    background: var(--gradient-2);
    color: white;
    transform: scale(1.1);
}

.contact-details {
    flex: 1;
}

.contact-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.1rem;
}

.contact-value {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-value:hover {
    color: var(--accent);
}

.contact-action {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--gray-100);
    border-radius: 8px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.contact-action:hover {
    background: var(--gradient-2);
    color: white;
    transform: translateY(-2px);
}

/* ===== Social Links ===== */
.social-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.social-link {
    width: 45px;
    height: 45px;
    background: var(--gray-100);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: var(--gradient-2);
    color: white;
    transform: translateY(-5px) rotate(360deg);
}

/* ===== Courses Section ===== */
.course-card {
    transition: all 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
}

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

.course-image-default {
    height: 160px;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
}

.course-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ===== Empty State ===== */
.empty-courses-state {
    background: linear-gradient(135deg, var(--gray-100), white);
    border-radius: 20px;
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(107, 91, 149, 0.1), rgba(198, 69, 105, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Accreditation Badges ===== */
.accreditations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.accreditation-badge {
    padding: 0.5rem 1.2rem;
    background: var(--gray-100);
    color: var(--secondary);
    border-radius: 60px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: default;
}

.accreditation-badge:hover {
    background: var(--gradient-2);
    color: white;
    transform: translateY(-2px);
}

/* ===== Institute Card (List Page) ===== */
.institute-card {
    transition: all 0.3s ease;
}

.institute-card:hover {
    transform: translateY(-5px);
}

.institute-card .card {
    overflow: hidden;
}

.institute-card-header {
    height: 160px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.institute-card-logo {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.institute-card:hover .institute-card-logo {
    transform: scale(1.1);
}

.institute-card-default {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.institute-badges {
    position: absolute;
    top: 15px;
    right: 15px;
    pointer-events: none;
}

.quick-info {
    background: var(--gray-100);
    border-radius: 10px;
    padding: 0.8rem;
}

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

.info-item:last-child {
    margin-bottom: 0;
}

.info-item i {
    width: 20px;
}

/* ===== Pagination ===== */
.pagination .page-link {
    border: none;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.2rem;
    color: var(--primary);
    font-weight: 500;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: var(--gradient-2);
    color: white;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-2);
    color: white;
}

/* ===== Modal Styles ===== */
.modal-content {
    border: none;
}

.modal-header {
    border-bottom: none;
}

/* ===== Toast Notification ===== */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 40px;
    height: 40px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
    .institute-logo,
    .institute-default-logo {
        max-width: 220px;
        max-height: 220px;
    }
}

@media (max-width: 992px) {
    main.container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .institute-logo,
    .institute-default-logo {
        max-width: 200px;
        max-height: 200px;
    }
    
    .institute-logo-wrapper {
        margin-bottom: 2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .institutes-hero {
        margin-bottom: 0.75rem;
    }
    
    .institute-hero {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    main.container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .institute-hero {
        min-height: 350px;
        padding: 2rem 0;
        border-radius: 15px;
        margin-bottom: 1rem;
    }
    
    .institutes-hero {
        min-height: 300px;
        padding: 2rem 0;
        border-radius: 15px;
        margin-bottom: 0.5rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .filter-section {
        border-radius: 40px;
        padding: 0.6rem 1.25rem;
        margin-top: -0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .search-wrapper .form-control {
        height: 48px;
        font-size: 0.9rem;
        padding-left: 2.5rem;
    }
    
    .search-icon {
        left: 15px;
        font-size: 1rem;
    }
    
    .preview-content {
        flex-direction: column;
        text-align: center;
    }
    
    .preview-banner {
        border-radius: 12px 12px 0 0;
    }
    
    .container.py-4 {
        padding-top: 0.25rem;
    }
}

@media (max-width: 576px) {
    main.container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .institute-hero {
        min-height: 300px;
        padding: 1.5rem 0;
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }
    
    .institutes-hero {
        min-height: 280px;
        padding: 1.5rem 0;
        border-radius: 12px;
        margin-bottom: 0.25rem;
    }
    
    .institute-logo,
    .institute-default-logo {
        max-width: 150px;
        max-height: 150px;
    }
    
    .display-4 {
        font-size: 1.8rem;
    }
    
    .verified-badge {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        bottom: 10px;
        right: 10px;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .preview-actions {
        width: 100%;
        justify-content: center;
    }
    
    .filter-section {
        border-radius: 30px;
        padding: 0.5rem 1rem;
        margin-top: -0.5rem;
        margin-bottom: 1rem;
    }
    
    .search-wrapper .form-control {
        height: 44px;
        font-size: 0.85rem;
        padding-left: 2.2rem;
    }
    
    .search-icon {
        left: 12px;
        font-size: 0.9rem;
    }
    
    .results-header {
        margin-bottom: 1rem;
    }
    
    .results-header h2 {
        font-size: 1.1rem;
    }
    
    .institute-card-header {
        height: 140px;
    }
    
    .institute-card-logo {
        max-width: 100px;
        max-height: 100px;
    }
    
    .container.py-4 {
        padding-top: 0;
    }
}

@media (max-width: 400px) {
    main.container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .institutes-hero .display-4,
    .institute-hero .display-4 {
        font-size: 1.6rem;
    }
    
    .institutes-hero .lead,
    .institute-hero .lead {
        font-size: 0.9rem;
    }
    
    .hero-badge .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .filter-section {
        padding: 0.4rem 0.75rem;
        margin-top: -0.35rem;
        margin-bottom: 0.75rem;
    }
    
    .search-wrapper .form-control {
        height: 40px;
        font-size: 0.8rem;
        padding-left: 2rem;
    }
    
    .search-icon {
        left: 10px;
        font-size: 0.8rem;
    }
    
    .institute-logo,
    .institute-default-logo {
        max-width: 120px;
        max-height: 120px;
    }
    
    .institute-default-logo {
        font-size: 3rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    .institute-hero,
    .institutes-hero,
    .filter-section,
    .pagination,
    .btn,
    .contact-action,
    .social-link,
    .modal {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    main.container {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* ===== Hide Scrollbar ===== */
html, body {
    scrollbar-width: none;
}

::-webkit-scrollbar {
    display: none;
}