/*
 * DooTee Account UI V1
 * Independent from terrain/map UI.
 */

#dooteeAccountRoot {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.dootee-account-login-btn,
.dootee-account-user-btn {
    min-height: 38px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 10px;
    padding: 7px 12px;
    background: rgba(255,255,255,.06);
    color: inherit;
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background .15s ease,
        border-color .15s ease;
}

.dootee-account-login-btn:hover,
.dootee-account-user-btn:hover {
    background: rgba(255,255,255,.11);
    border-color: rgba(255,255,255,.28);
}

.dootee-account-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dootee-account-credit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.dootee-account-name {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dootee-account-caret {
    opacity: .7;
    font-size: 11px;
}

/* =========================================================
   MODAL
   ========================================================= */

.dootee-account-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0,0,0,.58);
    backdrop-filter: blur(3px);
}

.dootee-account-overlay.is-open {
    display: flex;
}

.dootee-account-modal {
    position: relative;
    width: min(420px, 100%);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    padding: 24px;
    background: #0d2029;
    color: #f4f8fa;
    box-shadow: 0 24px 70px rgba(0,0,0,.45);
}

.dootee-account-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 23px;
    cursor: pointer;
}

.dootee-account-close:hover {
    background: rgba(255,255,255,.08);
}

.dootee-account-title {
    margin: 0 42px 4px 0;
    font-size: 23px;
    line-height: 1.3;
}

.dootee-account-subtitle {
    margin: 0 0 20px;
    color: rgba(255,255,255,.68);
    font-size: 13px;
}

/* Google */

.dootee-google-wrap {
    min-height: 42px;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

/* Divider */

.dootee-account-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: rgba(255,255,255,.5);
    font-size: 12px;
}

.dootee-account-divider::before,
.dootee-account-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(255,255,255,.11);
}

/* Form */

.dootee-account-form {
    display: grid;
    gap: 13px;
}

.dootee-account-field {
    display: grid;
    gap: 6px;
}

.dootee-account-field label {
    font-size: 13px;
    font-weight: 600;
}

.dootee-account-field input {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    padding: 0 12px;
    outline: none;
    background: rgba(255,255,255,.055);
    color: #fff;
    font: inherit;
}

.dootee-account-field input:focus {
    border-color: rgba(255,255,255,.42);
}

.dootee-account-submit {
    height: 44px;
    margin-top: 3px;
    border: 0;
    border-radius: 10px;
    background: #e9f4f7;
    color: #0b1d24;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.dootee-account-submit:disabled {
    cursor: wait;
    opacity: .65;
}

.dootee-account-switch {
    margin-top: 17px;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,.72);
}

.dootee-account-switch button {
    border: 0;
    padding: 2px 4px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Status */

.dootee-account-status {
    display: none;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.45;
}

.dootee-account-status.is-visible {
    display: block;
}

.dootee-account-status.error {
    background: rgba(210,70,70,.14);
    border: 1px solid rgba(255,100,100,.24);
}

.dootee-account-status.success {
    background: rgba(70,190,120,.12);
    border: 1px solid rgba(100,220,145,.22);
}

/* =========================================================
   USER MENU
   ========================================================= */

.dootee-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 2147482000;
    display: none;
    width: 260px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 13px;
    background: #0d2029;
    color: #f4f8fa;
    box-shadow: 0 18px 50px rgba(0,0,0,.4);
}

.dootee-user-menu.is-open {
    display: block;
}

.dootee-user-menu-head {
    padding: 14px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}

.dootee-user-menu-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dootee-user-menu-email {
    margin-top: 3px;
    color: rgba(255,255,255,.59);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dootee-user-menu-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 14px;
}

.dootee-user-stat {
    padding: 9px;
    border-radius: 9px;
    background: rgba(255,255,255,.05);
}

.dootee-user-stat-label {
    display: block;
    margin-bottom: 2px;
    color: rgba(255,255,255,.55);
    font-size: 11px;
}

.dootee-user-stat-value {
    font-size: 14px;
    font-weight: 700;
}

.dootee-user-logout {
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(255,255,255,.09);
    padding: 12px 14px;
    text-align: left;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.dootee-user-logout:hover {
    background: rgba(255,255,255,.06);
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    #dooteeAccountRoot {
        order: 99;
    }

    .dootee-account-login-btn {
        min-height: 34px;
        padding: 6px 9px;
        font-size: 12px;
    }

    .dootee-account-user-btn {
        min-height: 34px;
        padding: 5px 8px;
        gap: 5px;
        font-size: 12px;
    }

    .dootee-account-name {
        display: none;
    }

    .dootee-account-credit {
        font-size: 12px;
    }

    .dootee-account-modal {
        padding: 21px 18px;
        border-radius: 15px;
    }

    .dootee-user-menu {
        position: fixed;
        top: auto;
        right: 10px;
        bottom: 12px;
        left: 10px;
        width: auto;
    }
}

@media (max-width: 380px) {

    .dootee-account-login-btn {
        padding-left: 7px;
        padding-right: 7px;
    }
}

/* ============================================================
   DOOTEE ACCOUNT V1.1 — ALWAYS VISIBLE
   ============================================================ */

#dooteeAccountRoot {
    position: fixed !important;
    top: 18px !important;
    right: 390px !important;

    z-index: 2147482500 !important;

    display: flex !important;
    align-items: center !important;

    width: auto !important;
    height: auto !important;

    margin: 0 !important;

    visibility: visible !important;
    opacity: 1 !important;

    pointer-events: auto !important;
}

/*
 * Make the account button readable over satellite imagery.
 */
#dooteeAccountRoot .dootee-account-login-btn,
#dooteeAccountRoot .dootee-account-user-btn {
    background: rgba(8, 47, 56, .94) !important;
    border: 1px solid rgba(94, 214, 225, .55) !important;
    color: #ffffff !important;

    box-shadow:
        0 4px 15px rgba(0,0,0,.28) !important;

    backdrop-filter: blur(8px);
}

/* Tablet */
@media (max-width: 1100px) {

    #dooteeAccountRoot {
        right: 78px !important;
        top: 14px !important;
    }
}

/* Mobile */
@media (max-width: 767px) {

    #dooteeAccountRoot {
        top: 10px !important;
        right: auto !important;
        left: 50% !important;

        transform: translateX(-50%) !important;
    }

    #dooteeAccountRoot .dootee-account-login-btn,
    #dooteeAccountRoot .dootee-account-user-btn {
        min-height: 38px !important;
    }
}

/* Very small phones */
@media (max-width: 420px) {

    #dooteeAccountRoot {
        top: 8px !important;
    }

    #dooteeAccountRoot .dootee-account-login-btn {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
}

/* ============================================================
   DOOTEE ACCOUNT PROJECT PANEL V2
   ============================================================ */

#dooteeUserMenu.dootee-user-menu {
    width: 340px;
    max-height: min(72vh, 680px);
    overflow-y: auto;
}

.dootee-project-panel-v2 {
    border-top: 1px solid rgba(255,255,255,.09);
}

.dootee-project-section {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.dootee-project-label {
    display: block;
    margin-bottom: 5px;
    color: rgba(255,255,255,.58);
    font-size: 11px;
}

.dootee-project-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#dooteePanelCredits {
    font-size: 19px;
    line-height: 1;
}

.dootee-buy-credit-btn {
    border: 1px solid rgba(88,210,150,.35);
    border-radius: 8px;
    padding: 7px 9px;
    background: rgba(55,190,115,.12);
    color: #dfffee;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.dootee-buy-credit-btn:hover {
    background: rgba(55,190,115,.20);
}

.dootee-current-project-name {
    min-height: 20px;
    margin-bottom: 9px;
    font-size: 14px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.dootee-save-project-btn {
    width: 100%;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: #e9f4f7;
    color: #09202a;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.dootee-save-project-btn:disabled {
    cursor: wait;
    opacity: .65;
}

.dootee-project-message {
    display: none;
    margin-top: 8px;
    padding: 7px 8px;
    border-radius: 7px;
    font-size: 11px;
    line-height: 1.4;
}

.dootee-project-message.is-visible {
    display: block;
}

.dootee-project-message.success {
    background: rgba(70,190,120,.12);
}

.dootee-project-message.error {
    background: rgba(210,70,70,.15);
}

.dootee-project-message.info {
    background: rgba(70,150,210,.12);
}

.dootee-project-list-title {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
}

.dootee-project-search {
    box-sizing: border-box;
    width: 100%;
    height: 36px;
    margin-bottom: 9px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 8px;
    padding: 0 10px;
    outline: none;
    background: rgba(255,255,255,.05);
    color: #fff;
    font: inherit;
    font-size: 12px;
}

.dootee-project-search:focus {
    border-color: rgba(255,255,255,.35);
}

.dootee-project-list {
    display: grid;
    gap: 6px;
    max-height: 235px;
    overflow-y: auto;
}

.dootee-project-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 4px;
    align-items: stretch;
}

.dootee-project-open {
    min-width: 0;
    border: 0;
    border-radius: 8px;
    padding: 8px 9px;
    text-align: left;
    background: rgba(255,255,255,.045);
    color: inherit;
    cursor: pointer;
}

.dootee-project-open:hover {
    background: rgba(255,255,255,.085);
}

.dootee-project-item-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
}

.dootee-project-item-date {
    display: block;
    margin-top: 2px;
    color: rgba(255,255,255,.48);
    font-size: 10px;
}

.dootee-project-delete {
    border: 0;
    border-radius: 8px;
    background: rgba(205,70,70,.10);
    color: rgba(255,255,255,.72);
    font-size: 18px;
    cursor: pointer;
}

.dootee-project-delete:hover {
    background: rgba(205,70,70,.23);
}

.dootee-project-empty {
    padding: 10px;
    text-align: center;
    color: rgba(255,255,255,.48);
    font-size: 11px;
}

#dooteeUserMenu .dootee-user-logout {
    position: sticky;
    bottom: 0;
    background: #0d2029;
}

@media (max-width: 767px) {

    #dooteeUserMenu.dootee-user-menu {
        width: auto;
        max-height: 72dvh;
    }

    .dootee-project-list {
        max-height: 180px;
    }
}
