/**
 * TVBO Main Stylesheet - Global styles for the website
 */

/* ========================================
   Header Styles - Using Odoo's standard behavior
   Override only background colors for all header states
   ======================================== */

/* Always white background for header in all states */
header.o_header_standard.o_header_is_scrolled,
header.o_header_standard.o_header_affixed,
header.tvbo-header.o_header_is_scrolled,
header.tvbo-header.o_header_affixed {
    background-color: #ffffff !important;
    z-index: 1050;
}
header.o_header_standard.o_header_is_scrolled .navbar,
header.o_header_standard.o_header_affixed .navbar,
header.tvbo-header.o_header_is_scrolled .navbar,
header.tvbo-header.o_header_affixed .navbar {
    background-color: #ffffff !important;
}


/* ========================================
   Global Search in Header
   ======================================== */

.tvbo-global-search {
    display: flex;
    align-items: center;
    flex: 1;
    position: relative;
    margin: 0 1.5rem;
    min-width: 200px;
}

.tvbo-search-input {
    width: 100%;
    padding: 10px 48px 10px 20px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.01em;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    background: #f8fafc;
    color: #2C3E50;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tvbo-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.tvbo-search-input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.tvbo-search-input:focus {
    border-color: #3498DB;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.tvbo-search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #3498DB 0%, #2C3E50 100%);
    border: none;
    border-radius: 50%;
    color: #fff;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tvbo-search-btn:hover {
    background: linear-gradient(135deg, #2980B9 0%, #1a252f 100%);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.35);
}

.tvbo-search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.tvbo-search-btn svg {
    width: 16px;
    height: 16px;
}

/* Mobile responsive — tracks the navbar's xl collapse breakpoint */
@media (max-width: 1199.98px) {
    .tvbo-global-search {
        max-width: 100%;
        margin: 1rem 0;
        order: -1;
    }

    .tvbo-search-input {
        background: #f8fafc;
    }
}

/* ========================================
   Mobile Header / Navbar
   ======================================== */

/* Once the burger shows, the brand shares the row with it: clip the long name
   rather than let it collide with the toggler. */
@media (max-width: 1199.98px) {
    header .navbar-brand {
        min-width: 0;
        flex: 1 1 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-right: 0.5rem;
    }

    header .navbar-toggler {
        flex: 0 0 auto;
    }
}

@media (max-width: 991.98px) {
    header .navbar-brand {
        font-size: 1rem !important;
    }

    header .navbar-brand img {
        height: 26px !important;
        flex: 0 0 auto;
    }
}

@media (max-width: 400px) {
    header .navbar-brand {
        font-size: 0.9rem !important;
    }

    header .navbar-brand img {
        height: 22px !important;
        margin-right: 6px !important;
    }
}

/* ========================================
   Survey Overrides
   ======================================== */

/* Hide the "Powered by Odoo" branding on surveys */
.o_survey_brand_message {
    display: none !important;
}

/* Collapse the survey cover header — Odoo 17 defaults it to 100vh which
   creates a massive blank area when no cover image is set. */
.o_survey_header {
    min-height: unset !important;
    height: auto !important;
    padding: 3rem 0 !important;
}

/* The survey landing screen should start near the top of the page, not in the
   middle of a full-height flex container. Odoo renders Python booleans as
   "True"/"False" in data attributes. */
.o_survey-fill-form[data-is-start-screen="true"],
.o_survey-fill-form[data-is-start-screen="True"] {
    align-items: flex-start !important;
}

.o_survey_form:has(.o_survey-fill-form[data-is-start-screen="true"]),
.o_survey_form:has(.o_survey-fill-form[data-is-start-screen="True"]) {
    min-height: auto !important;
}

.o_survey_form:has(.o_survey-fill-form[data-is-start-screen="true"]) > .d-flex.flex-wrap.flex-md-nowrap.justify-content-between,
.o_survey_form:has(.o_survey-fill-form[data-is-start-screen="True"]) > .d-flex.flex-wrap.flex-md-nowrap.justify-content-between {
    display: none !important;
}

.o_survey_form:has(.o_survey-fill-form[data-is-start-screen="true"]) .o_survey_start,
.o_survey_form:has(.o_survey-fill-form[data-is-start-screen="True"]) .o_survey_start {
    width: 100%;
    padding-top: 1rem;
}

/* Keep the survey progress bar and nav inside the survey page,
   above the website footer (z-index lower than header) */
.o_survey_main {
    position: relative;
    z-index: auto;
}

/* Prevent the sticky survey bottom bar from overlapping the footer */
.o_survey_form_footer {
    position: relative !important;
    z-index: auto !important;
}


/* ========================================
   General Page Styles
   ======================================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Links */
a {
    color: #3498DB;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2C3E50;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #3498DB 0%, #2C3E50 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980B9 0%, #1a252f 100%);
}
