/*
 * Puthuppadi Service Co-Operative Bank - Website Styles
 * Developed by Meta Mates Group (www.metamatesgroup.com)
 * Built on Bootstrap 5 with custom theming
 */

/* ===== Theme Variables ===== */
:root {
    --clr-gold: #D4AF37;
    --clr-red: #E93C05;
    --clr-gray: #555555;
    --clr-off-white: #F5F5F5;
    --clr-navy: #011A41;
}

/* ===== Typography ===== */
h1, .h1, h2, .h2, .fw-bold   { font-weight: 700 !important; }
h3, .h3, h4, .h4, .fw-medium { font-weight: 600 !important; }
h5, .h5, h6, .h6, .fw-semi-bold { font-weight: 500 !important; }

/* ===== Bootstrap Color Overrides ===== */
.text-primary       { color: var(--clr-gold) !important; }
.bg-primary         { background-color: var(--clr-gold) !important; }
.btn-primary        { background-color: var(--clr-gold) !important; border-color: var(--clr-gold) !important; }
.btn-primary:hover  { background-color: #c09b28 !important; border-color: #c09b28 !important; }
.btn-outline-primary       { color: var(--clr-gold) !important; border-color: var(--clr-gold) !important; }
.btn-outline-primary:hover { background-color: var(--clr-gold) !important; border-color: var(--clr-gold) !important; color: var(--clr-off-white) !important; }
.btn-primary, .btn-outline-primary:hover { color: var(--clr-off-white); }

/* ===== General ===== */
.btn { transition: all 0.4s ease; font-weight: 500; }

/* Square icon buttons */
.btn-square    { width: 38px; height: 38px; }
.btn-sm-square { width: 32px; height: 32px; }
.btn-lg-square { width: 48px; height: 48px; }
.btn-square, .btn-sm-square, .btn-lg-square {
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

/* ===== Loading Spinner ===== */
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-out, visibility 0s linear 0.5s;
    z-index: 99999;
}
#spinner.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-out, visibility 0s linear 0s;
}

/* ===== Top Bar & Navigation ===== */
.fixed-top { transition: all 0.5s ease; }

.top-bar {
    height: auto;
    min-height: 45px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.07);
    font-size: 0.8rem;
    overflow: hidden;
    white-space: nowrap;
}

/* Navbar brand: logo + optional text */
.navbar-brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.logo-img {
    max-height: 80px;
    width: auto;
    transition: max-height 0.5s;
}
.fixed-top.bg-white .logo-img { max-height: 50px; }

.logo-text {
    line-height: 1.3;
    white-space: nowrap;
}

/* Nav links */
.navbar .navbar-nav .nav-link {
    padding: 25px 12px;
    color: var(--clr-gray);
    font-weight: 500;
    font-size: 0.95rem;
    outline: none;
    transition: color 0.3s ease;
}
.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active { color: var(--clr-gold); }

/* Dropdown arrow using Font Awesome */
.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}

/* ===== Responsive Navbar ===== */

/* Mobile & Tablet (below 992px) */
@media (max-width: 991.98px) {
    .top-bar { display: none !important; }

    .logo-img { max-height: 60px; }
    .fixed-top.bg-white .logo-img { max-height: 45px; }

    .logo-text { display: none !important; }

    .navbar .navbar-nav {
        margin-top: 10px;
        border-top: 1px solid rgba(0, 0, 0, 0.07);
        background: #fff;
    }
    .navbar .navbar-nav .nav-link { padding: 10px 0; }
}

/* Medium desktops (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .logo-img { max-height: 60px; }
    .fixed-top.bg-white .logo-img { max-height: 45px; }

    .logo-text { display: none !important; }

    .navbar .navbar-nav .nav-link {
        padding: 20px 8px;
        font-size: 0.85rem;
    }

    .top-bar small { font-size: 0.75rem; }
}

/* Large desktops (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .logo-img { max-height: 70px; }
    .fixed-top.bg-white .logo-img { max-height: 50px; }

    .logo-text strong { font-size: 0.75rem !important; }
    .logo-text small { font-size: 0.6rem !important; }

    .navbar .navbar-nav .nav-link {
        padding: 22px 10px;
        font-size: 0.9rem;
    }
}

/* Extra large (1400px+) */
@media (min-width: 1400px) {
    .logo-img { max-height: 80px; }
    .fixed-top.bg-white .logo-img { max-height: 55px; }
}

/* Desktop dropdown reveal */
@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        visibility: hidden;
        top: 100%;
        opacity: 0;
        transform: rotateX(-75deg);
        transform-origin: top center;
        transition: all 0.4s ease;
    }
    .navbar .nav-item:hover .dropdown-menu {
        visibility: visible;
        opacity: 1;
        transform: rotateX(0);
    }
}

/* ===== Hero Carousel ===== */
.carousel-caption {
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: start;
    z-index: 1;
}

.carousel-control-prev,
.carousel-control-next { width: 3rem; }

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    background-color: var(--clr-gold);
    border: 10px solid var(--clr-gold);
}
.carousel-control-prev-icon { border-radius: 0 3rem 3rem 0; }
.carousel-control-next-icon { border-radius: 3rem 0 0 3rem; }

/* Override Bootstrap display-1 inside carousel */
#header-carousel .carousel-caption h1 {
    font-size: 2.8rem !important;
    line-height: 1.2 !important;
}
@media (min-width: 1400px) {
    #header-carousel .carousel-caption h1 { font-size: 3.2rem !important; }
}
@media (min-width: 992px) and (max-width: 1399.98px) {
    #header-carousel .carousel-caption h1 { font-size: 2.5rem !important; }
}
@media (min-width: 768px) and (max-width: 991.98px) {
    #header-carousel .carousel-caption h1 { font-size: 2rem !important; }
}
@media (min-width: 576px) and (max-width: 767.98px) {
    #header-carousel .carousel-caption h1 { font-size: 1.8rem !important; }
    #header-carousel .carousel-caption p { font-size: 0.85rem !important; }
}
@media (max-width: 575.98px) {
    #header-carousel .carousel-caption h1 { font-size: 1.5rem !important; }
    #header-carousel .carousel-caption p { font-size: 0.8rem !important; }
    #header-carousel .carousel-caption .btn { padding: 10px 20px !important; font-size: 0.85rem; }
}

/* ===== Venture / DB-rendered body_html — hide unwanted language ===== */
/* The legacy venture body HTML embeds both EN and ML inline (Malayalam tagged
   with .ml-text). In EN mode hide the ML siblings; in ML mode hide the EN
   siblings (using :has() — modern browsers). */
html[lang="en"] .ml-text { display: none !important; }
html[lang="ml"] :is(p, h1, h2, h3, h4, h5, h6, span, small):not(.ml-text):has(+ .ml-text) { display: none !important; }
html[lang="ml"] .ml-text {
    color: inherit !important;
    opacity: 1 !important;
    font-family: 'Noto Sans Malayalam', sans-serif !important;
}

/* ===== Icon-prefixed paragraphs (contact bars, address blocks, footer) =====
   Prevent text from wrapping awkwardly under a leading icon. */
@supports selector(:has(*)) {
    .container-xxl p:has(> i:first-child),
    .contact-bar  p:has(> i:first-child),
    .footer        p:has(> i:first-child),
    .footer       small:has(> i:first-child) {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .container-xxl p:has(> i:first-child) > i,
    .contact-bar  p:has(> i:first-child) > i,
    .footer        p:has(> i:first-child) > i,
    .footer       small:has(> i:first-child) > i {
        margin-right: 0 !important;
        margin-top: 0.32em;
        flex-shrink: 0;
        width: 1.25em;
        text-align: center;
    }
}
/* Fallback for browsers without :has() — at least give icons a fixed width */
.footer p > i:first-child,
.container-xxl p > i:first-child,
.contact-bar p > i:first-child {
    display: inline-block;
    width: 1.25em;
    text-align: center;
    flex-shrink: 0;
}

/* Carousel image — sized so navbar (~120px) + carousel + ticker (~52px) fit
   in the first viewport on common laptop screens (700-900px tall). */
#header-carousel .carousel-item img {
    width: 100%;
    height: calc(100vh - 200px);
    max-height: 500px;
    min-height: 320px;
    object-fit: cover;
    object-position: center right;
}

@media (max-width: 768px) {
    #header-carousel .carousel-item {
        position: relative;
        min-height: 420px;
    }
    #header-carousel .carousel-item img {
        position: absolute;
        width: 100%; height: 100%;
        max-height: none;
        min-height: 0;
        object-fit: cover;
    }
}

/* ===== Inner Page Header ===== */
.page-header {
    padding-top: 12rem;
    padding-bottom: 6rem;
    background: url(../img/header.jpg) top left / cover no-repeat;
}
@media (max-width: 991.98px) {
    .page-header {
        padding-top: 8rem;
        padding-bottom: 4rem;
    }
    .page-header h1 { font-size: 2rem !important; }
}
.page-header .breadcrumb-item,
.page-header .breadcrumb-item a { font-weight: 500; }
.page-header .breadcrumb-item + .breadcrumb-item::before { color: var(--clr-gray); }

/* ===== Service Tab Section ===== */
.service .nav .nav-link { transition: all 0.4s ease; }
.service .nav .nav-link.active {
    border-color: var(--clr-gold) !important;
    background: var(--clr-gold);
}
.service .nav .nav-link.active h5,
.service .nav .nav-link.active h5 i { color: #fff !important; }

/* ===== Scroll-to-Top Button ===== */
.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 99;
}

/* ===== Footer ===== */
.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: var(--clr-off-white);
    font-weight: normal;
    text-transform: capitalize;
    transition: color 0.3s ease, letter-spacing 0.3s ease;
}
.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
}
.footer .btn.btn-link:hover {
    color: var(--clr-gold);
    letter-spacing: 1px;
    box-shadow: none;
}

/* Copyright bar */
.copyright     { color: var(--clr-off-white); background: #000B1C; }
.copyright a   { color: var(--clr-off-white); }
.copyright a:hover { color: var(--clr-gold); }

/* ===== Floating Action Buttons (stacked, right edge) ===== */
.floating-actions {
    position: fixed;
    bottom: 90px;
    right: 22px;
    z-index: 99;
    display: flex;
    flex-direction: column-reverse; /* WhatsApp at bottom, Enquire at top */
    gap: 12px;
}
.float-btn {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    text-decoration: none;
    transition: transform 0.18s ease, background-color 0.18s ease;
}
.float-btn i { font-size: 1.15rem; }
.float-btn:hover { transform: scale(1.1); color: #fff !important; }

.float-whatsapp { background-color: #25D366; animation: wa-pulse 2s infinite; }
.float-whatsapp:hover { background-color: #128C7E; }

.float-call { background-color: var(--clr-gold); }
.float-call:hover { background-color: #c09b28; }

.float-enquire { background-color: var(--clr-navy); }
.float-enquire:hover { background-color: #02265e; }

@keyframes wa-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70%  { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (max-width: 575px) {
    .floating-actions { right: 16px; bottom: 80px; gap: 10px; }
    .float-btn { width: 42px; height: 42px; }
}

/* ===== Quick Access Cards ===== */
.quick-link-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    color: var(--clr-navy);
}
.quick-link-card:hover {
    border-color: var(--clr-gold) !important;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    color: var(--clr-navy);
}

/* ===== Board of Directors ===== */
.board-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.board-card:hover {
    border-color: var(--clr-gold) !important;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.board-img-wrapper {
    width: 120px; height: 120px;
    margin: 0 auto;
    overflow: hidden;
}
.board-img {
    width: 120px; height: 120px;
    object-fit: cover;
    border: 3px solid var(--clr-gold);
}

/* ===== Scheme & Event Cards ===== */
.scheme-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.scheme-card:hover {
    border-color: var(--clr-gold) !important;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* ===== Venture detail pages — MICRO ATM badge + service icon boxes ===== */
/* Branded MICRO ATM card: gold→navy gradient, card icon, hover lift */
.micro-atm-badge {
    background: linear-gradient(145deg, var(--clr-gold) 0%, #c09b28 60%, var(--clr-navy) 100%);
    border-radius: 18px;
    padding: 28px 36px 32px;
    text-align: center;
    color: #fff;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.25);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 220px;
}
.micro-atm-badge::before {
    content: "\f09d"; /* fa-credit-card */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: -10px;
    right: -8px;
    font-size: 6rem;
    opacity: 0.12;
    transform: rotate(-15deg);
    pointer-events: none;
}
.micro-atm-badge:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(212, 175, 55, 0.35);
}
.micro-atm-badge .word-micro {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 4px;
    display: block;
    opacity: 0.85;
    margin-bottom: 4px;
    text-transform: uppercase;
}
.micro-atm-badge .word-atm {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: 6px;
    display: block;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Service icon boxes inside venture body (Passport, PAN, etc.) */
.service-icon-box {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--clr-gold), #c09b28);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}
.service-icon-box i {
    color: #fff;
    font-size: 1.3rem;
}

/* Helper for rendered HTML ml-text — Noto Sans Malayalam font */
.ml-text { font-family: 'Noto Sans Malayalam', sans-serif; }

/* ===== Venture Cards ===== */
.venture-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.venture-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
}
.venture-card img { transition: transform 0.4s ease; }
.venture-card:hover img { transform: scale(1.05); }

/* ===== Download Cards ===== */
.download-card { transition: border-color 0.3s ease, background-color 0.3s ease; }
.download-card:hover {
    border-color: var(--clr-gold) !important;
    background-color: #fafafa;
}

/* ===== News Ticker ===== */
#news-ticker marquee { font-size: 0.95rem; }

/* ===== EMI Calculator ===== */
.form-range::-webkit-slider-thumb { background: var(--clr-gold); }
.form-range::-moz-range-thumb     { background: var(--clr-gold); }
#emi-results .bg-primary {
    background: linear-gradient(135deg, var(--clr-gold), var(--clr-navy)) !important;
}

/* ===== Tables ===== */
.table-dark { background-color: var(--clr-navy) !important; }
.table-hover tbody tr:hover { background-color: rgba(212, 175, 55, 0.08); }

/* ===== Dropdown Menus ===== */
.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.dropdown-item.active,
.dropdown-item:active { background-color: var(--clr-gold); }
.dropdown-item:hover {
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--clr-gold);
}

/* ===== About page — image stays put when switching Story/Mission/Vision tabs =====
   Lock the tab-content to the height of the tallest pane so switching tabs
   doesn't reflow the page (image was visually moving up on Vision because
   that tab is shorter than Story/Mission). */
#nav-tabContent { min-height: 220px; }
@media (max-width: 991.98px) { #nav-tabContent { min-height: 180px; } }
@media (max-width: 575.98px) { #nav-tabContent { min-height: 160px; } }

/* ===== Word break / overflow safeguards for user content ===== */
.article-content,
.footer p,
.footer small,
.contact-bar p,
.container-xxl p {
    overflow-wrap: anywhere;
}

/* Balanced line-wrapping for venture page address blocks + headings —
   prevents lonely orphans like a stranded PIN code or "Ltd." */
.container-xxl p,
.container-xxl h1,
.container-xxl h2,
.container-xxl h3,
.container-xxl h4 {
    text-wrap: balance;
}
.article-content img,
.article-content iframe { max-width: 100%; height: auto; }
.article-content table  { max-width: 100%; display: block; overflow-x: auto; }

/* ===== Cookie banner pushes floats up while visible ===== */
body.consent-shown .floating-actions { bottom: 170px; }
body.consent-shown .back-to-top      { bottom: 110px; }

/* ===== Hide social icons in narrow desktop range ===== */
@media (max-width: 1199.98px) {
    .navbar .d-none.d-lg-flex .btn-sm-square { display: none !important; }
}

/* ===== Micro-ATM badge on tiny phones ===== */
@media (max-width: 360px) {
    .micro-atm-badge { min-width: 0; padding: 22px 20px 24px; }
    .micro-atm-badge .word-atm { font-size: 2rem; letter-spacing: 4px; }
}

/* ===== EMI calculator result cards ===== */
@media (max-width: 575.98px) {
    #emi-results .col-4 { flex: 0 0 100%; max-width: 100%; }
}

/* ===== Mobile Global Fixes ===== */
@media (max-width: 575.98px) {
    /* Avoid float-buttons vs back-to-top collision on tiny phones */
    .back-to-top { right: 16px; bottom: 20px; width: 40px; height: 40px; }
    .floating-actions { right: 16px; bottom: 78px; }

    .back-to-top {
        right: 15px;
        bottom: 20px;
    }

    .display-1 { font-size: 2rem !important; }
    .display-3 { font-size: 1.8rem !important; }
    .display-5 { font-size: 1.5rem !important; }

    .footer { font-size: 0.9rem; }
}
