/**
 * Price Calculator Styles
 *
 * @package PriceCalculator
 * @since 2.0.0
 */

/* Calculator Container */
body .prcalc-calculator {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9eafc 100%);
    max-width: 1200px;
    width: 100%;
    padding: 3rem 3rem 2.5rem 3rem;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(44, 62, 80, 0.18);
    margin: 2.5rem auto;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border: 1px solid #e0e3f7;
}

.has-price-calculator section.text-block {
    max-width: 100%;
}

button.prcalc-tab-button {
    text-wrap: initial;
}

/* Two-column layout for desktop */
@media (min-width: 1024px) {
    body .prcalc-calculator-wrapper {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        align-items: start;
    }
    
    body .prcalc-calculator-results {
        /* Results take right column - sticky on scroll */
        position: sticky;
        top: 9rem;
    }
}

body .prcalc-calculator h2 {
    margin-top: 0;
    text-align: center;
    color: #2a2a72;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

body .prcalc-calculator p {
    text-align: center;
    color: #555;
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 2.5rem;
}

/* Form sections */
body .prcalc-tab-content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(44,62,80,0.08);
}

body .prcalc-calculator label {
    display: block;
    margin-bottom: 1.1rem;
    color: #2a2a72;
    font-size: 1rem;
    font-weight: 500;
}

body .prcalc-calculator input[type="text"],
body .prcalc-calculator input[type="number"],
body .prcalc-calculator input[type="email"] {
    width: 100%;
    padding: 0.7rem 1rem;
    margin-top: 0.4rem;
    border-radius: 10px;
    border: 1px solid #d1d5e7;
    font-size: 1.08rem;
    background: #f6f7fb;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

body .prcalc-calculator input[type="text"]:focus,
body .prcalc-calculator input[type="number"]:focus,
body .prcalc-calculator input[type="email"]:focus {
    border-color: #6c63ff;
    outline: none;
    background: #fff;
}

/* Template Selector Styles */
body .prcalc-template-selector {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border-radius: 16px;
    margin: 1.5rem 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
}

body .prcalc-template-selector label {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

body .prcalc-template-selector .prcalc-template-select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    transition: all 0.3s ease;
    font-weight: 500;
}

body .prcalc-template-selector .prcalc-template-select:focus {
    border-color: #ffffff;
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

body .prcalc-template-selector .prcalc-template-description {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-top: 0.8rem !important;
    font-size: 0.95rem !important;
    line-height: 1.4;
    font-weight: 400;
}

body .prcalc-calculator input[type="checkbox"] {
    margin-right: 0.5em;
    accent-color: #6c63ff;
    transform: scale(1.2);
}

/* Tabs */
body .prcalc-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #d1d5e7;
}

body .prcalc-tab-button {
    flex: 0 1 auto;
    min-width: 120px;
    padding: 0.8rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #2a2a72;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
}

body .prcalc-tab-button:hover:not(:disabled) {
    background: rgba(108, 99, 255, 0.05);
}

body .prcalc-tab-button.active {
    border-bottom-color: #6c63ff;
    color: #6c63ff;
    background: rgba(108, 99, 255, 0.08);
}

body .prcalc-tab-button:disabled {
    color: #a0a0c0;
    cursor: not-allowed;
    opacity: 0.5;
    position: relative;
}

body .prcalc-tab-button:disabled::after {
    content: '🔒';
    margin-left: 0.3rem;
    font-size: 0.8rem;
}

body .prcalc-tab-content {
    display: none;
}

body .prcalc-tab-content.active {
    display: block;
}

body .prcalc-tab-content h3 {
    margin: 0 0 0.5rem 0;
    color: #2a2a72;
    font-size: 1.4rem;
}

body .prcalc-tab-intro {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

/* Results */
body .prcalc-result {
    margin: 0 0 1.5rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #2a2a72;
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(44,62,80,0.12);
    border: 1px solid #e0e3f7;
}

/* Desktop: sticky results */
@media (min-width: 1024px) {
    body .prcalc-calculator-results {
        background: #fff;
        border-radius: 16px;
        padding: 1.5rem;
        box-shadow: 0 4px 16px rgba(44,62,80,0.12);
        border: 1px solid #e0e3f7;
    }
    
    body .prcalc-calculator-results h3 {
        margin-top: 0;
        color: #2a2a72;
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid #e0e3f7;
    }
    
    body .prcalc-result {
        margin: 0;
        box-shadow: none;
        border: none;
        padding: 0;
        background: transparent;
    }
}

body .prcalc-result-section {
    display: flex;
    justify-content: space-between;
    padding: 0.4em 0;
    border-bottom: 1px solid #d1d5e7;
}

body .prcalc-result-section:last-child {
    border-bottom: none;
}

body .prcalc-total-row {
    margin-top: 0.5em;
    padding-top: 0.7em !important;
    border-top: 2px solid #6c63ff !important;
    font-size: 1.15rem;
}

body .prcalc-result-label {
    color: #2a2a72;
}

body .prcalc-result-value {
    color: #222;
    font-weight: 700;
}

/* Buttons */
body .prcalc-calculator button,
body .prcalc-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.15rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #6c63ff 0%, #574bdf 100%);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(44,62,80,0.09);
    margin-bottom: 0.7rem;
}

body .prcalc-calculator button:hover,
body .prcalc-button:hover {
    background: linear-gradient(90deg, #574bdf 0%, #6c63ff 100%);
    box-shadow: 0 4px 16px rgba(44,62,80,0.13);
    transform: translateY(-1px);
}

body .prcalc-calculator button:active,
body .prcalc-button:active {
    transform: translateY(0);
}

body .prcalc-calculator button:disabled,
body .prcalc-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

body .prcalc-calculator button:disabled:hover,
body .prcalc-button:disabled:hover {
    background: #ccc;
    box-shadow: 0 2px 8px rgba(44,62,80,0.09);
    transform: none;
}

/* Repeater Fields */
.prcalc-repeater-container {
    margin-top: 1rem;
}

.prcalc-repeater-item {
    background: #fff;
    border: 1px solid #d1d5e7;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.prcalc-repeater-item-fields {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.prcalc-repeater-item-fields > div {
    flex: 1;
}

.prcalc-repeater-item-fields label {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.prcalc-repeater-remove {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    width: 100%;
}

.prcalc-repeater-remove:hover {
    background: #c82333;
}

.prcalc-repeater-add {
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    width: 100%;
    margin-top: 0.5rem;
}

.prcalc-repeater-add:hover {
    background: #218838;
}

/* Tooltips */
.prcalc-tooltip-wrapper {
    display: inline-block;
    position: relative;
    margin-left: 6px;
    vertical-align: middle;
}

.prcalc-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #6c63ff;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    transition: background 0.2s;
}

.prcalc-tooltip-icon:hover {
    background: #574bdf;
}

.prcalc-tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2a2a72;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: normal;
    width: 220px;
    text-align: center;
    z-index: 1000;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    line-height: 1.4;
}

.prcalc-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2a2a72 transparent transparent transparent;
}

.prcalc-tooltip-wrapper:hover .prcalc-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Info Text */
.prcalc-info-text {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin-top: 1rem;
    font-weight: 400 !important;
}

/* Autosave Indicator */
.prcalc-autosave-indicator {
    text-align: center;
    color: #28a745;
    font-size: 0.9rem;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.prcalc-autosave-indicator.visible {
    opacity: 1;
}

/* Loading State */
body .prcalc-button.loading {
    position: relative;
    color: transparent;
}

body .prcalc-button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: prcalc-spin 0.6s linear infinite;
}

@keyframes prcalc-spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 600px) {
    body .prcalc-calculator {
        padding: 1.5rem 1rem;
        border-radius: 16px;
        margin: 1.5rem auto;
    }
    
    body .prcalc-calculator h2 {
        font-size: 1.8rem;
    }
    
    body .prcalc-tabs {
        gap: 0.25rem;
        grid-template-columns: repeat(1, 1fr);

    }
    
    body .prcalc-tab-button {
        font-size: 0.9rem;
        padding: 0.6rem 0.5rem;
    }
    
    .prcalc-repeater-item-fields {
        flex-direction: column;
    }
    
    .prcalc-tooltip-text {
        width: 180px;
    }
}

/* Print Styles */
@media print {
    body .prcalc-calculator {
        box-shadow: none;
        border: 1px solid #000;
        background: #fff;
    }
    
    body .prcalc-tabs,
    body .prcalc-button,
    .prcalc-repeater-add,
    .prcalc-repeater-remove,
    .prcalc-tooltip-wrapper {
        display: none !important;
    }
    
    body .prcalc-tab-content {
        display: block !important;
    }
}
/* Add-ons Marketplace Styles */
.prcalc-addons-section,
.prcalc-recurring-section,
.prcalc-timeline-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(44,62,80,0.08);
}

.prcalc-addons-section h3,
.prcalc-recurring-section h3,
.prcalc-timeline-section h3 {
    margin: 0 0 1rem 0;
    color: #2a2a72;
    font-size: 1.4rem;
    font-weight: 700;
}

.prcalc-addons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.prcalc-addon-card {
    border: 2px solid #e0e3f7;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fff;
}

.prcalc-addon-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.prcalc-addon-card.selected {
    border-color: #6366f1;
    background: #f0f0ff;
}

.prcalc-addon-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.prcalc-addon-checkbox {
    margin-top: 0.2rem;
    width: auto;
}

.prcalc-addon-header label {
    flex: 1;
    margin: 0;
    cursor: pointer;
}

.prcalc-recurring-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: #10b981;
    color: #fff;
    border-radius: 4px;
    margin-left: 0.3rem;
    text-transform: uppercase;
}

.prcalc-addon-description {
    font-size: 0.85rem;
    color: #666;
    margin: 0.5rem 0;
}

.prcalc-addon-price {
    font-weight: 600;
    color: #2a2a72;
    font-size: 1.1rem;
}

.prcalc-addon-period {
    font-size: 0.8rem;
    color: #888;
}

/* Recurring Revenue Styles */
.prcalc-recurring-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
}

.prcalc-recurring-section h3 {
    margin: 0 0 1rem 0;
    color: #2a2a72;
    font-size: 1.3rem;
}

.prcalc-recurring-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prcalc-recurring-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px solid #e0e3f7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prcalc-recurring-option:hover {
    border-color: #6366f1;
    background: #f9f9ff;
}

.prcalc-recurring-option input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Timeline Styles */
.prcalc-timeline-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
}

.prcalc-timeline-section h3 {
    margin: 0 0 1rem 0;
    color: #2a2a72;
    font-size: 1.3rem;
}

/* Start Date Input */
.prcalc-timeline-start-date {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.prcalc-timeline-start-date label {
    display: block;
    color: #2a2a72;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.prcalc-timeline-start-date input[type="date"] {
    width: 100%;
    max-width: 300px;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid #d1d5e7;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s;
}

.prcalc-timeline-start-date input[type="date"]:focus {
    border-color: #6c63ff;
    outline: none;
}

.prcalc-timeline-phases {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.prcalc-phase {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-left: 4px solid #6366f1;
    border-radius: 4px;
}

.prcalc-phase-name {
    font-weight: 600;
    color: #2a2a72;
}

.prcalc-phase-duration {
    color: #666;
    font-weight: 500;
}

.prcalc-phase-dates {
    color: #888;
    font-size: 0.9rem;
    text-align: right;
}

.prcalc-timeline-total {
    padding: 1rem;
    background: #eef2ff;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    color: #2a2a72;
    margin-bottom: 1.5rem;
}

/* Gantt Chart Styles */
.prcalc-timeline-gantt {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e3f7;
    height: 450px;
}

.prcalc-timeline-gantt h4 {
    margin: 0 0 1.5rem 0;
    color: #2a2a72;
    font-size: 1.1rem;
    font-weight: 600;
}

.prcalc-gantt-chart {
    position: relative;
    min-height: 420px;
    padding: 1rem 2.5% 4rem 2.5%;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    overflow-x: auto;
    border: 2px solid #e9ecef;
    box-sizing: border-box;
}

/* Week Grid Lines */
.prcalc-gantt-grid {
    position: absolute;
    top: 0;
    left: 2.5%;
    right: 2.5%;
    bottom: 50px; /* Stop before month markers */
    pointer-events: none;
    z-index: 1;
}

.prcalc-gantt-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, 
        rgba(108, 99, 255, 0.1) 0%, 
        rgba(108, 99, 255, 0.15) 50%, 
        rgba(108, 99, 255, 0.1) 100%);
    border-left: 1px dashed rgba(108, 99, 255, 0.2);
}

.prcalc-gantt-grid-line:first-child {
    display: none; /* Hide first line if it's at the start */
}

.prcalc-gantt-bar * {
    color: white!important;

}

.prcalc-gantt-bar {
    position: absolute;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: white!important;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 100px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    overflow: hidden;
    z-index: 5; /* Above grid lines */
}

.prcalc-gantt-bar:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.prcalc-gantt-bar:nth-child(2) {
    top: 20px;
}

.prcalc-gantt-bar:nth-child(3) {
    top: 100px;
}

.prcalc-gantt-bar:nth-child(4) {
    top: 180px;
}

.prcalc-gantt-bar:nth-child(5) {
    top: 260px;
}

.prcalc-gantt-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}

.prcalc-gantt-label {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.prcalc-gantt-dates {
    font-size: 0.8rem;
    opacity: 0.95;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.prcalc-gantt-months {
    position: absolute;
    bottom: 0;
    left: 2.5%;
    right: 2.5%;
    height: 50px;
    border-top: 3px solid #d1d5e7;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.prcalc-gantt-month-marker {
    position: absolute;
    top: 0;
    height: 100%;
    border-left: 2px solid #6c63ff;
    padding-left: 0.5rem;
    min-width: 50px;
}

.prcalc-gantt-month-marker:first-child {
    border-left: none;
    padding-left: 0;
}

.prcalc-gantt-month-marker span {
    font-size: 0.85rem;
    color: #2a2a72;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(108, 99, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(108, 99, 255, 0.2);
    white-space: nowrap;
}

/* Timeline Disclaimer */
.prcalc-timeline-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 4.5rem;
    padding: 1rem;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
}

.prcalc-disclaimer-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #f59e0b;
    margin-top: 0.1rem;
}

.prcalc-timeline-disclaimer p {
    margin: 0;
    color: #78350f;
    font-size: 0.9rem;
    line-height: 1.5;
}

.prcalc-timeline-chart {
    margin-top: 1rem;
    height: 60px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .prcalc-phase {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .prcalc-phase-dates {
        text-align: left;
    }
    
    .prcalc-gantt-chart {
        min-height: 280px;
        padding: 0.75rem 0 3.5rem 0;
    }
    
    .prcalc-gantt-bar {
        height: 45px;
        padding: 0.5rem;
        min-width: 80px;
        font-size: 0.75rem;
    }
    
    .prcalc-gantt-bar:nth-child(1) { top: 10px; }
    .prcalc-gantt-bar:nth-child(2) { top: 65px; }
    .prcalc-gantt-bar:nth-child(3) { top: 120px; }
    .prcalc-gantt-bar:nth-child(4) { top: 175px; }
    
    .prcalc-gantt-label {
        font-size: 0.85rem;
        font-weight: 600;
    }
    
    .prcalc-gantt-dates {
        font-size: 0.7rem;
    }
    
    .prcalc-gantt-months {
        height: 40px;
    }
    
    .prcalc-gantt-month-marker span {
        font-size: 0.75rem;
        margin-top: 0.5rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Payment Plan Styles */
.prcalc-payment-plan-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
}

.prcalc-payment-plan-section h3 {
    margin: 0 0 1rem 0;
    color: #2a2a72;
    font-size: 1.3rem;
}

/* Payment Structure Options */
.prcalc-payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0 2rem 0;
}

.prcalc-payment-option {
    display: flex;
    align-items: flex-start;
    padding: 1.25rem;
    background: #fff;
    border: 2px solid #e0e3f7;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prcalc-payment-upfront-box * {
    color: white;
}

.prcalc-payment-option:hover {
    border-color: #6c63ff;
    background: #f9f9ff;
}

.prcalc-payment-option input[type="radio"] {
    margin: 0.25rem 1rem 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.prcalc-payment-option input[type="radio"]:checked + .prcalc-payment-option-label {
    color: #6c63ff;
}

.prcalc-payment-option:has(input[type="radio"]:checked) {
    border-color: #6c63ff;
    background: #f9f9ff;
    box-shadow: 0 2px 12px rgba(108, 99, 255, 0.15);
}

.prcalc-payment-option-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    cursor: pointer;
}

.prcalc-payment-option-label strong {
    font-size: 1.05rem;
    color: #2a2a72;
    font-weight: 600;
    transition: color 0.2s;
}

.prcalc-payment-option-label small {
    font-size: 0.875rem;
    color: #666;
    font-weight: 400;
}

.prcalc-payment-option:has(input[type="radio"]:checked) .prcalc-payment-option-label strong {
    color: #6c63ff;
}

/* Payment Display Sections */
.prcalc-payment-display {
    margin-top: 1.5rem;
}

/* Upfront Payment Box */
.prcalc-payment-upfront-box {
    background: linear-gradient(135deg, #6c63ff 0%, #5753d8 100%);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
}

.prcalc-payment-upfront-label {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    opacity: 0.95;
}

.prcalc-payment-upfront-amount {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.prcalc-payment-upfront-note {
    font-size: 0.9rem;
    opacity: 0.85;
    font-weight: 400;
}

/* Phase Payment Table */
.prcalc-payment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.prcalc-payment-table thead {
    background: #f8f9fa;
}

.prcalc-payment-table th {
    padding: 0.75rem;
    text-align: left;
    color: #2a2a72;
    font-weight: 600;
    border-bottom: 2px solid #e0e3f7;
}

.prcalc-payment-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e0e3f7;
}

.prcalc-payment-table tbody tr:last-child td {
    border-bottom: none;
}

.prcalc-payment-table tbody tr:hover {
    background: #f9f9ff;
}

/* Pipedrive Loading States */
.prcalc-loading {
    position: relative;
    background-image: linear-gradient(
        90deg, 
        rgba(108, 99, 255, 0.1) 0%, 
        rgba(108, 99, 255, 0.2) 50%, 
        rgba(108, 99, 255, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.prcalc-loading option {
    background: rgba(108, 99, 255, 0.05) !important;
}

/* Contact Loading Feedback */
.prcalc-pipedrive-notification {
    animation: slideInRight 0.3s ease-out !important;
}

/* Responsive payment options */
@media (max-width: 768px) {
    .prcalc-payment-options {
        grid-template-columns: 1fr;
    }
    
    .prcalc-payment-upfront-amount {
        font-size: 2.25rem;
    }
}

/* Profit Margin Styles (Admin Only) */
.prcalc-profit-row {
    background: #fef3c7 !important;
    border-left: 4px solid #f59e0b !important;
}

.prcalc-profit-row .prcalc-result-label {
    color: #92400e !important;
    font-weight: 600;
}

.prcalc-tax-row {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
}

/* Responsive Enhancements for New Features */
@media (max-width: 1023px) {
    body .prcalc-calculator {
        max-width: 600px;
        padding: 2rem 1.5rem;
    }
    
    body .prcalc-calculator-wrapper {
        display: block;
    }
}

@media (max-width: 600px) {
    body .prcalc-calculator {
        padding: 1.5rem 1rem;
        margin: 1rem auto;
        border-radius: 16px;
    }
    
    body .prcalc-calculator h2 {
        font-size: 1.75rem;
    }
    
    body .prcalc-calculator p {
        font-size: 0.95rem;
    }
    
    /* Stack tabs vertically on mobile for 6 tabs */
    body .prcalc-tabs {
        flex-direction: column;
        gap: 0.25rem;
        border-bottom: none;
        margin-bottom: 1rem;
    }
    
    body .prcalc-tab-button {
        border-bottom: none;
        border-left: 3px solid transparent;
        margin-bottom: 0;
        text-align: left;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    body .prcalc-tab-button.active {
        border-left-color: #6c63ff;
        border-bottom-color: transparent;
    }
    
    .prcalc-addons-grid {
        grid-template-columns: 1fr;
    }
    
    .prcalc-payment-table {
        font-size: 0.85rem;
    }
    
    .prcalc-payment-table th,
    .prcalc-payment-table td {
        padding: 0.5rem;
    }
    
    .prcalc-phase {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Actions Section */
body .prcalc-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e3f7;
}

@media (min-width: 1024px) {
    body .prcalc-actions {
        grid-column: 1 / -1;
    }
}

/* Client Name Field Styles - Pipedrive Integration */
#prcalc-organization,
#prcalc-clientName {
    max-width: 100%;
    min-width: 0;
}

#prcalc-organization option,
#prcalc-clientName option {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pipedrive Controls Styling */
.prcalc-pipedrive-controls {
    margin-top: 0.5rem;
}

.prcalc-pipedrive-controls .prcalc-btn-small {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
}

.prcalc-pipedrive-controls .prcalc-btn-small:hover {
    background: #e5e7eb;
    transform: none;
}

/* Manual Entry Input */
#prcalc-clientName-manual {
    margin-top: 0.4rem !important;
}

/* Select2 Container Width */
.prcalc-calculator .select2-container {
    width: 100% !important;
    margin-top: 0.4rem;
}

/* Select2 Custom Styling */
.select2-container--default .select2-selection--single {
    height: auto !important;
    min-height: 3rem !important;
    border: 1px solid #d1d5e7 !important;
    border-radius: 10px !important;
    background: #f6f7fb !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

.select2-container--default .select2-selection--single:hover {
    border-color: #6c63ff !important;
    background: #fff !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #6c63ff !important;
    background: #fff !important;
    outline: none !important;
    box-shadow: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal !important;
    padding: 0.7rem 1rem !important;
    color: #2a2a72 !important;
    font-size: 1.08rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    right: 0.75rem !important;
    top: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #6c63ff transparent transparent transparent !important;
    border-width: 6px 5px 0 5px !important;
    margin-top: -3px !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #6c63ff transparent !important;
    border-width: 0 5px 6px 5px !important;
}

/* Select2 Dropdown */
.select2-dropdown {
    border: 2px solid #e0e3f7 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(44, 62, 80, 0.15) !important;
}

/* Success Notification Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.prcalc-success-notification {
    animation: slideInRight 0.3s ease-out !important;
}
    margin-top: 4px !important;
}

.select2-container--default .select2-results__option {
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #7c3aed !important;
    color: white !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #ede9fe !important;
    color: #7c3aed !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #e0e3f7 !important;
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.95rem !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #7c3aed !important;
    outline: none !important;
}

/* Select2 Clear Button */
.select2-container--default .select2-selection--single .select2-selection__clear {
    color: #9ca3af !important;
    font-size: 1.25rem !important;
    margin-right: 0.5rem !important;
    width: max-content !important;
    height: 47px !important;
    padding-right: 29px !important;

}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #ef4444 !important;
}