/* Bootstrap 5 Custom Styles for Globug Web
 * Maintains original design while migrating to Bootstrap 5
 */

/* ===== Global Variables ===== */
:root {
    --globug-green: #00B96F;
    --globug-red: #C7342E;
    --globug-yellow: #E7B042;
    --globug-blue: #83B1C6;
    --globug-gray: #9C9B9B;
    --globug-dark-gray: #5b5b5b;
    --globug-light-gray: #E4E4E4;
}

/* ===== Container and Grid System ===== */
@media (min-width: 992px) {
    .container {
        max-width: 970px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1170px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Custom column spacing */
@media (min-width: 1200px) {
    .row {
        --bs-gutter-x: 1.5rem;
    }

    /* Special gutter for image grids */
    .row.g-4 {
        --bs-gutter-x: 2rem;
        --bs-gutter-y: 2rem;
    }
}

/* ===== Navigation Updates ===== */
.navbar {
    font-family: "museo_sans_rounded500", sans-serif;
    background-color: transparent;
    padding: 0;
}

/* Ensure navbar-collapse is always visible on desktop */
@media (min-width: 992px) {
    .navbar-collapse {
        display: block !important;
    }
}

.navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    width: 100%;
    visibility: visible !important;
}

.navbar-nav .nav-item {
    display: inline-block !important;
    margin: 0 5px;
}

.navbar-nav .nav-link,
.menu-item {
    color: var(--globug-green) !important;
    font-size: 22px;
    font-family: "museo_sans_rounded500";
    padding: 8px 15px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    display: inline-block !important;
}

.navbar-nav .nav-link:hover,
.menu-item:hover {
    color: var(--globug-green) !important;
    background-color: transparent;
    border: 1px solid var(--globug-green);
    text-decoration: none;
}

.navbar-nav .active .nav-link,
.navbar-nav .active .menu-item {
    color: var(--globug-green) !important;
    font-weight: bold;
    border: 1px solid var(--globug-green);
}

/* ===== Header Styles ===== */
.fixed-header {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    min-height: 100px;
    background-color: white;
    z-index: 100000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Align header outer columns with body content edges */
.fixed-header .header-logo-area {
    padding-left: 24px;
    padding-right: 6px;
}

.fixed-header .col-lg-3:last-child {
    padding-left: 6px;
    padding-right: 24px;
}

.fixed-header::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0) 100%);
    z-index: 99999;
}

.body-content {
    margin-top: 5px !important;
    /* Let Bootstrap's .container class handle width and padding */
}

.row-header {
    display: flex;
    align-items: center;
    width: 100%;
}

.col-header {
    display: flex;
    align-items: center;
    height: 80px;
    padding: 0 5px;
}

.col-header.logo {
    justify-content: flex-start;
}

.col-header.helpdesk {
    justify-content: center;
}

.col-header:last-child {
    justify-content: flex-end;
}

.globug-logo {
    max-width: 280px !important;
    height: auto;
}

.header-logo-area {
    flex-wrap: nowrap;
    overflow: visible;
}

.header-logo-area .globug-logo {
    max-width: 100% !important;
    width: 100%;
    height: auto;
}

.header-logo-area .logo-link {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

body.logged-in .header-logo-area {
    align-items: stretch !important;
}

body.logged-in .header-logo-area .globug-logo {
    max-width: 100% !important;
    height: auto;
}

.header-logo-area .logout {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1;
}

/* ===== Form Controls ===== */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 25px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #b0b0b0;
    border-radius: 0.375rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Pricing calculator specific spacing */
.calculator input[type="text"],
.calculator select {
    margin-bottom: 25px;
}

select {
    padding: 0 35px 0 15px;
}

input[type="text"] {
    padding: 0 10px;
}

.calculator .row {
    margin-bottom: 20px;
}

.calculator .col {
    padding: 0 15px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--globug-green);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 185, 111, 0.2);
}

/* Help text */
.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #6c757d;
}

/* ===== Buttons ===== */
.button {
    display: inline-block;
    font-weight: 400;
    font-family: "museo_sans_rounded500", sans-serif;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    text-decoration: none !important;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: #9C9B9B;
    border: none;
    padding: 11px 24px;
    font-size: 18px;
    border-radius: 0.375rem;
    color: #fff !important;
    min-width: 100px;
    min-height: auto !important;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    margin: 0;
}

.button:hover {
    background-color: #83B1C6 !important;
    color: #fff !important;
    transform: none;
}

.button:active {
    transform: none;
}

/* Override Bootstrap default button colors with Globug blue */
.btn-info,
.btn-primary,
.btn-secondary {
    background-color: #83B1C6 !important;
    border-color: #83B1C6 !important;
    color: #fff !important;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background-color: #6a9bb3 !important;
    border-color: #6a9bb3 !important;
    color: #fff !important;
}

.card-body .button {
    margin-top: 0;
}

/* ===== Icon Replacements (Bootstrap Icons) ===== */
.bi::before {
    display: inline-block;
    font-family: 'bootstrap-icons' !important;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    vertical-align: -0.125em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Icon mappings from Glyphicons to Bootstrap Icons */
.bi-check::before { content: "\F26B"; }
.bi-x::before { content: "\F62A"; }
.bi-house::before { content: "\F425"; }
.bi-envelope::before { content: "\F32F"; }
.bi-check-circle::before { content: "\F26E"; }
.bi-question-circle::before { content: "\F505"; }
.bi-arrow-right::before { content: "\F126"; }
.bi-arrow-left::before { content: "\F11F"; }
.bi-refresh::before { content: "\F517"; }
.bi-pencil::before { content: "\F4CB"; }
.bi-trash::before { content: "\F5DE"; }
.bi-plus::before { content: "\F4FE"; }
.bi-minus::before { content: "\F48A"; }
.bi-search::before { content: "\F52A"; }
.bi-download::before { content: "\F30A"; }
.bi-upload::before { content: "\F60F"; }
.bi-info-circle::before { content: "\F431"; }
.bi-exclamation-triangle::before { content: "\F33A"; }
.bi-person::before { content: "\F4DA"; }
.bi-lock::before { content: "\F46A"; }
.bi-unlock::before { content: "\F610"; }
.bi-star::before { content: "\F586"; }
.bi-star-fill::before { content: "\F588"; }
.bi-heart::before { content: "\F415"; }
.bi-heart-fill::before { content: "\F417"; }

/* ===== Bootstrap 5 Grid Helpers ===== */
/* Remove conflicting float-based column styles */
/* Use Bootstrap 5 grid system instead */

/* ===== Image Sizing ===== */
.column img {
    max-width: 100%;
    height: auto;
}

/* ===== Traffic Light Display ===== */
.trafficLightButtons {
    margin-bottom: 20px;
}

.trafficLightButtons img {
    width: 100%;
    height: auto;
}

/* ===== Main Navigation Bar ===== */
.main-nav {
    text-align: center;
    padding: 0;
    width: 100%;
}

.main-nav .navbar-nav {
    display: inline-flex !important;
    float: none;
    margin: 0 auto;
}

/* ===== Find Top-up Location ===== */
.find_topup {
    border: 1px solid var(--globug-green);
    margin-top: 5px;
    text-align: center;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
}

.find_topup h2 {
    font-size: 18px;
    font-family: "museo_sans_rounded300";
    font-weight: 300;
    color: white;
    background-color: var(--globug-green);
    margin: 0;
    padding: 10px;
    line-height: 22px;
}

.find_topup input {
    border: none;
    width: 100%;
    padding: 12px;
    text-align: center;
    font-size: 18px;
    font-family: "museo_sans_rounded300";
    color: var(--globug-gray);
}

/* ===== Pill Buttons and Spacing Fixes ===== */
.nav-pills {
    padding: 10px;
    margin-bottom: 20px;
}

.nav-pills .nav-link {
    padding: 12px 20px;
    margin: 5px;
    color: #fff;
    background-color: #9C9B9B;
}

.nav-pills .nav-link:hover {
    background-color: #6a9bb3;
    color: #fff;
}

.nav-pills .nav-link.active {
    background-color: #83B1C6 !important;
    border-color: #83B1C6 !important;
    color: #fff !important;
}

/* Fix price calculator pills */
.page-tab {
    padding: 10px 0;
    margin-bottom: 25px;
    overflow: visible;
}

.price-button {
    padding-top: 20px;
    padding-bottom: 20px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    vertical-align: top;
}

.price-button > h4,
.price-button h4 {
    margin-top: 0 !important;
    margin-bottom: 5px;
}

.price-button span {
    display: block;
    line-height: 1.4;
}


/* Fix advert image sizing with proper spacing */
.advert,
.fixed-size-add {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
    margin: 10px auto;
}

/* Fix spacing for bottom grid images specifically */
.row.mb-4 .col-md-6 {
    margin-bottom: 20px;
}

.information {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 10px auto;
}

/* Fix overlapping issues in how-it-works */
.column {
    padding: 10px;
}

.column img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
}

/* Fix how-it-works page icon sizing */
.how-it-works .col-lg-3 img {
    max-width: 80px !important;
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}

.how-it-works .col-lg-9 {
    padding-left: 15px;
}

.how-it-works .row {
    align-items: center;
    margin-bottom: 20px;
}

/* ===== Desktop Display Helpers ===== */
@media (min-width: 992px) {
    .only-big {
        display: block !important;
    }

    .only-small {
        display: none !important;
    }
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 991px) {
    .fixed-size-utility-disputes,
    .fixed-size-billy {
        margin-bottom: 15px !important;
    }

    .navbar-nav {
        flex-direction: column !important;
    }

    .navbar-nav .nav-item {
        width: 100%;
        text-align: center;
    }

    .navbar-collapse {
        background-color: #fff;
        padding: 20px 0;
        margin-top: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .navbar-toggler {
        display: block !important;
    }

    .only-big {
        display: none !important;
    }

    .only-small {
        display: block !important;
    }
}

/* ===== Account Balance Panel ===== */
.account-balance > .balance {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 46px;
    padding-right: 60px;
    white-space: nowrap;
}

@media (min-width: 992px) and (max-width: 1199px) {
    .account-balance > .balance {
        font-size: 32px;
    }
}

/* ===== Preserve Original Globug Styles ===== */
.left-main-box {
    color: white;
    padding: 16px 10px;
    margin-bottom: 15px;
    min-height: 145px;
}

.left-main-box h2 {
    color: white;
    font-size: 36px;
    font-family: "museo_sans_rounded300";
    margin: 0 0 19px 0;
}

.left-main-box p {
    font-family: "museo_sans_rounded300";
    font-size: 18px;
    font-weight: 300;
    line-height: 22px;
}

/* Background colors for sections */
.bg-globug-green { background-color: var(--globug-green) !important; }
.bg-globug-red { background-color: var(--globug-red) !important; }
.bg-globug-yellow { background-color: var(--globug-yellow) !important; }
.bg-globug-blue { background-color: var(--globug-blue) !important; }

/* Text colors */
.text-globug-green { color: var(--globug-green) !important; }
.text-globug-red { color: var(--globug-red) !important; }
.text-globug-yellow { color: var(--globug-yellow) !important; }
.text-globug-blue { color: var(--globug-blue) !important; }
.text-globug-gray { color: var(--globug-gray) !important; }

/* ===== Homepage Image Grid Fixes ===== */
/* Prevent image overlap - ensure proper side-by-side or stacked layout */
.row.g-4 .col-md-6,
.row.mb-4 .col-md-6 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.row.g-4 .col-md-6 img,
.row.mb-4 .col-md-6 img {
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Stack images on small screens */
@media (max-width: 767px) {
    .row.g-4 .col-md-6,
    .row.mb-4 .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 20px;
    }
}

/* ===== App Store Logo Fixes ===== */
/* Ensure app store buttons are side by side */
.row-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.row-bottom .col-6,
.row-bottom [class*="col-lg-"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.row-bottom img {
    max-width: 100%;
    height: auto;
}

/* ===== Accordion Styles (Help, FAQ, Terms) ===== */
.globug-accordion .accordion-button {
    background-color: #9C9B9B;
    color: #FFFFFF;
    font-size: 22px;
    font-family: "museo_sans_rounded500", sans-serif;
    font-weight: 400;
    padding: 18px 15px 10px 32px;
    min-height: 62px;
}

.globug-accordion .accordion-button:not(.collapsed) {
    background-color: #83B1C6;
    color: #FFFFFF;
}

.globug-accordion .accordion-button::after {
    filter: brightness(0) invert(1);
}

.globug-accordion .accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(131, 177, 198, 0.25);
}

/* ===== Google Maps Autocomplete Dropdown ===== */
.pac-container {
    z-index: 100002 !important;
}

/* ===== Responsive Button Containers ===== */
.d-flex.flex-row.gap-2.flex-wrap .button {
    flex: 0 1 auto;
    max-width: 100%;
}

@media (max-width: 575px) {
    .d-flex.flex-row.gap-2.flex-wrap {
        flex-direction: column !important;
    }
    .d-flex.flex-row.gap-2.flex-wrap .button {
        width: 100%;
    }
}

/* Override screen.css fixed-width form styles */
input[type="text"].form-control,
input[type="email"].form-control,
textarea.form-control,
select.form-select {
    width: 100%;
    height: auto;
    margin: 0 0 15px;
    padding: 10px 14px;
}
