﻿/* ============================================
   TOYOTA QUOTE SYSTEM - BASE STYLES
   Common structure, layout, and animations
   ============================================ */

/* ============================================
   BASE LAYOUT
   ============================================ */
.qp-quote-page {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER SECTION
   ============================================ */
.qp-quote-header {
    padding: 0.75rem;
}

.qp-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .qp-header-content.qp-sticky {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 0;
        padding: 0.75rem 1.25rem;
        border: none;
        animation: qp-slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
    }

/* Quote Number Badge */
.qp-quote-number {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .qp-quote-number:hover {
        transform: translateY(-2px);
    }

/* Broker Info */
.qp-broker-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.qp-consultant-info {
    display: flex;
    align-items: center;
    padding-left: 0.75rem;
    margin-left: 0.75rem;
    font-size: 0.875rem;
}

.qp-consultant-code {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    font-weight: 600;
}

/* ============================================
   MAIN CONTENT LAYOUT
   ============================================ */
.qp-quote-content {
    flex: 1;
    overflow: hidden;
    padding: 0.75rem;
}

.qp-quote-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 0.75rem;
    height: 100%;
    margin: 0 auto;
}

    /* Collapsed States */
    .qp-quote-grid.left-collapsed {
        grid-template-columns: 60px 1fr;
    }

    .qp-quote-grid.right-collapsed {
        grid-template-columns: 400px 60px;
    }

    .qp-quote-grid.left-collapsed.right-collapsed {
        grid-template-columns: 60px 1fr 60px;
    }

/* ============================================
   PANELS
   ============================================ */
.qp-left-panel,
.qp-right-panel {
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.qp-panel-header {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .qp-panel-header h3 {
        margin: 0;
        font-size: 1.125rem;
        font-weight: 700;
    }

.qp-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* Collapse Button */
.qp-btn-collapse {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

/* Collapsed Indicators */
.qp-collapsed-indicator {
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

    .qp-collapsed-indicator i {
        font-size: 1.5rem;
        writing-mode: horizontal-tb;
    }

    .qp-collapsed-indicator span {
        font-weight: 600;
        font-size: 0.875rem;
    }

/* ============================================
   TABS
   ============================================ */
.qp-tab-buttons {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.qp-tab-button {
    padding: 0.625rem 1.125rem;
    font-size: 0.875rem;
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 600;
}

.qp-tab-content {
    flex: 1;
    overflow-y: auto;
}

/* ============================================
   VALIDATION CONTAINER
   ============================================ */
.qp-quote-validation-container {
    border-radius: 0.75rem;
    overflow: hidden;
    margin: 1rem;
}

.qp-quote-validation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
}

.qp-quote-validation-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .qp-quote-validation-icon-wrapper i {
        font-size: 1.25rem;
    }

.qp-quote-validation-header-text h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.qp-quote-validation-header-text p {
    margin: 0.5rem 0 0;
    font-size: 0.9375rem;
}

.qp-quote-validation-body {
    padding: 1.5rem;
}

.qp-quote-validation-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.qp-quote-validation-field-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    animation: qp-slideIn 0.3s ease-out forwards;
    animation-delay: calc(var(--animation-order) * 0.1s);
    opacity: 0;
}

.qp-quote-validation-field-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .qp-quote-validation-field-icon i {
        font-size: 1rem;
    }

.qp-quote-validation-field-text {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes qp-slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes qp-slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes qp-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes qp-toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes qp-toast-progress {
    from {
        width: 100%;
    }

    to {
        width: 0;
    }
}

@keyframes pulse-marker {
    0%, 100% {
        box-shadow: 0 0 20px rgba(235, 10, 30, 0.6);
    }

    50% {
        box-shadow: 0 0 30px rgba(235, 10, 30, 0.8);
    }
}

/* ============================================
   MODAL STRUCTURE
   ============================================ */
.qp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: qp-fadeIn 0.2s ease-out;
}

.qp-modal {
    border-radius: 0.75rem;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: qp-slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
}

.qp-modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

    .qp-modal-title h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 700;
    }

    .qp-modal-title i {
        font-size: 1.125rem;
    }

.qp-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.qp-modal-footer {
    padding: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.qp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.qp-btn-icon {
    padding: 0.625rem;
    width: 40px;
    height: 40px;
    justify-content: center;
}

.qp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.qp-form-group {
    margin-bottom: 1.25rem;
}

    .qp-form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.9375rem;
        font-weight: 600;
    }

.qp-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

    .qp-form-control:focus {
        outline: none;
    }

.form-select,
.form-control {
    transition: all 0.2s ease;
}

    .form-select:focus,
    .form-control:focus {
        outline: none;
    }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.qp-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
    pointer-events: none;
}

.qp-toast {
    display: flex;
    align-items: center;
    min-width: 300px;
    max-width: 400px;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    pointer-events: auto;
    animation: qp-toast-slide-in 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.qp-toast-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qp-toast-content {
    flex: 1;
}

.qp-toast-message {
    line-height: 1.5;
    font-weight: 500;
}

.qp-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: qp-toast-progress linear forwards;
}

/* ============================================
   QUOTE DETAILS STRUCTURE
   ============================================ */
.products-container {
    padding: 1.5rem;
}

.section-header {
    margin-bottom: 1.5rem;
}

    .section-header h2 {
        font-size: 1.5rem;
        font-weight: 700;
        margin: 0 0 0.5rem;
    }

    .section-header p {
        margin: 0;
        font-size: 0.9375rem;
    }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.product-card-main {
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .product-card-main .icon-container {
        width: 48px;
        height: 48px;
        border-radius: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1rem;
    }

        .product-card-main .icon-container i {
            font-size: 1.5rem;
        }

    .product-card-main .product-title {
        font-size: 1.125rem;
        font-weight: 700;
        margin: 0 0 0.5rem;
    }

    .product-card-main .product-description {
        font-size: 0.9375rem;
        line-height: 1.5;
        margin: 0;
    }

.qd-container {
    padding: 1.5rem;
}

.qd-header {
    margin-bottom: 2rem;
}

.qd-section-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.qd-section-title p {
    margin: 0;
    font-size: 0.9375rem;
}

.qd-unsaved-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.qd-unsaved-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qd-unsaved-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.qd-unsaved-message {
    font-size: 0.875rem;
    margin: 0;
}

.qd-item-card {
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.qd-item-header {
    padding: 1rem 1.5rem;
}

.qd-item-type {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.qd-vehicle-info,
.qd-motorcycle-info,
.qd-household-info {
    padding: 1.5rem;
}

    .qd-vehicle-info h3,
    .qd-motorcycle-info h3,
    .qd-household-info h3 {
        font-size: 1.25rem;
        font-weight: 700;
        margin: 0 0 0.5rem;
    }

.qd-variant {
    font-size: 0.9375rem;
    margin: 0 0 1rem;
}

.qd-label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.qd-value {
    font-size: 1rem;
    font-weight: 700;
}

.qd-summary-panel {
    border-radius: 0.75rem;
    overflow: hidden;
    position: sticky;
    top: 1rem;
}

.qd-summary-header {
    padding: 1.25rem 1.5rem;
}

    .qd-summary-header h3 {
        margin: 0;
        font-size: 1.125rem;
        font-weight: 700;
    }

.qd-summary-row,
.qd-summary-total {
    padding: 1rem 1.5rem;
}

.qd-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 0.75rem;
}

.qd-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

    .qd-empty-icon i {
        font-size: 2rem;
    }

.qd-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.qd-empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Status Badges */
.qd-status {
    border-radius: 9999px;
    padding: 0.375rem 0.875rem;
    font-weight: 600;
    display: inline-block;
}

/* History Timeline */
.qp-history-timeline {
    position: relative;
}

    .qp-history-timeline::before {
        content: '';
        position: absolute;
        left: 19px;
        top: 0;
        bottom: 0;
        width: 2px;
    }

.qp-timeline-item {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 2rem;
}

.qp-timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.qp-timeline-content {
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.qp-version-number {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.qp-version-date,
.qp-version-author {
    font-size: 0.875rem;
    margin: 0;
}

.qp-change-item {
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.75rem;
    transition: all 0.2s ease;
}

.qp-change-icon {
    width: 32px;
    height: 32px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.qp-change-description {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.qp-old-value,
.qp-new-value {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.qp-change-meta {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

/* Back Button */
.back-button {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* ============================================
   SCROLLBAR
   ============================================ */
.qp-panel-content::-webkit-scrollbar,
.qp-tab-content::-webkit-scrollbar,
.qp-modal-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.qp-panel-content::-webkit-scrollbar-track,
.qp-tab-content::-webkit-scrollbar-track,
.qp-modal-body::-webkit-scrollbar-track {
    border-radius: 4px;
}

.qp-panel-content::-webkit-scrollbar-thumb,
.qp-tab-content::-webkit-scrollbar-thumb,
.qp-modal-body::-webkit-scrollbar-thumb {
    border-radius: 4px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .qp-quote-grid {
        grid-template-columns: 350px 1fr;
    }
}

@media (max-width: 768px) {
    .qp-quote-grid {
        grid-template-columns: 1fr;
    }

        .qp-quote-grid.left-collapsed,
        .qp-quote-grid.right-collapsed {
            grid-template-columns: 1fr;
        }

    .qp-collapsed-indicator {
        display: none;
    }

    .qp-header-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .qp-tab-buttons {
        width: 100%;
    }

    .qp-tab-button {
        flex: 1;
        justify-content: center;
    }

    .qp-toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .qp-toast {
        min-width: 0;
        width: 100%;
    }

    .qp-panel-header {
        padding: 1rem;
    }

    .qp-panel-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .qp-tab-button span {
        display: none;
    }

    .qp-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .qp-btn,
    .qp-tab-buttons {
        display: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .qp-timeline-item.qp-active .qp-timeline-marker {
        animation: none;
    }
}

.qp-modal *:focus-visible {
    outline-offset: 2px;
}
