/* Hide original select fields */
.prescrizione-selecter-pera[name="tmcp_select_233"],
.prescrizione-selecter-pera[name="tmcp_select_234"],
.prescrizione-selecter-pera[name="tmcp_select_236"],
.prescrizione-selecter-pera[name="tmcp_select_237"] {
    display: none !important;
}

/* Button to trigger popup */
.sps-trigger-button {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    position: relative;
    transition: all 0.3s ease;
}

.sps-trigger-button:hover {
    border-color: #999;
}

.sps-trigger-button::after {
    content: '▼';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

.sps-trigger-button.has-value {
    color: #000;
    font-weight: 500;
}

.sps-trigger-button:not(.has-value) {
    color: #999;
}

/* Popup overlay */
.sps-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.sps-popup-overlay.active {
    display: flex;
}

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

/* Popup container */
.jsx-3103685486.rx-select-container {
    background: #fff;
    border-radius: 8px;
    max-width: 90%;
    width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Popup title */
.jsx-3103685486.rx-select-title {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
}

.jsx-3103685486.select-close-btn {
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.jsx-3103685486.select-close-btn:hover {
    opacity: 0.7;
}

/* Select item container */
.jsx-3103685486.select-item-container {
    overflow-y: auto;
    flex: 1;
    padding: 20px;
    display: flex;
    gap: 20px;
}

.jsx-3103685486.select-item {
    flex: 1;
}

.jsx-3103685486.select-item-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

/* Options grid */
.jsx-3103685486.select-item-ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
    border-radius: 8px;
}

.jsx-3103685486.select-item-ul.left-bg {
    background: #f8f8f8;
}

.jsx-3103685486.select-item-ul.right-bg {
    background: #f0f0f0;
}

.jsx-3103685486.select-item-ul > div {
    padding: 12px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
    font-size: 14px;
}

.jsx-3103685486.select-item-ul > div:hover {
    background: #f0f0f0;
    border-color: #999;
}

.jsx-3103685486.select-item-ul > div.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    font-weight: 600;
}

#noneCont {
    grid-column: span 3;
    font-weight: 600;
}

/* Action buttons */
.jsx-3103685486.handle-code {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.jsx-3728905445.pc-firmoo-button {
    padding: 0;
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.jsx-3728905445.pc-firmoo-button-three {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.jsx-3728905445.pc-firmoo-button-three:hover {
    background: #e8e8e8;
}

.jsx-3728905445.pc-firmoo-button-main {
    background: #007bff;
    color: #fff;
}

.jsx-3728905445.pc-firmoo-button-main:hover {
    background: #0056b3;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .jsx-3103685486.rx-select-container {
        width: 95%;
        max-height: 95vh;
    }

    .jsx-3103685486.select-item-container {
        flex-direction: column;
        gap: 15px;
    }

    .jsx-3103685486.select-item-ul {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .jsx-3103685486.select-item-ul > div {
        padding: 10px 5px;
        font-size: 13px;
    }

    .jsx-3728905445.pc-firmoo-button {
        width: 45% !important;
    }
}

@media (max-width: 480px) {
    .jsx-3103685486.select-item-ul {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .jsx-3103685486.select-item-ul > div {
        padding: 8px 4px;
        font-size: 12px;
    }

    .jsx-3103685486.handle-code {
        flex-direction: column;
        gap: 10px;
    }

    .jsx-3728905445.pc-firmoo-button {
        width: 100% !important;
    }
}

/* Icon font support */
.iconfont.icon-close::before {
    content: '×';
    font-size: 24px;
    font-weight: 300;
}

/* ============ SUMMARY POPUP STYLES ============ */

/* Summary trigger button */
.summary-trigger-button {
    cursor: pointer;
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    border: none;
    position: relative;
    overflow: hidden;
}

.summary-trigger-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.summary-trigger-button:hover::before {
    left: 100%;
}

.summary-trigger-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.summary-trigger-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* Summary modal wrapper */
.summary-modal-wrap {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: fadeInBackdrop 0.3s ease;
}

@keyframes fadeInBackdrop {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

/* Modal container */
.summary-modal-wrap .ant-modal {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUpModal 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 95vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

@keyframes slideUpModal {
    from {
        transform: translateY(50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Modal content */
.summary-modal-wrap .ant-modal-content {
    background: #fff;
}

.summary-modal-wrap .ant-modal-body {
    padding: 30px 40px 40px;
}

/* Modal title */
.summary-modal-wrap .jsx-144927785.modal-title {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

.summary-modal-wrap .summary-close-btn {
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: #f5f5f5;
}

.summary-modal-wrap .summary-close-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.summary-modal-wrap .summary-close-btn .icon-close {
    color: #666;
}

/* Main content */
.summary-modal-wrap .jsx-1971174945.content-tit {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 16px;
    line-height: 1.5;
    text-align: center;
}

/* Row title */
.summary-modal-wrap .jsx-1971174945.row-title {
    display: flex;
    align-items: center;
    padding: 10px 0;
    font-size: 13px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-modal-wrap .jsx-1971174945.row-title:not(:first-child) {
    margin-top: 5px;
}

.summary-modal-wrap .jsx-1971174945.row-title .w20 {
    width: 20%;
    text-align: center;
}

.summary-modal-wrap .jsx-1971174945.row-title .displayfaj {
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-modal-wrap .jsx-1971174945.row-title .textal {
    text-align: center;
}

/* Row value */
.summary-modal-wrap .jsx-1971174945.row-value {
    display: flex;
    align-items: center;
    font-size: 16px;
}

.summary-modal-wrap .jsx-1971174945.row-value > div {
    padding: 0 10px;
}

.summary-modal-wrap .jsx-1971174945.row-value .w20 {
    width: 20%;
    text-align: center;
}

.summary-modal-wrap .jsx-1971174945.row-value .fwb {
    font-weight: 700;
    font-size: 18px;
    color: #1a1a1a;
}

.summary-modal-wrap .jsx-1971174945.row-value .textal {
    text-align: center;
}

.summary-modal-wrap .jsx-1971174945.row-value .perscribe-warnfirst {
    color: #667eea;
}

/* PD Row */
.summary-modal-wrap .jsx-1971174945.pd-row {
    display: flex;
    align-items: center;
    padding: 15px 15px 0;
}

.summary-modal-wrap .jsx-1971174945.pd-row .mr1 {
    margin-right: 10px;
    color: #6c757d;
    font-weight: 600;
}

.summary-modal-wrap .jsx-1971174945.pd-row .fwb {
    font-weight: 700;
    font-size: 18px;
    color: #1a1a1a;
}

.summary-modal-wrap .jsx-1971174945.pd-row .displayfaj {
    display: flex;
    align-items: center;
}

/* Warnings section */
.summary-modal-wrap .jsx-1971174945.warnings {
    margin-top: 20px;
}

.summary-modal-wrap .jsx-1971174945.warn-row {
    display: flex;
    align-items: flex-start;
    padding: 12px 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
    margin-bottom: 10px;
}

.summary-modal-wrap .jsx-1971174945.warn-row .icon-error {
    margin-right: 10px;
    margin-top: 2px;
}

.summary-modal-wrap .jsx-1971174945.warn-text {
    color: #856404;
    font-size: 14px;
    line-height: 1.5;
}

/* Action buttons container */
.summary-modal-wrap .jsx-3728905445.pc-firmoo-button {
    width: 100%;
    max-width: 400px;
    height: 52px;
    line-height: 52px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    letter-spacing: 0.3px;
}

/* Confirm button */
.summary-modal-wrap .summary-confirm-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.summary-modal-wrap .summary-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.summary-modal-wrap .summary-confirm-btn:active {
    transform: translateY(0);
}

/* Edit button */
.summary-modal-wrap .summary-edit-btn {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
}

.summary-modal-wrap .summary-edit-btn:hover {
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.summary-modal-wrap .summary-edit-btn:active {
    transform: translateY(0);
}

/* Responsive styles for summary popup */
@media (max-width: 768px) {
    .summary-modal-wrap .ant-modal {
        width: 95% !important;
        margin: 20px;
        border-radius: 16px;
    }

    .summary-modal-wrap .ant-modal-body {
        padding: 20px 20px 30px;
    }

    .summary-modal-wrap .jsx-1971174945.content-tit {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .summary-modal-wrap .jsx-1971174945.row-title {
        font-size: 11px;
    }

    .summary-modal-wrap .jsx-1971174945.row-value {
        font-size: 14px;
        padding: 12px 0;
    }

    .summary-modal-wrap .jsx-1971174945.row-value .fwb {
        font-size: 16px;
    }

    .summary-modal-wrap .jsx-1971174945.pd-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .summary-trigger-button {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .summary-modal-wrap .ant-modal {
        width: 100% !important;
        margin: 10px;
        border-radius: 12px;
        max-height: 95vh;
    }

    .summary-modal-wrap .ant-modal-body {
        padding: 15px;
    }

    .summary-modal-wrap .jsx-1971174945.content-tit {
        font-size: 14px;
    }

    .summary-modal-wrap .jsx-1971174945.row-title {
        font-size: 10px;
        padding: 8px 0;
    }

    .summary-modal-wrap .jsx-1971174945.row-value {
        font-size: 13px;
        padding: 10px 0;
    }

    .summary-modal-wrap .jsx-1971174945.row-value .fwb {
        font-size: 15px;
    }

    .summary-modal-wrap .jsx-1971174945.row-value > div {
        padding: 0 5px;
    }

    .summary-modal-wrap .jsx-3728905445.pc-firmoo-button {
        height: 48px;
        line-height: 48px;
        font-size: 15px;
    }

    .summary-trigger-button {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Smooth scrollbar for modal */
.summary-modal-wrap .ant-modal::-webkit-scrollbar {
    width: 8px;
}

.summary-modal-wrap .ant-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.summary-modal-wrap .ant-modal::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.summary-modal-wrap .ant-modal::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Utility classes for summary popup */
.summary-modal-wrap .w20 {
    width: 20%;
}

.summary-modal-wrap .fwb {
    font-weight: bold;
}

.summary-modal-wrap .textal {
    text-align: center;
}

.summary-modal-wrap .displayfaj {
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-modal-wrap .mr1 {
    margin-right: 10px;
}

div#summary-rx-data {
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    padding: 6px;
}