/* Outer Suite Container (Matches existing layout and design system) */
.jq-quote-container {
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #fff;
    box-sizing: border-box;
}

.jq-quote-container * {
    box-sizing: border-box;
}

/* Left Column Editor Styles */
.jq-quote-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.jq-quote-title {
    font-size: 32px !important;
    font-weight: 600 !important;
    margin: 0 0 16px 0 !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
    letter-spacing: -0.5px;
}

.jq-quote-intro {
    font-size: 15px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    margin: 0 0 20px 0 !important;
    line-height: 1.6 !important;
}

/* Checklist Features list */
.jq-quote-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
}

.jq-quote-features li {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
}

.jq-quote-features li:last-child {
    margin-bottom: 0;
}

.jq-quote-features svg {
    flex-shrink: 0;
    margin-right: 12px;
}

/* Form Styles */
.jq-quote-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.jq-quote-section {
    background: rgba(17, 24, 39, 0.4);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.jq-quote-section-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 0 0 20px 0 !important;
    color: #38bdf8 !important; /* Elegant Sky Blue Theme */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    letter-spacing: 0.5px;
}

.jq-quote-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.jq-quote-field-group:last-child {
    margin-bottom: 0;
}

.jq-quote-field-group label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jq-required {
    color: #f87171;
    margin-left: 2px;
}

/* Inputs & Textareas */
.jq-quote-input,
.jq-quote-textarea {
    background-color: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff !important;
    font-size: 15px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.jq-quote-input:focus,
.jq-quote-textarea:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.jq-quote-input::placeholder,
.jq-quote-textarea::placeholder {
    color: #4b5563;
}

.jq-quote-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Logo Uploader styling */
.jq-quote-logo-uploader {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.jq-quote-logo-uploader input[type="file"] {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.jq-quote-logo-preview-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 8px;
    width: fit-content;
}

.jq-quote-logo-preview-box img {
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    padding: 2px;
}

.jq-quote-remove-logo-btn {
    background: none;
    border: none;
    color: #f87171;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    padding: 4px 8px;
}

.jq-quote-remove-logo-btn:hover {
    text-decoration: underline;
}

/* Checkbox Toggle Group */
.jq-checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.jq-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #38bdf8;
}

.jq-checkbox-group label {
    margin: 0;
    text-transform: none;
    cursor: pointer;
}

/* Line Items Editor Row */
.jq-quote-item-row {
    display: grid;
    grid-template-columns: 2fr 0.6fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.jq-quote-item-row .jq-quote-field-group {
    margin-bottom: 0;
}

.jq-quote-remove-item-btn {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.2s, color 0.2s;
}

.jq-quote-remove-item-btn:hover {
    background-color: rgba(239, 68, 68, 0.3);
    color: #ffffff;
}

.jq-quote-add-item-btn {
    background-color: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    border: 1px dashed rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s, border-color 0.2s;
    margin-top: 8px;
}

.jq-quote-add-item-btn:hover {
    background-color: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
}

/* Button Classes */
.jq-quote-btn {
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.jq-quote-btn--download {
    background-color: #0ea5e9;
    color: #ffffff;
    padding: 16px;
    margin-top: 24px;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jq-quote-btn--download:hover {
    background-color: #0284c7;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
    transform: translateY(-1px);
}

.jq-quote-btn--download:active {
    transform: translateY(0);
}

.jq-quote-btn--reset {
    background-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    padding: 14px;
    font-size: 13px;
    letter-spacing: 1px;
}

.jq-quote-btn--reset:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.jq-quote-editor-actions {
    margin-top: 10px;
}

/* Error Messages */
.jq-quote-message {
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.jq-quote-message--error {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Right Column: Live Document Preview Styles */
.jq-quote-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.jq-quote-preview-container {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.jq-quote-preview-header {
    background: rgba(17, 24, 39, 0.5);
    padding: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.jq-quote-canvas-wrapper {
    padding: 24px;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-height: 560px;
    overflow-y: auto;
    background: #1f2937;
}

/* The actual physical A4 sheet template (styled clean & printer-friendly) */
.jq-quote-document {
    width: 794px; /* A4 Standard Width at 96 DPI */
    min-height: 1123px; /* A4 Standard Height at 96 DPI */
    background-color: #ffffff !important;
    color: #1e293b !important;
    padding: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    transform-origin: top center;
    text-align: left;
}

/* Document typography settings */
.jq-quote-document h1,
.jq-quote-document h2,
.jq-quote-document h3,
.jq-quote-document p,
.jq-quote-document th,
.jq-quote-document td {
    color: #1e293b !important;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* Document Header Section */
.jq-qdoc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid #0f172a;
    padding-bottom: 24px;
    margin-bottom: 32px;
}

.jq-qdoc-header-left {
    flex: 1.2;
}

.jq-qdoc-logo-container {
    margin-bottom: 14px;
    max-width: 160px;
}

.jq-qdoc-logo-container img {
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

.jq-qdoc-biz-title {
    font-size: 24px !important;
    font-weight: 700 !important;
    margin: 0 0 8px 0 !important;
    color: #0f172a !important;
    line-height: 1.2 !important;
}

.jq-qdoc-biz-details {
    font-size: 13px !important;
    color: #475569 !important;
    margin: 0 0 4px 0 !important;
    line-height: 1.4 !important;
    white-space: pre-line;
}

.jq-qdoc-header-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.jq-qdoc-label {
    font-size: 32px !important;
    font-weight: 800 !important;
    margin: 0 0 16px 0 !important;
    color: #0f172a !important;
    letter-spacing: 1px;
}

.jq-qdoc-meta-table {
    border-collapse: collapse;
    width: auto;
}

.jq-qdoc-meta-table th {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    color: #475569 !important;
    padding: 3px 12px 3px 0;
    text-align: right;
}

.jq-qdoc-meta-table td {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    padding: 3px 0;
    text-align: right;
}

/* Billing Info Blocks */
.jq-qdoc-billing {
    margin-bottom: 36px;
    display: flex;
}

.jq-qdoc-billing-to {
    flex: 1;
}

.jq-qdoc-billing h3 {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    color: #475569 !important;
    margin: 0 0 10px 0 !important;
    letter-spacing: 0.5px;
}

.jq-qdoc-billing strong {
    font-size: 15px !important;
    color: #0f172a !important;
    font-weight: 600 !important;
}

.jq-qdoc-client-address {
    font-size: 13px !important;
    color: #334155 !important;
    margin: 6px 0 0 0 !important;
    line-height: 1.5 !important;
    white-space: pre-line;
}

/* Line Items Table */
.jq-qdoc-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 28px !important;
}

.jq-qdoc-table th {
    background-color: #f8fafc !important;
    border-bottom: 2px solid #cbd5e1 !important;
    padding: 12px 8px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #334155 !important;
}

.jq-qdoc-table td {
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 12px 8px !important;
    font-size: 13px !important;
    color: #1e293b !important;
    line-height: 1.4 !important;
}

.jq-qdoc-table .col-desc {
    text-align: left;
    width: 55%;
}

.jq-qdoc-table .col-qty {
    text-align: center;
    width: 10%;
}

.jq-qdoc-table .col-price {
    text-align: right;
    width: 15%;
}

.jq-qdoc-table .col-total {
    text-align: right;
    width: 20%;
    font-weight: 600 !important;
}

/* Summary Blocks aligned to Right */
.jq-qdoc-totals-section {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    margin-bottom: 40px;
}

.jq-qdoc-totals-table {
    border-collapse: collapse;
    width: 260px;
}

.jq-qdoc-totals-table tr th {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    text-align: right;
    padding: 8px 12px 8px 0;
}

.jq-qdoc-totals-table tr td {
    font-size: 13px !important;
    color: #1e293b !important;
    text-align: right;
    padding: 8px 0;
}

.jq-qdoc-totals-table tr.jq-qdoc-total-row th {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    border-top: 2px solid #cbd5e1;
    padding-top: 12px;
}

.jq-qdoc-totals-table tr.jq-qdoc-total-row td {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    border-top: 2px solid #cbd5e1;
    padding-top: 12px;
}

/* Footer Terms & Notes */
.jq-qdoc-notes-block {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    margin-bottom: 24px;
}

.jq-qdoc-notes-block h3,
.jq-qdoc-terms-block h3 {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    color: #475569 !important;
    margin: 0 0 8px 0 !important;
    letter-spacing: 0.5px;
}

.jq-qdoc-notes-block p,
.jq-qdoc-terms-block p {
    font-size: 12px !important;
    color: #475569 !important;
    line-height: 1.5 !important;
    margin: 0 0 16px 0 !important;
    white-space: pre-line;
}

.jq-qdoc-terms-block {
    margin-top: auto;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

/* Signature & Acceptance box */
.jq-qdoc-accept-box {
    margin-top: 24px;
    background-color: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 16px;
}

.jq-qdoc-accept-box p {
    font-weight: 600 !important;
    color: #1e293b !important;
    margin-bottom: 20px !important;
    font-size: 12px !important;
}

.jq-qdoc-signature-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px !important;
    color: #334155 !important;
}

.jq-qdoc-signature-line span {
    font-family: inherit !important;
}

/* Responsive Rules */
@media (max-width: 992px) {
    .jq-quote-container {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 30px 20px;
    }
    
    .jq-quote-canvas-wrapper {
        max-height: 480px;
    }
}

@media (max-width: 576px) {
    .jq-quote-grid-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .jq-quote-item-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .jq-quote-remove-item-btn {
        width: 100%;
        margin-top: 8px;
    }
}
