/* Tradeline Checkout Popup Styles */

/* Overlay */
.tradeline-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    animation: fadeIn 0.3s ease-in-out;
}

.tradeline-popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popup Container */
.tradeline-checkout-popup {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 80%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: scaleIn 0.3s ease-in-out;
}

/* Close Button */
.tradeline-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    z-index: 10;
}

.tradeline-popup-close:hover {
    color: #000;
}

/* Header */
.tradeline-popup-header {
    padding: 30px 40px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tradeline-popup-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #333;
}

/* Step Indicator */
.tradeline-step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.tradeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 200px;
}

.tradeline-step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    transition: all 0.3s;
}

.tradeline-step.active .tradeline-step-circle {
    background: #4CAF50;
    color: #fff;
}

.tradeline-step.completed .tradeline-step-circle {
    background: #4CAF50;
    color: #fff;
}

.tradeline-step-circle::before {
    content: attr(data-step);
}

.tradeline-step.completed .tradeline-step-circle::before {
    content: '✓';
}

.tradeline-step-label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.tradeline-step.active .tradeline-step-label {
    color: #333;
    font-weight: 700;
}

.tradeline-step-line {
    flex: 1;
    height: 3px;
    background: #e0e0e0;
    margin: 0 -10px;
    position: relative;
    top: -20px;
}

.tradeline-step.active .tradeline-step-line {
    background: #4CAF50;
}

/* Content */
.tradeline-popup-content {
    padding: 40px;
    min-height: 400px;
}

.tradeline-step-content {
    display: none;
}

.tradeline-step-content.active {
    display: block;
    animation: slideIn 0.4s ease-in-out;
}

/* Footer */
.tradeline-popup-footer {
    padding: 20px 40px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Buttons */
.tradeline-btn {
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tradeline-btn-primary {
    background: #4CAF50;
    color: #fff;
}

.tradeline-btn-primary:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.tradeline-btn:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

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

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

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

/* Cart Display (Step 1) */
.tradeline-cart-display {
    margin-bottom: 30px;
}

.tradeline-cart-display h3 {
    color: #0f172a;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    margin-top: 0;
}

.tradeline-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    font-size: 14px;
}

.tradeline-cart-table thead {
    background: #f8fafc;
}

.tradeline-cart-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.tradeline-cart-table tbody td {
    padding: 16px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}

/* Column specific styles */
.tradeline-cart-table .th-id,
.tradeline-cart-table td:nth-child(1) {
    width: 50px;
    text-align: center;
    color: #94a3b8;
    font-weight: 500;
}

.tradeline-cart-table .th-bank,
.tradeline-cart-table td:nth-child(2) {
    font-weight: 600;
    color: #0f172a;
}

.tradeline-cart-table .th-limit,
.tradeline-cart-table td:nth-child(3) {
    text-align: right;
    font-weight: 600;
}

.tradeline-cart-table .th-qty,
.tradeline-cart-table td:nth-child(4) {
    width: 80px;
    text-align: center;
    font-weight: 600;
}

.tradeline-cart-table .th-price,
.tradeline-cart-table td:nth-child(5) {
    text-align: right;
    font-weight: 600;
    color: #059669;
}

.tradeline-cart-table .th-actions,
.tradeline-cart-table td:nth-child(6) {
    width: 80px;
    text-align: center;
}

/* Row hover effect */
.tradeline-cart-table tbody tr {
    transition: background-color 0.15s ease;
}

.tradeline-cart-table tbody tr:hover {
    background-color: #f8fafc;
}

.tradeline-cart-table tbody tr:last-child td {
    border-bottom: none;
}

/* Delete button */
.tradeline-cart-table .delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    border: none;
    background: transparent;
    border-radius: 6px;
    transition: all 0.15s ease;
    line-height: 1;
}

.tradeline-cart-table .delete-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.tradeline-promo-section {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.tradeline-promo-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.15s ease;
}

.tradeline-promo-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.tradeline-promo-input::placeholder {
    color: #94a3b8;
}

.tradeline-promo-section .tradeline-btn-secondary {
    padding: 10px 24px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}

.tradeline-promo-section .tradeline-btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.tradeline-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 16px;
    font-weight: 600;
    color: #475569;
}

.tradeline-cart-total #tradeline-cart-total {
    font-size: 24px;
    font-weight: 700;
    color: #059669;
}

/* Questionnaire */
.tradeline-questionnaire {
    max-width: 800px;
    margin: 0 auto;
}

.tradeline-questionnaire-heading {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

.tradeline-saved-answers {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.tradeline-question-item {
    background: #f9f9f9;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.tradeline-question-number {
    font-size: 14px;
    color: #4CAF50;
    font-weight: 700;
    margin-bottom: 10px;
}

.tradeline-question-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.tradeline-question-note {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
}

.tradeline-question-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tradeline-answer-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.tradeline-answer-option:hover {
    background: #f0f0f0;
    border-color: #4CAF50;
}

.tradeline-answer-option:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.tradeline-answer-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.tradeline-answer-option.selected {
    background: #e8f5e9;
    border-color: #4CAF50;
}

/* Client Form */
.tradeline-client-form {
    max-width: 900px;
    margin: 0 auto;
}

.tradeline-form-section {
    margin-bottom: 30px;
}

.tradeline-form-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.tradeline-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.tradeline-toggle-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.tradeline-toggle-switch {
    display: flex;
    gap: 5px;
}

.tradeline-toggle-option {
    padding: 8px 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.tradeline-toggle-option.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

.tradeline-warning-box {
    background: #fff3cd;
    border-left: 4px solid #ff9800;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.tradeline-warning-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #ff9800;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    margin-right: 10px;
    font-weight: 700;
}

.tradeline-form-group {
    margin-bottom: 20px;
}

.tradeline-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.tradeline-form-label.required::after {
    content: '*';
    color: #f44336;
    margin-left: 4px;
}

.tradeline-form-input,
.tradeline-form-select,
.tradeline-form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.tradeline-form-input:focus,
.tradeline-form-select:focus,
.tradeline-form-textarea:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
    border-color: #4CAF50;
}

.tradeline-form-input.error,
.tradeline-form-select.error {
    border-color: #f44336;
}

.tradeline-form-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.tradeline-form-error.show {
    display: block;
}

.tradeline-upload-group {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.tradeline-upload-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.tradeline-upload-btn:hover {
    background: #e0e0e0;
}

.tradeline-file-name {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Confirmation */
.tradeline-confirmation {
    max-width: 700px;
    margin: 0 auto;
}

.tradeline-confirmation-heading {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
}

.tradeline-checkbox-group {
    margin-bottom: 25px;
}

.tradeline-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s;
}

.tradeline-checkbox-label:hover {
    background: #f9f9f9;
    border-color: #4CAF50;
}

.tradeline-checkbox-label:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.tradeline-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.tradeline-checkbox-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.tradeline-checkbox-text a {
    color: #4CAF50;
    text-decoration: underline;
}

.tradeline-checkbox-text a:hover {
    color: #45a049;
}

/* Loading Spinner */
.tradeline-loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.tradeline-loading.show {
    display: block;
}

.tradeline-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .tradeline-checkout-popup {
        width: 90%;
    }
}

@media (max-width: 768px) {
    .tradeline-checkout-popup {
        width: 95%;
        max-height: 95vh;
    }

    .tradeline-popup-header,
    .tradeline-popup-content,
    .tradeline-popup-footer {
        padding: 20px;
    }

    .tradeline-popup-title {
        font-size: 22px;
    }

    .tradeline-step-indicator {
        gap: 5px;
    }

    .tradeline-step-circle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .tradeline-step-label {
        font-size: 12px;
    }

    .tradeline-cart-table {
        font-size: 14px;
    }

    .tradeline-cart-table th,
    .tradeline-cart-table td {
        padding: 8px;
    }
}
