/**
 * AT&T Seller Hub — Styles
 *
 * Brand palette (official AT&T guidelines):
 *   Primary:    AT&T Blue #067AB4, AT&T Orange #FF7200, White #FFFFFF
 *   Secondary:  Dark Blue #0C2577, Green #6EBB1F, Burgundy #B30A3C
 *   Accent:     Teal #00C7B2, Gold #FF9900, Warm Gray #CCCC99
 *   Text:       Black #000000, Gray #666666
 *   Links:      #0568AE (accessible on white)
 *
 * Typography: Verdana (web secondary per brand guidelines)
 * Spacing:    8px base unit
 */

/* =========================================================================
   RESET & BASE
   ========================================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    background: #FFFFFF;
    color: #000000;
    min-height: 100vh;
    line-height: 1.5;
}

/* =========================================================================
   LOGIN SCREEN
   ========================================================================= */

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(160deg, #0C2577 0%, #067AB4 100%);
}

.login-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 48px 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.login-logo {
    height: 48px;
    margin-bottom: 24px;
}

.login-title {
    font-size: 22px;
    font-weight: bold;
    color: #0C2577;
    margin-bottom: 8px;
}

.login-subtitle {
    color: #666666;
    font-size: 13px;
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field {
    text-align: left;
}

.login-field label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #666666;
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #CCCC99;
    border-radius: 6px;
    background: #FFFFFF;
    color: #000000;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 14px;
    transition: border-color 0.2s;
}

.login-field input:focus {
    outline: none;
    border-color: #067AB4;
    box-shadow: 0 0 0 3px rgba(6, 122, 180, 0.12);
}

.login-field input::placeholder {
    color: #999;
}

.login-error {
    display: block;
    color: #B30A3C;
    font-size: 11px;
    min-height: 18px;
    margin-top: 4px;
}

.login-btn {
    padding: 14px;
    border: none;
    border-radius: 6px;
    background: #FF7200;
    color: #FFFFFF;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.login-btn:hover {
    background: #e56600;
    transform: translateY(-1px);
}

.login-fade-out {
    animation: loginFadeOut 0.38s ease forwards;
}

@keyframes loginFadeOut {
    to { opacity: 0; transform: scale(0.98); }
}

/* =========================================================================
   APP SHELL
   ========================================================================= */

.app {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 24px 64px;
    display: none;
}

header {
    text-align: center;
    padding: 32px 0 40px;
}

.att-logo img {
    display: block;
    margin: 0 auto 16px;
}

header h1 {
    font-size: 24px;
    font-weight: bold;
    color: #0C2577;
    margin-bottom: 8px;
}

header p {
    color: #666666;
    font-size: 13px;
}

/* =========================================================================
   AVATAR HERO
   ========================================================================= */

.avatar-hero {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #0C2577;
    box-shadow: 0 4px 24px rgba(12, 37, 119, 0.15);
}

.avatar-hero-wave {
    display: none;
}

#avatar-container,
#check-avatar-container {
    width: 100%;
    height: 480px;
    background: #0C2577;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* SME overlay — trigger-based, animated entrance */
.sme-overlay {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 10;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.sme-overlay.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.sme-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: #FF7200;
    color: #FFFFFF;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    animation: sme-pulse 2.2s ease-in-out infinite;
}

.sme-btn:hover {
    background: #e56600;
    box-shadow: 0 4px 20px rgba(255, 114, 0, 0.35);
    animation: none;
}

@keyframes sme-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 114, 0, 0.4); }
    50%      { box-shadow: 0 0 0 8px rgba(255, 114, 0, 0); }
}

/* =========================================================================
   TRANSCRIPT PANEL
   ========================================================================= */

.transcript-panel {
    margin-top: 24px;
    background: #FFFFFF;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.transcript-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f8f8;
}

.transcript-header h3 {
    font-size: 13px;
    font-weight: bold;
    color: #0C2577;
}

.transcript-actions {
    display: flex;
    gap: 8px;
}

.transcript-content {
    padding: 16px 20px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

.transcript-empty {
    color: #999;
    text-align: center;
    padding: 20px 0;
    font-size: 12px;
}

.transcript-entry {
    margin-bottom: 8px;
}

.transcript-entry .speaker {
    font-weight: bold;
    margin-right: 6px;
}

.transcript-entry .speaker.avatar-speaker {
    color: #067AB4;
}

.transcript-entry .speaker.user-speaker {
    color: #0C2577;
}

/* =========================================================================
   BUTTONS
   ========================================================================= */

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover:not(:disabled) {
    background: #e4e4e4;
}

.btn-check {
    padding: 12px 28px;
    border: none;
    border-radius: 6px;
    background: #067AB4;
    color: #FFFFFF;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.btn-check:hover {
    background: #055f8f;
    transform: translateY(-1px);
}

/* =========================================================================
   KNOWLEDGE CHECK CARDS
   ========================================================================= */

.knowledge-checks {
    margin-top: 56px;
}

.knowledge-checks h2 {
    font-size: 20px;
    font-weight: bold;
    color: #0C2577;
    margin-bottom: 8px;
}

.section-subtitle {
    color: #666666;
    font-size: 13px;
    margin-bottom: 32px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.check-card {
    background: #FFFFFF;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.check-card:hover {
    border-color: #067AB4;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 122, 180, 0.12);
}

.check-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.check-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.check-card:hover .check-card-image img {
    transform: scale(1.05);
}

.check-card-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.check-card-body .product-badge {
    align-self: flex-start;
    margin-bottom: 12px;
}

.check-card h3 {
    font-size: 17px;
    font-weight: bold;
    color: #0C2577;
    margin-bottom: 8px;
}

.check-card p {
    font-size: 13px;
    color: #666666;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.check-card-cta {
    display: block;
    background: #067AB4;
    color: #FFFFFF;
    text-align: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.2s;
}

.check-card:hover .check-card-cta {
    background: #0C2577;
}

/* Hide Fiber and Contact Center cards for now (keep only Wireless) */
.check-card[data-check-id^="fiber_"],
.check-card[data-check-id^="cc_"] {
    display: none;
}

.product-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-wireless {
    background: rgba(6, 122, 180, 0.1);
    color: #067AB4;
}

.badge-fiber {
    background: rgba(110, 187, 31, 0.12);
    color: #5a9e1a;
}

.badge-cc {
    background: rgba(255, 114, 0, 0.1);
    color: #cc5b00;
}

/* =========================================================================
   KNOWLEDGE CHECK MODAL
   ========================================================================= */

.check-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(12, 37, 119, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 40px 20px;
}

.check-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.check-modal-content {
    background: #FFFFFF;
    border: 1px solid #ddd;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.check-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #0C2577;
    color: #FFFFFF;
}

.check-modal-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.check-modal-header .product-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.check-modal-header h3 {
    color: #FFFFFF;
}

.check-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}

.check-modal-close:hover {
    color: #FFFFFF;
}

.check-modal-body {
    position: relative;
}

.check-modal-body #check-avatar-container {
    height: 420px;
    border-radius: 0;
    background: #0C2577;
}

.check-transcript-panel {
    margin-top: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

/* =========================================================================
   REPORT LOADING OVERLAY
   ========================================================================= */

.report-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(12, 37, 119, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-loading-box {
    text-align: center;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 40px 48px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #067AB4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.report-loading-box p {
    font-size: 15px;
    font-weight: bold;
    color: #0C2577;
    margin-bottom: 4px;
}

.report-loading-box small {
    color: #666666;
    font-size: 12px;
}

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

.report-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(12, 37, 119, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 40px 20px;
}

.report-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.report-modal-content {
    background: #FFFFFF;
    border: 1px solid #ddd;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #0C2577;
    color: #FFFFFF;
}

.report-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-header-left h3 {
    color: #FFFFFF;
}

.report-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.report-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f8f8f8;
}

.report-close-btn {
    background: #067AB4;
    color: #FFFFFF;
}

.report-close-btn:hover {
    background: #055f8f;
}

/* Report Hero — grade circle + summary side-by-side */
.report-hero {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.report-grade-circle {
    width: 100px;
    height: 100px;
    border: 3px solid;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #FFFFFF;
}

.report-grade-letter {
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.report-grade-score {
    font-size: 14px;
    font-weight: bold;
    margin-top: 2px;
}

.report-grade-score span {
    font-size: 11px;
    opacity: 0.6;
}

.report-summary-block {
    flex: 1;
    min-width: 0;
}

.report-product-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666666;
    margin-bottom: 6px;
}

.report-summary-text {
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 10px;
}

.report-meta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.meta-chip {
    font-size: 11px;
    color: #666666;
    background: #f4f4f4;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.meta-chip strong {
    color: #000;
    text-transform: capitalize;
}

/* Readiness badge */
.readiness-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 8px;
}

.badge-ready {
    background: rgba(110, 187, 31, 0.12);
    color: #4d8a14;
}

.badge-review {
    background: rgba(255, 153, 0, 0.12);
    color: #b37300;
}

.badge-not-ready {
    background: rgba(179, 10, 60, 0.1);
    color: #B30A3C;
}

/* Report 2x2 card grid */
.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.report-card {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
}

.report-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.report-card-header span {
    font-size: 16px;
}

.report-card-header h4 {
    font-size: 12px;
    font-weight: bold;
    color: #0C2577;
    margin: 0;
}

.report-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.report-card-list li {
    font-size: 12px;
    color: #333;
    padding: 4px 0;
    line-height: 1.5;
    border-bottom: 1px solid #ececec;
}

.report-card-list li:last-child {
    border-bottom: none;
}

.report-empty-item {
    color: #999;
    font-style: italic;
}

.priority-tag {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 4px;
}

.priority-high {
    background: rgba(179, 10, 60, 0.1);
    color: #B30A3C;
}

.priority-medium {
    background: rgba(255, 153, 0, 0.1);
    color: #b37300;
}

.priority-low {
    background: rgba(110, 187, 31, 0.1);
    color: #4d8a14;
}

/* Question breakdown with star ratings */
.question-breakdown {
    margin-bottom: 16px;
}

.question-breakdown h4 {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666666;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.question-item {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid transparent;
}

.question-item.q-strong {
    background: rgba(110, 187, 31, 0.06);
    border-left-color: #6EBB1F;
}

.question-item.q-adequate {
    background: rgba(255, 153, 0, 0.06);
    border-left-color: #FF9900;
}

.question-item.q-weak {
    background: rgba(179, 10, 60, 0.06);
    border-left-color: #B30A3C;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-num {
    font-size: 11px;
    font-weight: bold;
    color: #067AB4;
    min-width: 24px;
}

.question-label {
    flex: 1;
    font-size: 12px;
    color: #333;
}

.question-stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 14px;
    color: #ddd;
}

.star.star-on {
    color: #FF9900;
}

.question-feedback {
    font-size: 11px;
    color: #666666;
    margin-top: 6px;
    padding-left: 34px;
    line-height: 1.5;
}

/* =========================================================================
   SME TOAST NOTIFICATION
   ========================================================================= */

.sme-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(24px);
    z-index: 400;
    background: #FFFFFF;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 28px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(6, 122, 180, 0.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.sme-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.sme-toast-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sme-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(6, 122, 180, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sme-toast-title {
    font-size: 14px;
    font-weight: bold;
    color: #0C2577;
}

.sme-toast-body {
    font-size: 12px;
    color: #666666;
    line-height: 1.5;
}

.sme-toast-progress {
    height: 3px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 14px;
    overflow: hidden;
}

.sme-toast-progress-bar {
    height: 100%;
    background: #067AB4;
    border-radius: 2px;
    width: 100%;
    /* Duration must match SME_TOAST_DURATION_MS in att-demo.js */
    animation: sme-toast-countdown 4s linear forwards;
}

@keyframes sme-toast-countdown {
    from { width: 100%; }
    to   { width: 0%; }
}

/* =========================================================================
   SCROLLBAR
   ========================================================================= */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 768px) {
    #avatar-container {
        height: 360px;
    }

    .check-modal-body #check-avatar-container {
        height: 320px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .report-modal-content {
        max-width: 100%;
    }

    .report-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .report-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 36px 24px;
    }
}
