/* Portal CSS — customer-facing portal styles
   Shares the same visual language as apps/internal (cc.css) with
   portal-specific adjustments for a cleaner, customer-facing look. */

/* ─── Base ──────────────────────────────────────────────────────────────────── */

body {
    font-family: 'Montserrat', sans-serif !important;
    padding: 0px;
    margin: 0px;
    background-color: #f7fbff;
}

/* ─── Header ─────────────────────────────────────────────────────────────────── */

.headerWrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.headerBackground {
    background-color: #ebf8ff;
    padding: 5px;
    display: flex;
    align-items: center;
}

.headerLogoWrap {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.headerLogo {
    max-height: 50px;
    padding: 0 10px;
}

.headerMenu {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 5px;
    flex: 1;
}

.headerMenuItem {
    padding: 7px 14px;
    font-weight: 600;
    font-size: .9em;
    border-radius: 5px;
    border: 1px solid #ebf8ff;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background-color 0.15s, color 0.15s;
}

.headerMenuItem:hover {
    background-color: #d0eeff;
}

.headerActions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 10px;
    flex-shrink: 0;
}

.headerUserName {
    font-size: .85em;
    color: #555;
}

.headerHamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.4em;
    cursor: pointer;
    padding: 8px 12px;
    color: #333;
    line-height: 1;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 5px;
}

/* ─── Mobile Menu ─────────────────────────────────────────────────────────────── */

.mobileMenu {
    display: none;
    background-color: white;
    border-top: 1px solid #d0eeff;
}

.mobileMenu.open {
    display: block;
}

.mobileMenuUser {
    padding: 14px 20px;
    font-size: .85em;
    color: #777;
    font-weight: 600;
    background-color: #f7fbff;
    border-bottom: 1px solid #e8f4fc;
}

.mobileMenuItem {
    padding: 15px 20px;
    font-weight: 600;
    font-size: .95em;
    cursor: pointer;
    border-bottom: 1px solid #eef3f8;
    -webkit-user-select: none;
    user-select: none;
    transition: background-color 0.15s;
}

.mobileMenuItem:hover {
    background-color: #d0eeff;
}

.mobileMenuItem.active {
    background-color: #007fff;
    color: white;
}

.mobileMenuDivider {
    height: 1px;
    background-color: #d0eeff;
}

.mobileMenuSignOut {
    color: #c00;
}

.mobileMenuSignOut:hover {
    background-color: #fff0f0 !important;
    color: #c00;
}

/* ─── Layout ──────────────────────────────────────────────────────────────────── */

.mainContent {
    padding: 30px;
    min-height: calc(100vh - 65px);
}

/* ─── Cards ──────────────────────────────────────────────────────────────────── */

.contentCard {
    border: 1px solid #dde8f0;
    border-radius: .75rem;
    padding: 10px;
    background-color: white;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────────── */

.contentButton {
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    margin-top: 5px;
    font-family: inherit;
    -webkit-user-select: none;
    user-select: none;
    transition: opacity 0.15s;
}

.contentButton:hover {
    opacity: 0.85;
}

.contentButtonPrimary {
    background-color: #007fff;
    color: white;
}

.contentButtonSecondary {
    background-color: white;
    color: black;
    border: 1px solid #ccc;
}

.contentButtonSuccess {
    background-color: #008000;
    color: white;
}

.contentButtonDanger {
    background-color: #ff0000;
    color: white;
}

/* ─── Inputs ──────────────────────────────────────────────────────────────────── */

.contentInput {
    font-family: inherit;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: calc(100% - 22px);
    box-sizing: border-box;
    font-size: 1em;
}

.contentInput:focus {
    border-color: #007fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 127, 255, 0.15);
}

.contentSelect {
    font-family: inherit;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: .9em;
}

/* ─── Tables ──────────────────────────────────────────────────────────────────── */

.contentTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    font-size: .9em;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.contentTableHeader th {
    background-color: #f2f7ff;
    font-weight: 700;
    padding: 12px 14px;
    border-bottom: 2px solid #dde8f0;
    text-align: left;
    font-size: .85em;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #555;
}

td {
    vertical-align: top;
}

.contentTableRow td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef3f8;
}

.contentTableRow:last-child td {
    border-bottom: none;
}

.contentTableRow:hover {
    background-color: #f5fbff;
}

/* ─── Text utilities ──────────────────────────────────────────────────────────── */

h3 {
    display: inline-block;
    padding-top: 0px;
    margin: 0px;
    font-size: 1.4em;
    font-weight: 600;
}

h4 {
    font-size: 1.1em;
}

.textDanger  { color: #FF0000 !important; font-weight: 600; }
.textWarning { color: #FFA500; font-weight: 600; }
.textSuccess { color: #008000; font-weight: 600; }
.textBold    { font-weight: bold; }

/* ─── Loading spinner ─────────────────────────────────────────────────────────── */

.contentLoader {
    width: 48px;
    height: 48px;
    border: 3px solid #FFF;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

.contentLoader::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: #007fff;
}

@keyframes rotation {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ─── Login page ──────────────────────────────────────────────────────────────── */

#loginContent {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background-color: white;
}

/* ─── Estimate Detail (ep-* classes shared with estimatePreview.html) ─────────── */

.ep-card { background: white; border: 1px solid #dde8f0; border-radius: 8px; padding: 24px 28px; margin-bottom: 16px; }
.ep-section-card { background: white; border: 1px solid #dde8f0; border-radius: 8px; margin-bottom: 14px; overflow: hidden; }
.ep-section-title { background: #f2f7ff; padding: 10px 16px; font-weight: 700; font-size: 1em; border-bottom: 1px solid #dde8f0; display: flex; justify-content: space-between; align-items: center; }
.ep-total { font-size: 1.4em; font-weight: 700; color: #007fff; }
.ep-label-sm { font-size: .72em; color: #888; text-transform: uppercase; font-weight: 600; margin-bottom: 2px; }
.ep-tech-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 8px; }
.ep-approved-badge { 
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    margin-top: 5px;
    font-family: inherit;
    display: inline-block; 
    background: #e6f4ea; 
    color: #1a7431; 
    border: 1px solid #b7dfbe; 
    font-weight: 600; 
}
.ep-approved-banner { background: #e6f4ea; border: 1px solid #b7dfbe; border-radius: 6px; padding: 14px 20px; color: #1a7431; font-weight: 600; font-size: .95em; margin-bottom: 20px; }

.line-table { width: 100%; border-collapse: collapse; font-size: .85em; }
.line-table th { background: #fafbfc; padding: 7px 12px; border-bottom: 1px solid #eef3f8; text-align: left; color: #666; font-weight: 600; font-size: .78em; text-transform: uppercase; letter-spacing: .03em; }
.line-table td { padding: 7px 12px; border-bottom: 1px solid #f0f4f8; vertical-align: top; }
.line-table tr:last-child td { border-bottom: none; }

@media (max-width: 767px) {
    .ep-card { padding: 16px; }
    .line-table { font-size: .78em; }
    .line-table th, .line-table td { padding: 6px 8px; }
}

/* ─── Invoice detail + payment form ──────────────────────────────────────────── */

.inv-pay-field {
    margin-bottom: 14px;
}

/* ─── Print styles — hide chrome, keep receipt content ───────────────────────── */

@media print {
    .headerWrapper,
    .no-print {
        display: none !important;
    }
    body {
        background: white !important;
    }
    .mainContent {
        padding: 8px !important;
        min-height: 0 !important;
    }
    .ep-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
    }
}

/* ─── Responsive ──────────────────────────────────────────────────────────────── */

@media screen and (max-width: 768px) {
    .mainContent {
        padding: 15px;
    }

    .contentTable {
        font-size: .8em;
    }

    .contentTableHeader th,
    .contentTableRow td {
        padding: 8px 10px;
    }

    /* Collapse desktop nav into hamburger on mobile */
    .headerMenu,
    .headerActions {
        display: none;
    }

    .headerHamburger {
        display: block;
    }
}
