/*
 * 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; }
}

@media (max-width: 768px) {
    #header-carousel .carousel-item {
        position: relative;
        min-height: 450px;
    }
    #header-carousel .carousel-item img {
        position: absolute;
        width: 100%; height: 100%;
        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); }

/* ===== WhatsApp Floating Button ===== */
.whatsapp-float {
    position: fixed;
    bottom: 90px;
    right: 30px;
    z-index: 99;
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #25D366 !important;
    border-color: #25D366 !important;
    animation: wa-pulse 2s infinite;
}
.whatsapp-float:hover {
    background-color: #128C7E !important;
    border-color: #128C7E !important;
    transform: scale(1.1);
}
@keyframes wa-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
    70%  { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ===== 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 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);
}

/* ===== Mobile Global Fixes ===== */
@media (max-width: 575.98px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 75px;
        right: 15px;
    }
    .whatsapp-float i { font-size: 1.4rem !important; }

    .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; }
}
