/**
 * TINDA INTELLIGENT PART REQUEST - PREMIUM UI STYLES
 * Dark TINDA LUX Theme
 * Tesla × Amazon × Mercedes Design Language
 */

/* ===== MODAL OVERLAY & CONTAINER ===== */
.tinda-intelligent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tinda-intelligent-modal.active {
    opacity: 1;
    pointer-events: all;
}

.tinda-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.tinda-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(220, 20, 60, 0.3),
                0 0 100px rgba(220, 20, 60, 0.1);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(220, 20, 60, 0.2);
}

.tinda-intelligent-modal.active .tinda-modal-container {
    transform: translate(-50%, -50%) scale(1);
}

/* ===== HEADER ===== */
.tinda-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    background: rgba(220, 20, 60, 0.05);
    border-bottom: 1px solid rgba(220, 20, 60, 0.1);
}

.tinda-modal-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #DC143C;
    font-size: 18px;
    font-weight: 600;
}

.tinda-modal-logo i {
    font-size: 24px;
    animation: ipr-pulse 2s infinite;
}

@keyframes ipr-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.tinda-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tinda-modal-close:hover {
    background: rgba(220, 20, 60, 0.1);
    color: #DC143C;
    transform: rotate(90deg);
}

/* ===== PROGRESS BAR ===== */
.tinda-modal-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #DC143C, #FF1744);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: ipr-shimmer 2s infinite;
}

@keyframes ipr-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== BODY ===== */
.tinda-modal-body {
    padding: 32px 28px;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
    color: #fff;
}

.tinda-modal-body::-webkit-scrollbar {
    width: 6px;
}

.tinda-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.tinda-modal-body::-webkit-scrollbar-thumb {
    background: rgba(220, 20, 60, 0.5);
    border-radius: 3px;
}

.tinda-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(220, 20, 60, 0.7);
}

/* ===== STEP STYLING ===== */
.tinda-step {
    animation: ipr-slideIn 0.4s ease-out;
}

@keyframes ipr-slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tinda-step h2 {
    color: #fff;
    font-size: 26px;
    margin-bottom: 12px;
    font-weight: 700;
}

.step-description {
    color: #aaa;
    font-size: 15px;
    margin-bottom: 28px;
    line-height: 1.6;
}

/* ===== VEHICLE CONFIRMATION ===== */
.vehicle-card-display {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: rgba(220, 20, 60, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(220, 20, 60, 0.2);
    margin: 24px 0;
}

.vehicle-card-display .vehicle-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #DC143C, #FF1744);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
}

.vehicle-card-display .vehicle-info h3 {
    color: #fff;
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 600;
}

.vehicle-card-display .vehicle-info p {
    color: #aaa;
    font-size: 14px;
    margin: 4px 0;
}

.confirm-question {
    text-align: center;
    font-size: 17px;
    color: #ddd;
    margin: 24px 0;
}

/* ===== CATEGORY GRID ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.category-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    background: rgba(220, 20, 60, 0.1);
    border-color: #DC143C;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(220, 20, 60, 0.3);
}

.category-card i {
    font-size: 36px;
    color: #DC143C;
    margin-bottom: 12px;
    display: block;
}

.category-card span {
    color: #ddd;
    font-size: 15px;
    font-weight: 500;
}

/* ===== CUSTOM PART INPUT ===== */
.custom-part-input {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-part-input label {
    display: block;
    color: #ddd;
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 500;
}

.custom-part-input input {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.custom-part-input input:focus {
    outline: none;
    border-color: #DC143C;
    background: rgba(220, 20, 60, 0.05);
}

/* ===== CONDITION OPTIONS ===== */
.condition-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.condition-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.condition-card:hover {
    background: rgba(220, 20, 60, 0.08);
    border-color: #DC143C;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(220, 20, 60, 0.2);
}

.condition-card.recommended {
    border-color: #DC143C;
    background: rgba(220, 20, 60, 0.08);
}

.condition-card .badge {
    position: absolute;
    top: -12px;
    right: 16px;
    background: linear-gradient(135deg, #DC143C, #FF1744);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.condition-card i {
    font-size: 32px;
    color: #DC143C;
    margin-bottom: 12px;
    display: block;
}

.condition-card h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.condition-card p {
    color: #aaa;
    font-size: 13px;
    margin-bottom: 12px;
}

.condition-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.condition-card ul li {
    color: #999;
    font-size: 13px;
    padding: 4px 0;
    padding-right: 20px;
    position: relative;
}

.condition-card ul li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: #DC143C;
    font-weight: bold;
}

/* ===== PART NUMBER INPUT ===== */
.part-number-input label {
    display: block;
    color: #ddd;
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 500;
}

.part-number-input input {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.part-number-input input:focus {
    outline: none;
    border-color: #DC143C;
    background: rgba(220, 20, 60, 0.05);
}

.part-number-input .hint {
    color: #888;
    font-size: 13px;
    margin-bottom: 20px;
}

/* ===== INSTALLATION OPTIONS ===== */
.installation-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.option-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-card:hover {
    background: rgba(220, 20, 60, 0.1);
    border-color: #DC143C;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(220, 20, 60, 0.3);
}

.option-card i {
    font-size: 48px;
    color: #DC143C;
    margin-bottom: 16px;
    display: block;
}

.option-card h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 12px;
    font-weight: 600;
}

.option-card p {
    color: #aaa;
    font-size: 14px;
    line-height: 1.6;
}

/* ===== ADDITIONAL INFO ===== */
.additional-fields label {
    display: block;
    color: #ddd;
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 500;
}

.additional-fields textarea {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
}

.additional-fields textarea:focus {
    outline: none;
    border-color: #DC143C;
    background: rgba(220, 20, 60, 0.05);
}

/* ===== LOADING STATE ===== */
.tinda-loading {
    text-align: center;
    padding: 48px 24px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    border: 4px solid rgba(220, 20, 60, 0.2);
    border-top-color: #DC143C;
    border-radius: 50%;
    animation: ipr-spin 1s linear infinite;
}

@keyframes ipr-spin {
    to { transform: rotate(360deg); }
}

.tinda-loading h3 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 12px;
    font-weight: 600;
}

.tinda-loading p {
    color: #aaa;
    font-size: 15px;
}

.loading-steps {
    margin-top: 32px;
    text-align: right;
}

.loading-steps .step {
    color: #666;
    font-size: 14px;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.loading-steps .step.active {
    color: #DC143C;
    font-weight: 500;
}

/* ===== PRICING RESULT ===== */
.success-icon {
    text-align: center;
    margin-bottom: 24px;
}

.success-icon i {
    font-size: 64px;
    color: #4CAF50;
    animation: ipr-scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ipr-scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.ai-response {
    background: rgba(220, 20, 60, 0.05);
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    max-height: 400px;
    overflow-y: auto;
}

.formatted-response {
    color: #ddd;
    font-size: 15px;
    line-height: 1.8;
}

.formatted-response strong {
    color: #fff;
    font-weight: 600;
}

.formatted-response del {
    color: #888;
    text-decoration: line-through;
}

/* ===== ERROR STATE ===== */
.error-icon {
    text-align: center;
    margin-bottom: 24px;
}

.error-icon i {
    font-size: 64px;
    color: #FFA726;
}

.request-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}

.request-summary h3 {
    color: #fff;
    font-size: 17px;
    margin-bottom: 16px;
    font-weight: 600;
}

.request-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.request-summary ul li {
    color: #ddd;
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.request-summary ul li:last-child {
    border-bottom: none;
}

.next-steps {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 16px;
    color: #81C784;
    font-size: 14px;
    line-height: 1.8;
    margin: 24px 0;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
}

.btn-primary {
    background: linear-gradient(135deg, #DC143C, #FF1744);
    color: #fff;
    box-shadow: 0 4px 16px rgba(220, 20, 60, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #FF1744, #DC143C);
    box-shadow: 0 6px 24px rgba(220, 20, 60, 0.5);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #ddd;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .tinda-modal-container {
        width: 95%;
        max-height: 95vh;
        border-radius: 20px;
    }

    .tinda-modal-header {
        padding: 20px;
    }

    .tinda-modal-body {
        padding: 24px 20px;
    }

    .tinda-step h2 {
        font-size: 22px;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .condition-options,
    .installation-options {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

/* ===== DARK MODE OPTIMIZATIONS ===== */
@media (prefers-color-scheme: dark) {
    .tinda-modal-container {
        background: linear-gradient(135deg, #121212 0%, #000 100%);
    }
}
