﻿/* About — the logged-in user's account details (Pages/About.razor).

   Container geometry copied from CompanySetting.css so the two sidebar pages sit in the same
   place: a fixed frame inset from the sidebar, which shifts left when the sidebar collapses to
   icons (4.5rem, see SidebarLayout.razor.css).

   Everything is prefixed .about-, which no other stylesheet in wwwroot/css uses — index.html
   loads all of them globally with no isolation, so an unprefixed .about-row or .about-label
   would reach every other page. */

.about-container {
    position: fixed;
    top: 4rem;
    bottom: 4rem;
    left: 14rem;
    right: 0;
    transition: left 0.2s ease;
    overflow-y: auto;
    padding: 0 10px 10px;
    box-sizing: border-box;
}

.about-container.sidebar-collapsed {
    left: 5rem;
}

.about-card {
    background: #fff;
    border: 1px solid #e3e9f0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    max-width: 620px;
    padding: 0 0 16px;
    overflow: hidden;
}

.about-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #f9fcff;
    border-bottom: 1px solid #cfd8e3;
}

.about-avatar-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    fill: #007BFF;
}

.about-card-name {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    line-height: 1.3;
}

.about-card-sub {
    font-size: 11px;
    color: #888;
}

/* Label/value pairs as a two-column grid rather than a table: the labels then share one column
   width and the values all start on the same line, which a table of <td>s only manages if every
   row is present — and several of these rows are conditional. */
.about-rows {
    display: grid;
    grid-template-columns: 150px 1fr;
    padding: 6px 18px 0;
}

.about-row {
    display: contents;
}

.about-label,
.about-value {
    padding: 9px 0;
    border-bottom: 1px solid #f0f4f8;
    font-size: 13px;
    min-width: 0;
}

.about-label {
    color: #666;
    font-weight: bold;
    padding-right: 10px;
}

.about-value {
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    /* Long e-mail addresses have no space to break at, and this card is narrow. */
    overflow-wrap: anywhere;
}

/* Last pair carries no rule, so the card does not end on a stray line. */
.about-rows .about-row:last-child .about-label,
.about-rows .about-row:last-child .about-value {
    border-bottom: none;
}

.about-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    text-transform: capitalize;
}

.about-badge.ok {
    background: #e7f6ec;
    color: #1b7a3d;
}

.about-badge.warn {
    background: #fff4e0;
    color: #a25f00;
}

.about-badge.bad {
    background: #fdecee;
    color: #b3261e;
}

.about-note {
    display: block;
    padding: 12px 18px 0;
    font-size: 12px;
    color: #666;
}

.about-note-error {
    color: #b3261e;
}

.about-retry-btn {
    margin: 12px 18px 0;
    height: 30px;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 600;
    font-family: sans-serif;
    color: #fff;
    background: #007BFF;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.about-retry-btn:hover {
    background: #0069d9;
}

/* Below this the sidebar is an overlay rather than a column (SidebarLayout.razor.css), so the
   page takes the full width and the label column stops being worth its 150px. */
@media (max-width: 700px) {
    .about-container,
    .about-container.sidebar-collapsed {
        left: 0;
    }

    .about-rows {
        grid-template-columns: 1fr;
        padding: 6px 14px 0;
    }

    .about-label {
        padding: 9px 0 0;
        border-bottom: none;
        font-size: 11px;
        color: #888;
    }

    .about-value {
        padding: 0 0 9px;
    }
}

/*======================================== Google Drive card ====================================*/
/* The second card on the page: the app's link to a Google ACCOUNT, as opposed to the user's own
   record above. It reuses .about-card, .about-rows and .about-badge unchanged — only the head
   icon and the two action buttons are new. */

.about-drive-card {
    margin-top: 14px;
}

/* The Drive glyph is a full-colour logo, so unlike .about-avatar-icon it must not be tinted. */
.about-drive-icon {
    width: 34px;
    height: 31px;
    flex: none;
    margin-left: 3px;
}

.about-drive-actions {
    display: flex;
    gap: 10px;
    padding: 4px 16px 0;
}

/* Same 34px pill as .about-retry-btn, in the two meanings this card needs: delinking is
   destructive enough to be red, connecting is the ordinary primary action. */
.about-delink-btn,
.about-reconnect-btn {
    height: 34px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1.5px solid transparent;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.about-delink-btn {
    border-color: #f0c8c2;
    background: #fdecea;
    color: #c0392b;
}

.about-delink-btn:hover:not(:disabled) {
    background: #fbdad5;
    border-color: #e6b8b2;
}

.about-reconnect-btn {
    border-color: #2f6fed;
    background: #2f6fed;
    color: #fff;
}

.about-reconnect-btn:hover:not(:disabled) {
    background: #2560d6;
    border-color: #2560d6;
}

.about-delink-btn:disabled,
.about-reconnect-btn:disabled {
    opacity: .6;
    cursor: default;
}

/* --- Two columns (user | Drive + balance) so the page fits a screen without scrolling ---------- */
.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 620px));
    gap: 14px;
    align-items: start;
}

.about-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* The column gap does the spacing now; the Drive card's own top margin would double it. */
.about-grid .about-drive-card {
    margin-top: 0;
}

/* Buy History sits under both columns and spans them: the grid's full width rather than one
   card's 620px. In the one-column layout below 1100px it is simply the last card. */
.about-grid .about-buy-card {
    grid-column: 1 / -1;
    max-width: none;
}

@media (max-width: 1100px) {
    .about-grid {
        grid-template-columns: minmax(0, 620px);
    }
}

/* /main/about - the same panel on the company list (Main.razor), whose sidebar and top bar sit
   where .sub-container-main says they do (Subscription.css), not where SidebarLayout's do. */
.about-container.about-container-main {
    top: 3rem;
    bottom: 0.6rem;
    left: 14.5rem;
    right: 0.6rem;
    padding: 0 0 10px;
}

.about-container.about-container-main.sidebar-collapsed {
    left: 5.5rem;
}

@media (max-width: 700px) {
    .about-container.about-container-main,
    .about-container.about-container-main.sidebar-collapsed {
        top: 5rem;
        left: 0.6rem;
    }
}
