﻿/* ============================================
   MAPPINGS - BASE STYLES
   Toyota Professional Insurance Interface
   ============================================ */

/* Container & Layout */
.dashboard-container {
    padding: 2rem;
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Dashboard Header */
.dashboard-header {
    border-radius: 1rem;
    padding: 3rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

    .dashboard-header::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 200px;
        height: 200px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        transform: translate(50px, -50px);
    }

.header-content {
    position: relative;
    z-index: 1;
}

.dashboard-header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .dashboard-header h1 i {
        font-size: 2.2rem;
    }

.dashboard-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
}

/* Dashboard Content */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Dashboard Cards */
.dashboard-card {
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-header {
    padding: 1.5rem 2rem;
}

.expandable-header {
    cursor: pointer;
    user-select: none;
}

    .expandable-header:hover {
        opacity: 0.9;
    }

    .expandable-header.expanded {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

    .card-header h2 i {
        font-size: 1.1rem;
    }

.header-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.toggle-icon {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.card-content {
    padding: 2rem;
    animation: slideDown 0.3s ease-out;
}

/* Toolbar Section */
.toolbar-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-card {
    flex: 1;
    min-width: 300px;
}

    .search-card.compact {
        max-width: 400px;
    }

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

    .search-input:focus {
        outline: none;
    }

.search-btn {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Loading State */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    border-radius: 0.75rem;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    font-size: 1.1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 0.75rem;
}

    .empty-state i {
        margin-bottom: 1.5rem;
        opacity: 0.5;
    }

    .empty-state h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .empty-state p {
        font-size: 1rem;
    }

/* Pagination */
.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

    .pagination-section.top {
        margin-bottom: 1.5rem;
    }

    .pagination-section.bottom {
        margin-top: 1.5rem;
    }

.pagination-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.results-text {
    font-size: 0.9rem;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .page-size-selector label {
        font-size: 0.875rem;
        font-weight: 500;
    }

.page-size-select {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
}

    .page-size-select:focus {
        outline: none;
    }

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Table Styles */
.desktop-view {
    display: block;
}

.table-container {
    overflow-x: auto;
    border-radius: 0.75rem;
}

.performance-table {
    width: 100%;
    border-collapse: collapse;
}

    .performance-table thead tr {
        border-bottom: 2px solid;
    }

    .performance-table th {
        padding: 1rem 1.5rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .performance-table td {
        padding: 1.25rem 1.5rem;
        vertical-align: middle;
    }

    .performance-table tbody tr {
        transition: all 0.2s ease;
    }

        .performance-table tbody tr.already-added {
            opacity: 0.7;
        }

.vehicle-make {
    min-width: 200px;
}

.vehicle-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vehicle-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.vehicle-info span {
    font-weight: 500;
}

.vehicle-model,
.vehicle-variant,
.vehicle-year {
    font-weight: 500;
}

.mm-code {
    font-family: monospace;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
}

.date-info .date-value {
    font-size: 0.9rem;
}

.action-buttons-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Mobile Card View */
.mobile-view {
    display: none;
}

.vehicle-cards {
    display: grid;
    gap: 1.5rem;
}

.vehicle-card {
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

    .vehicle-card:hover {
        transform: translateY(-2px);
    }

.vehicle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

    .vehicle-card-header .vehicle-info {
        align-items: flex-start;
    }

.vehicle-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vehicle-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.vehicle-variant {
    font-size: 0.9rem;
}

.risk-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid;
}

.vehicle-card-body {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vehicle-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
}

.vehicle-card-footer {
    padding-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

    .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-text {
    display: inline;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Dialog Overlay */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.dialog-content {
    border-radius: 0.75rem;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
}

    .dialog-header h3 {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin: 0;
        font-size: 1.25rem;
        font-weight: 700;
    }

        .dialog-header h3 i {
            font-size: 1.125rem;
        }

.dialog-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.dialog-footer {
    padding: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.9375rem;
        font-weight: 600;
    }

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

    .form-control:focus {
        outline: none;
    }

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    border-radius: 0.75rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

    .modal-content.modal-lg {
        max-width: 800px;
    }

    .modal-content.modal-confirm {
        max-width: 400px;
    }

.modal-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-header h3 {
        font-size: 1.25rem;
        font-weight: 600;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: white;
    }

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    border-radius: 0.75rem;
    min-width: 320px;
    max-width: 480px;
    animation: slideInRight 0.3s ease-out;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.toast-text {
    font-size: 0.875rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    color: inherit;
    opacity: 0.7;
}

    .toast-close:hover {
        opacity: 1;
        background: rgba(0, 0, 0, 0.1);
    }

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-header {
    margin-bottom: 1rem;
}

    .search-header h4 {
        font-size: 1.1rem;
        font-weight: 600;
        margin: 0 0 0.5rem 0;
    }

.search-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

/* Search Results */
.search-results {
    margin-top: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

    .results-header h4 {
        font-size: 1.1rem;
        font-weight: 600;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

.search-table th i {
    margin-right: 0.5rem;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Bulk Add Styles */
.bulk-add-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid;
}

.bulk-add-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.bulk-select-controls {
    display: flex;
    gap: 0.5rem;
}

.variants-selection-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.variants-table {
    margin-bottom: 0;
}

    .variants-table tbody tr {
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .variants-table input[type="checkbox"] {
        width: 16px;
        height: 16px;
        cursor: pointer;
    }

.selection-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid;
    font-weight: 500;
}

    .selection-summary i {
        font-size: 1.1rem;
    }

/* Confirmation Modal */
.confirmation-message {
    text-align: center;
}

.confirmation-details {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid;
}

    .confirmation-details .vehicle-info {
        justify-content: center;
    }

    .confirmation-details .vehicle-details {
        text-align: center;
    }

        .confirmation-details .vehicle-details strong {
            font-size: 1.1rem;
        }

    .confirmation-details .mm-code {
        margin-top: 0.5rem;
        display: block;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .dashboard-header {
        padding: 2rem 1.5rem;
    }

        .dashboard-header h1 {
            font-size: 2rem;
        }

    .toolbar-section {
        flex-direction: column;
        align-items: stretch;
    }

    .search-card {
        max-width: none;
    }

    .action-buttons {
        width: 100%;
    }

        .action-buttons .btn {
            flex: 1;
        }

    .pagination-section {
        flex-direction: column;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
    }

    .desktop-view {
        display: none;
    }

    .mobile-view {
        display: block;
    }

    .btn-text {
        display: none;
    }

    .dialog-content,
    .modal-content {
        margin: 0.5rem;
        max-width: none;
    }

    .bulk-add-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .bulk-select-controls {
        justify-content: center;
    }

    .action-buttons-group {
        flex-direction: column;
        gap: 0.25rem;
    }

        .action-buttons-group .btn {
            width: 100%;
            justify-content: center;
        }

    .variants-selection-container {
        max-height: 300px;
    }

    .toast-notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 1.75rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .pagination-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .bulk-add-info {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }

    .selection-summary {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }
}
