/* ============================================================
   Rishta Diamond Institute — Diamond Animations & Mobile Styles
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
    --gold: #b6901c;
    --gold-light: #d4a832;
    --gold-pale: rgba(182, 144, 28, 0.15);
    --shimmer: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */

@keyframes diamondFloat {
    0%, 100% { transform: translateY(0) rotate(45deg) scale(1); opacity: 0.5; }
    50% { transform: translateY(-18px) rotate(45deg) scale(1.1); opacity: 1; }
}

@keyframes particleRise {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-500px) rotate(720deg); opacity: 0; }
}

@keyframes shimmerSweep {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes sparkleIn {
    0%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1) rotate(180deg); opacity: 1; }
}

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

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(182, 144, 28, 0.5); }
    50% { box-shadow: 0 0 25px 8px rgba(182, 144, 28, 0.15); }
}

@keyframes goldShimmerText {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes diamondSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes floatUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes ripple {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.4); opacity: 0; }
}

@keyframes slideInMobile {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* ============================================================
   SCROLL REVEAL — elements start invisible, animate in
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.reveal-left {
    transform: translateX(-40px);
}
.reveal.reveal-right {
    transform: translateX(40px);
}
.reveal.reveal-scale {
    transform: scale(0.9);
}
.reveal.visible {
    opacity: 1;
    transform: translate(0) scale(1);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ============================================================
   DIAMOND FLOATING PARTICLES (canvas overlay)
   ============================================================ */
#diamond-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.carousel-inner .carousel-item {
    position: relative;
}
.carousel-inner .carousel-caption {
    z-index: 2;
}

/* CSS diamond particles */
.diamond-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation: particleRise linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* ============================================================
   SHIMMER EFFECT on Cards & Buttons
   ============================================================ */
.shimmer-card {
    position: relative;
    overflow: hidden;
}
.shimmer-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: none;
    pointer-events: none;
}
.shimmer-card:hover::after {
    animation: shimmerSweep 0.7s ease forwards;
}

/* ============================================================
   GOLD TEXT SHIMMER on Headings
   ============================================================ */
.gold-shimmer {
    background: linear-gradient(90deg,
        var(--gold) 0%,
        #f0c040 30%,
        var(--gold) 60%,
        #f0c040 80%,
        var(--gold) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShimmerText 3s linear infinite;
    display: inline-block;
}

/* ============================================================
   DIAMOND ICON DECORATION
   ============================================================ */
.diamond-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 15px auto 30px;
}
.diamond-divider::before,
.diamond-divider::after {
    content: '';
    flex: 1;
    max-width: 80px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--gold));
}
.diamond-divider::after {
    background: linear-gradient(to left, transparent, var(--gold));
}
.diamond-icon {
    width: 14px;
    height: 14px;
    background: var(--gold);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation: diamondFloat 2s ease-in-out infinite;
    flex-shrink: 0;
}
.diamond-icon-sm {
    width: 8px;
    height: 8px;
    background: var(--gold);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    display: inline-block;
    margin: 0 4px;
    animation: diamondFloat 2.5s ease-in-out infinite;
}

/* ============================================================
   COURSE CARD HOVER — Gold Border Glow
   ============================================================ */
.rounded.overflow-hidden {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.rounded.overflow-hidden:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(182, 144, 28, 0.25) !important;
    border-color: rgba(182, 144, 28, 0.3);
}

/* Category card hover */
.cat-item {
    transition: transform 0.35s ease, box-shadow 0.35s ease !important;
}
.cat-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 15px 35px rgba(182, 144, 28, 0.3) !important;
}

/* Team card hover */
.team-item {
    transition: transform 0.35s ease, box-shadow 0.35s ease !important;
}
.team-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(182, 144, 28, 0.2) !important;
}

/* ============================================================
   STATS COUNTER SECTION
   ============================================================ */
.stats-section {
    background: linear-gradient(135deg, #a40e19 0%, #a40e19 100%);
    padding: 60px 0;
}
.stat-item {
    text-align: center;
    padding: 20px;
    animation: countUp 0.6s ease forwards;
    opacity: 0;
}
.stat-item.visible {
    opacity: 1;
}
.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
    display: block;
    font-family: 'Poppins', sans-serif;
}
.stat-label {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    margin-top: 8px;
    display: block;
}
.stat-icon {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 12px;
    animation: floatUpDown 3s ease-in-out infinite;
}

/* ============================================================
   NAVBAR — sticky scroll shadow
   ============================================================ */
.navbar-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
    transition: box-shadow 0.3s ease;
}
.container-fluid > .row.border-top {
    transition: box-shadow 0.3s ease;
}

/* ============================================================
   PULSE CTA BUTTON
   ============================================================ */
.btn-pulse {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ============================================================
   FLOATING MOBILE CTA BAR
   ============================================================ */
.mobile-cta-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    padding: 10px 15px;
    gap: 10px;
}
.mobile-cta-bar a {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}
.mobile-cta-bar a:active { opacity: 0.8; }
.mobile-cta-call {
    background: var(--gold);
    color: #fff !important;
}
.mobile-cta-whatsapp {
    background: #25D366;
    color: #fff !important;
}

/* ============================================================
   FLOATING WHATSAPP BUTTON (desktop)
   ============================================================ */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 58px;
    height: 58px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
    z-index: 9998;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: floatUpDown 3s ease-in-out infinite;
}
.whatsapp-float:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
    color: #fff;
    text-decoration: none;
}
.whatsapp-float::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.4);
    animation: ripple 2s ease-out infinite;
}

/* ============================================================
   PAGE HEADER DIAMOND DECORATION
   ============================================================ */
.page-header {
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '◆';
    position: absolute;
    top: -30px;
    right: 5%;
    font-size: 12rem;
    color: rgba(255,255,255,0.03);
    animation: diamondSpin 30s linear infinite;
    pointer-events: none;
}
.page-header::after {
    content: '◆';
    position: absolute;
    bottom: -60px;
    left: 3%;
    font-size: 16rem;
    color: rgba(255,255,255,0.03);
    animation: diamondSpin 40s linear infinite reverse;
    pointer-events: none;
}

/* ============================================================
   SECTION HEADINGS — diamond accent
   ============================================================ */
.section-heading-wrap {
    position: relative;
    display: inline-block;
}
.section-heading-wrap::after {
    content: '◆';
    position: absolute;
    top: -8px;
    right: -20px;
    font-size: 0.7rem;
    color: var(--gold);
    animation: sparkleIn 2s ease-in-out infinite;
}

/* ============================================================
   REGISTRATION BG IMAGE ENHANCEMENT
   ============================================================ */
.bg-registration {
    position: relative;
    overflow: hidden;
}
.bg-registration::before {
    content: '◆';
    position: absolute;
    top: 10%;
    left: -2%;
    font-size: 18rem;
    color: rgba(255,255,255,0.03);
    animation: diamondSpin 50s linear infinite;
    pointer-events: none;
}

/* ============================================================
   MOBILE — Responsive Fixes & Enhancements
   ============================================================ */
@media (max-width: 991.98px) {
    /* Show mobile CTA bar */
    .mobile-cta-bar {
        display: flex;
    }

    /* Pad content above mobile bar */
    body {
        padding-bottom: 70px;
    }

    /* Hide desktop WhatsApp float on mobile (bar handles it) */
    .whatsapp-float {
        display: none;
    }

    /* Hero carousel text adjustments */
    .carousel-caption h5 { font-size: 0.8rem; margin-bottom: 6px !important; }
    .carousel-caption .display-3 { font-size: 1.6rem !important; line-height: 1.2; margin-bottom: 12px !important; }
    .carousel-caption .btn { padding: 8px 20px !important; font-size: 0.85rem; }
    .carousel-item { min-height: 260px !important; }
    .carousel-item img { min-height: 260px !important; max-height: 350px; }

    /* Stack stats */
    .stat-item { padding: 12px 10px; }
    .stat-number { font-size: 2.2rem; }

    /* Sections padding */
    .container-fluid.py-5 { padding-top: 40px !important; padding-bottom: 40px !important; }
    .container.py-5 { padding-top: 30px !important; padding-bottom: 30px !important; }

    /* Team cards 2 per row */
    .team.col-md-6 { margin-bottom: 20px; }

    /* Course accordion improve */
    .accordion .btn.btn-link { font-size: 0.9rem; }

    /* Registration section */
    .bg-registration .container { padding-top: 30px !important; padding-bottom: 30px !important; }

    /* Footer margin */
    .container-fluid.bg-dark { margin-top: 40px !important; }

    /* Section headings */
    h1 { font-size: 1.6rem !important; }
    .display-4 { font-size: 2rem !important; }

    /* Topbar collapse already handles via d-none d-lg-block */

    /* Course tab pills on mobile */
    #courseTabs .nav-link { padding: 10px 14px; font-size: 0.85rem; margin-bottom: 5px; }
    #courseTabs { flex-direction: column; align-items: stretch; }
    #courseTabs .nav-item { width: 100%; }
    #courseTabs .nav-link { text-align: center; }

    /* Card header course name wrapping */
    .card-header h4 { font-size: 1rem; }
}

@media (max-width: 575.98px) {
    /* Extra small phones */
    .carousel-caption .display-3 { font-size: 1.3rem !important; }
    .carousel-item img { min-height: 220px !important; max-height: 300px; }

    /* Contact info cards stack properly */
    .col-lg-4.col-md-6 { margin-bottom: 15px; }

    /* Form padding */
    .card-body.bg-primary.p-5 { padding: 25px !important; }
    .bg-secondary.rounded.p-5 { padding: 20px !important; }

    /* Stats */
    .stat-number { font-size: 1.8rem; }

    /* Accordion items */
    .accordion .card-body ol { padding-left: 18px; font-size: 0.88rem; }

    /* Course card badge */
    .badge.badge-light { font-size: 0.75rem; }

    /* Footer padding */
    .container-fluid.bg-dark.py-5 { padding: 30px 15px !important; }
}

/* ============================================================
   MOBILE NAVBAR IMPROVEMENTS
   ============================================================ */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #fff;
        padding: 15px;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.12);
        margin-top: 5px;
    }
    .navbar-nav .nav-link {
        padding: 12px 15px !important;
        border-bottom: 1px solid #f0f0f0;
        font-weight: 500;
        font-size: 1rem;
    }
    .navbar-nav .nav-link:last-child { border-bottom: none; }
    .navbar-nav .nav-link.active { color: var(--gold) !important; }

    /* Mobile logo in navbar */
    .navbar .text-decoration-none.d-block.d-lg-none h1 {
        font-size: 1.3rem;
    }
}

/* ============================================================
   CARD IMPROVEMENTS — touch-friendly
   ============================================================ */
.card.border-0.shadow-sm {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card.border-0.shadow-sm:hover {
    box-shadow: 0 15px 40px rgba(182, 144, 28, 0.2) !important;
    transform: translateY(-4px);
}

/* ============================================================
   BUTTON HOVER EFFECTS
   ============================================================ */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease !important;
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    pointer-events: none;
}
.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* ============================================================
   NAV PILLS (Course Tabs) — gold active state
   ============================================================ */
.nav-pills .nav-link.active {
    background: var(--gold) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(182, 144, 28, 0.4);
}
.nav-pills .nav-link {
    color: var(--gold) !important;
    border: 2px solid var(--gold);
    border-radius: 50px !important;
    transition: all 0.3s ease;
}
.nav-pills .nav-link:hover:not(.active) {
    background: var(--gold-pale) !important;
}

/* ============================================================
   TESTIMONIAL CAROUSEL
   ============================================================ */
.testimonial-carousel h4 {
    font-size: 1.05rem;
    line-height: 1.7;
}
@media (max-width: 575.98px) {
    .testimonial-carousel h4 { font-size: 0.95rem; }
    .testimonial-carousel img { max-width: 70px !important; }
}

/* ============================================================
   ABOUT PAGE — Vision Mission cards
   ============================================================ */
.bg-white.rounded.p-5 {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.bg-white.rounded.p-5:hover {
    box-shadow: 0 12px 35px rgba(182, 144, 28, 0.15) !important;
    transform: translateY(-4px);
}

/* ============================================================
   CONTACT PAGE — info cards
   ============================================================ */
.bg-secondary.rounded.p-4 {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.bg-secondary.rounded.p-4:hover {
    box-shadow: 0 10px 30px rgba(182, 144, 28, 0.15) !important;
    transform: translateY(-4px);
}

/* ============================================================
   FOOTER ENHANCEMENTS
   ============================================================ */
.container-fluid.bg-dark .btn-outline-light {
    transition: all 0.3s ease;
}
.container-fluid.bg-dark .btn-outline-light:hover {
    background: var(--gold) !important;
    border-color: var(--gold) !important;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(182, 144, 28, 0.4);
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
    transition: all 0.3s ease !important;
    animation: floatUpDown 3s ease-in-out infinite;
}
.back-to-top:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 20px rgba(182, 144, 28, 0.5) !important;
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, var(--gold), #f0c040);
    z-index: 99999;
    transition: width 0.1s linear;
    box-shadow: 0 0 6px rgba(182, 144, 28, 0.7);
}

/* ============================================================
   LOADING SHIMMER for images
   ============================================================ */
img[data-src] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmerLoad 1.5s infinite;
}
@keyframes shimmerLoad {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================================
   ACCORDION IMPROVEMENTS
   ============================================================ */
.accordion .card {
    border-radius: 8px !important;
    overflow: hidden;
}
.accordion .btn-link {
    text-decoration: none !important;
    transition: color 0.2s ease;
}
.accordion .btn-link:hover { color: var(--gold) !important; text-decoration: none !important; }
.accordion .collapse.show + .card-header,
.accordion .btn-link:not(.collapsed) .fa-chevron-down {
    color: var(--gold) !important;
}
.accordion .btn-link:not(.collapsed) {
    color: var(--gold) !important;
}
.accordion .fa-chevron-down {
    transition: transform 0.3s ease;
}
.accordion .btn-link:not(.collapsed) .fa-chevron-down {
    transform: rotate(180deg);
}

/* ============================================================
   CTA SECTION  (course page bottom banner)
   ============================================================ */
.container-fluid.bg-primary.py-5 {
    position: relative;
    overflow: hidden;
}
.container-fluid.bg-primary.py-5::before {
    content: '◆';
    position: absolute;
    right: -2%;
    top: -20px;
    font-size: 14rem;
    color: rgba(255,255,255,0.06);
    animation: diamondSpin 40s linear infinite;
    pointer-events: none;
}

/* ============================================================
   CATEGORY OVERLAY TEXT
   ============================================================ */
.cat-overlay {
    transition: all 0.4s ease !important;
}
.cat-item:hover .cat-overlay {
    background: rgba(182, 144, 28, 0.75) !important;
}

/* ============================================================
   SMOOTH SCROLL  (native)
   ============================================================ */
html {
    scroll-behavior: smooth;
}
