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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-image: url('img.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: #667eea;
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

.demo-notice {
    font-size: 0.95em;
    opacity: 0.85;
    margin-top: 20px;
    line-height: 1.6;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    font-style: italic;
}

.template-selector {
    padding: 30px 40px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.parts-category-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.parts-category-btn {
    padding: 12px 25px;
    font-size: 1.1em;
    font-weight: 600;
    border: 2px solid #667eea;
    background: #667eea;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.parts-category-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.parts-category-btn.disabled {
    background: #e9ecef;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

.parts-category-btn.disabled:hover {
    background: #e9ecef;
    transform: none;
    box-shadow: none;
}

.template-selector h2 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.5em;
}

.template-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.template-item {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.template-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.template-description {
    font-size: 0.75em;
    color: #6c757d;
    margin-top: 8px;
    text-align: center;
    line-height: 1.4;
    font-style: italic;
}

.template-btn:hover {
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.template-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.template-btn.disabled {
    background: #e9ecef;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

.template-btn.disabled:hover {
    background: #e9ecef;
    transform: none;
    box-shadow: none;
}

.calculator-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0;
    min-height: 600px;
}

.materials-section {
    padding: 30px 40px;
    border-right: 2px solid #e9ecef;
    max-height: 800px;
    overflow-y: auto;
}

.materials-section h2 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.5em;
}

.search-box {
    margin-bottom: 20px;
}

#materialSearch {
    width: 100%;
    padding: 15px;
    font-size: 1em;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: border-color 0.3s ease;
}

#materialSearch:focus {
    outline: none;
    border-color: #00FFC5;
}

.materials-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.material-item {
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.material-item:hover {
    background: #e9ecef;
    border-color: #00FFC5;
    transform: translateX(5px);
}

.material-info {
    flex: 1;
}

.material-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.material-details {
    font-size: 0.9em;
    color: #6c757d;
}

.material-price {
    font-weight: 700;
    color: #00CC9D;
    font-size: 1.2em;
    margin-left: 15px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: 15px;
}

.quantity-input {
    width: 60px;
    padding: 8px 4px;
    border: 2px solid #e9ecef;
    border-left: none;
    border-right: none;
    text-align: center;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-btn {
    width: 32px;
    height: 36px;
    padding: 0;
    border: 2px solid #e9ecef;
    background: white;
    color: #00CC9D;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.quantity-btn:hover {
    background: #E6FFF9;
    border-color: #00FFC5;
}

.quantity-btn:active {
    background: #00FFC5;
    color: white;
}

.quantity-down {
    border-radius: 5px 0 0 5px;
    border-right: none;
}

.quantity-up {
    border-radius: 0 5px 5px 0;
    border-left: none;
}

.quote-section {
    padding: 30px 40px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.quote-section h2 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.5em;
}

.quote-summary {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.quote-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.quote-row:last-child {
    border-bottom: none;
}

.quote-label {
    font-weight: 600;
    color: #495057;
}

.quote-value {
    font-weight: 700;
    color: #00CC9D;
    font-size: 1.2em;
}

.selected-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.selected-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-item-info {
    flex: 1;
}

.selected-item-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.selected-item-details {
    font-size: 0.85em;
    color: #6c757d;
}

.selected-item-total {
    font-weight: 700;
    color: #00CC9D;
    margin-left: 15px;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
    transition: background 0.3s ease;
}

.remove-btn:hover {
    background: #c82333;
}

.clear-btn {
    width: 100%;
    padding: 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.clear-btn:hover {
    background: #c82333;
}

.export-pdf-btn {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.export-pdf-btn:hover {
    background: #5568d3;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.export-pdf-btn,
.pay-now-btn {
    flex: 1;
    margin-top: 0;
    width: 100%;
    padding: 15px;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.pay-now-btn {
    background: #28a745;
}

.pay-now-btn:hover {
    background: #218838;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
}

.modal-content h2 {
    color: #495057;
    margin-bottom: 25px;
    font-size: 1.8em;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 600;
    font-size: 0.95em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00FFC5;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.delivery-options {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.radio-label span {
    color: #495057;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.send-callback-btn {
    padding: 15px 40px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.send-callback-btn:hover {
    background: #5568d3;
}

.pay-now-payment-btn {
    padding: 15px 40px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.pay-now-payment-btn:hover {
    background: #c82333;
}

/* Payment Modal Styles */
.payment-warnings {
    margin-bottom: 25px;
}

.warning-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.warning-box p {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 1.05em;
}

.warning-box ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
    color: #856404;
}

.warning-box li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.payment-options {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.stripe-connect-section {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stripe-connect-section h3 {
    color: #495057;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.stripe-description {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.stripe-connect-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    background: #00CC9D;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.stripe-connect-btn:hover {
    background: #00B388;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 204, 157, 0.3);
}

.stripe-status {
    margin-top: 15px;
    padding: 12px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
}

.stripe-success {
    color: #155724;
    margin: 0;
    font-weight: 600;
}

.complete-payment-btn {
    padding: 15px 40px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.complete-payment-btn:hover:not(:disabled) {
    background: #218838;
}

.complete-payment-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.cancel-payment-btn {
    padding: 15px 40px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cancel-payment-btn:hover {
    background: #5a6268;
}

/* Thank You Modal Styles */
.thank-you-message {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.thank-you-message p {
    color: #495057;
    font-size: 1.05em;
    line-height: 1.6;
    margin: 0;
}

.close-thank-you-btn {
    padding: 15px 40px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.close-thank-you-btn:hover {
    background: #5568d3;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state p {
    font-size: 1.1em;
}

@media (max-width: 1024px) {
    .calculator-section {
        grid-template-columns: 1fr;
    }

    .materials-section {
        border-right: none;
        border-bottom: 2px solid #e9ecef;
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .parts-category-selector {
        flex-direction: column;
    }

    .parts-category-btn {
        width: 100%;
    }

    .template-buttons {
        flex-direction: column;
    }

    .template-item {
        width: 100%;
    }

    .template-btn {
        width: 100%;
    }

    .materials-section,
    .quote-section {
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }

    .delivery-options {
        flex-direction: column;
        gap: 10px;
    }

    .payment-options {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions {
        flex-direction: column;
    }

    .send-callback-btn,
    .pay-now-payment-btn,
    .complete-payment-btn,
    .cancel-payment-btn {
        width: 100%;
    }
}
