/* ==========================================
   Calculator Page Styles - Compact Version
   ========================================== */

.calculator-container {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    animation: fadeIn 0.6s ease;
}

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

.calculator-body {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    align-items: start;
}

/* ==========================================
   Form Sections - باکس‌های فشرده
   ========================================== */

.form-sections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.3rem;
    box-shadow: 0 4px 20px rgba(169, 182, 212, 0.15);
    border: 1px solid rgba(66, 125, 192, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(135deg, #203F78 0%, #6e92da 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.section:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(169, 182, 212, 0.25);
}

.section:hover::before {
    transform: scaleY(1);
}

.section h2 {
    color: #1f3079;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid rgba(66, 125, 192, 0.1);
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(135deg, #203F78 0%, #6e92da 100%);
}

/* ==========================================
   Input Groups - فشرده
   ========================================== */

.input-group {
    margin-bottom: 0.8rem;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
}

.input-group input[type="number"] {
    width: 70px;
    padding: 0.5rem 0.8rem;
    border: 2px solid rgba(66, 125, 192, 0.2);
    border-radius: 10px;
    font-family: 'Yekan Bakh', sans-serif;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: #427dc0;
    box-shadow: 0 0 0 3px rgba(66, 125, 192, 0.1);
    background: white;
}

.input-group span {
    color: #4a5868;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==========================================
   Radio & Checkbox - افقی و فشرده
   ========================================== */

.radio-group {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.checkbox-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.radio-group label,
.checkbox-list label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: rgba(66, 125, 192, 0.03);
    font-size: 0.9rem;
}

.radio-group label {
    flex: 1;
    min-width: fit-content;
    justify-content: center;
}

.radio-group label:hover,
.checkbox-list label:hover {
    background: rgba(66, 125, 192, 0.08);
    transform: translateX(-3px);
}

/* Custom Radio Button - کوچکتر */
.radio-group input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #427dc0;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio-group input[type="radio"]:checked {
    background: linear-gradient(135deg, #203F78 0%, #6e92da 100%);
    border-color: #203F78;
}

.radio-group input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

/* Custom Checkbox - کوچکتر */
.checkbox-list input[type="checkbox"],
.section > label input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #427dc0;
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-list input[type="checkbox"]:checked,
.section > label input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #203F78 0%, #6e92da 100%);
    border-color: #203F78;
}

.checkbox-list input[type="checkbox"]:checked::after,
.section > label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.radio-group span,
.checkbox-list span {
    color: #4a5868;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==========================================
   Notes - فشرده‌تر
   ========================================== */

.note {
    background: linear-gradient(135deg, rgba(32, 63, 120, 0.05) 0%, rgba(110, 146, 218, 0.05) 100%);
    border-right: 3px solid #427dc0;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #5A5A78;
    margin-top: 0.8rem;
}

/* ==========================================
   Total Section - سایدبار فشرده
   ========================================== */

.total-section {
    position: sticky;
    top: 110px;
    background: linear-gradient(135deg, rgba(32, 63, 120, 0.95) 0%, rgba(66, 125, 192, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 35px rgba(32, 63, 120, 0.4);
    color: white;
    animation: slideInLeft 0.6s ease;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

/* Custom Scrollbar */
.total-section::-webkit-scrollbar {
    width: 6px;
}

.total-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.total-section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.total-section::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

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

.total-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

#priceBreakdown {
    margin-bottom: 1.2rem;
    max-height: 300px;
    overflow-y: auto;
    padding-left: 0.3rem;
}

/* Custom Scrollbar for breakdown */
#priceBreakdown::-webkit-scrollbar {
    width: 5px;
}

#priceBreakdown::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

#priceBreakdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

#priceBreakdown > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

#priceBreakdown > div:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-3px);
}

#priceBreakdown span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

#priceBreakdown strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

/* ==========================================
   Total Price Container - فشرده
   ========================================== */

.total-price-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.total-label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: rgba(255, 255, 255, 0.9);
}

#totalPrice {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   Submit Button - فشرده
   ========================================== */

.total-section button {
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #e8f0ff 100%);
    color: #203F78;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-family: 'Yekan Bakh', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.total-section button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(32, 63, 120, 0.1), transparent);
    transition: left 0.5s;
}

.total-section button:hover::before {
    left: 100%;
}

.total-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

.total-section button:active {
    transform: translateY(0);
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 1200px) {
    .calculator-body {
        grid-template-columns: 1fr 340px;
    }
    
    .form-sections {
        gap: 0.8rem;
    }
}

@media (max-width: 968px) {
    .calculator-container {
        padding: 1rem;
    }

    .calculator-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .form-sections {
        grid-template-columns: 1fr;
    }

    .total-section {
        position: relative;
        top: 0;
        max-height: none;
    }

    .section {
        padding: 1.2rem;
    }
}

@media (max-width: 768px) {
    .calculator-container {
        margin: 1rem auto;
    }

    .section h2 {
        font-size: 1.1rem;
    }

    .radio-group {
        flex-direction: column;
    }
    
    .radio-group label {
        justify-content: flex-start;
    }

    .note {
        font-size: 0.75rem;
        padding: 0.6rem 0.8rem;
    }

    .total-section {
        padding: 1.2rem;
    }

    #totalPrice {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .calculator-container {
        padding: 0.8rem;
    }

    .section {
        padding: 1rem;
        border-radius: 12px;
    }

    .section h2 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }

    .input-group input[type="number"] {
        width: 60px;
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }

    .radio-group label,
    .checkbox-list label {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
    }

    #priceBreakdown > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        padding: 0.6rem;
    }

    .total-section button {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem;
    }
}

/* ==========================================
   Additional Animations
   ========================================== */

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(66, 125, 192, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(66, 125, 192, 0);
    }
}

.section:focus-within {
    animation: pulse 2s infinite;
}

/* Smooth transitions */
#supportSection,
#onsiteSection,
#branchSection {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 400px;
        transform: translateY(0);
    }
}


/* Counter Group Styles */
.counter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(66, 125, 192, 0.05);
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
}

.counter-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #427dc0;
    background: white;
    color: #427dc0;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.counter-btn:hover {
    background: linear-gradient(135deg, #203F78 0%, #6e92da 100%);
    color: white;
    border-color: #203F78;
    transform: scale(1.1);
}

.counter-btn:active {
    transform: scale(0.95);
}

.counter-group input[type="number"] {
    width: 50px;
    padding: 0.4rem;
    border: 2px solid rgba(66, 125, 192, 0.2);
    border-radius: 8px;
    font-family: 'Yekan Bakh', sans-serif;
    font-size: 1rem;
    text-align: center;
    background: white;
    font-weight: 600;
    color: #1f3079;
}

.counter-label {
    color: #4a5868;
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 0.3rem;
}

/* Responsive */
@media (max-width: 480px) {
    .counter-group {
        padding: 0.4rem 0.6rem;
    }
    
    .counter-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .counter-group input[type="number"] {
        width: 45px;
        font-size: 0.9rem;
    }
}

/* Modal Styles */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-content h2 {
    color: #1f3079;
    margin-bottom: 1rem;
    text-align: center;
}

.modal-content p {
    color: #5A5A78;
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-form input {
    padding: 1rem;
    border: 2px solid rgba(66, 125, 192, 0.2);
    border-radius: 12px;
    font-family: 'Yekan Bakh', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal-form input:focus {
    outline: none;
    border-color: #427dc0;
    box-shadow: 0 0 0 4px rgba(66, 125, 192, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.submit-btn, .cancel-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-family: 'Yekan Bakh', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn {
    background: linear-gradient(135deg, #203F78 0%, #6e92da 100%);
    color: white;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 125, 192, 0.4);
}

.cancel-btn {
    background: #f0f0f0;
    color: #4a5868;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

/* Success Modal */
.modal-content.success {
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: white;
    font-size: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: scaleIn 0.5s ease;
}

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

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

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

/* انیمیشن موفقیت */
.success-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.checkmark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #4CAF50;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #4CAF50;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
    position: relative;
}

.checkmark_stem {
    animation: checkmark .6s cubic-bezier(.65,0,.45,1) forwards;
}

.checkmark_kick {
    animation: checkmark-kick .6s cubic-bezier(.65,0,.45,1) .2s forwards;
}

@keyframes checkmark {
    0% { stroke-dashoffset: 100px; }
    100% { stroke-dashoffset: 0px; }
}

@keyframes checkmark-kick {
    0% { stroke-dashoffset: 40px; }
    100% { stroke-dashoffset: 0px; }
}

/* استایل مودال */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.input-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #1f3079;
}

.input-group small {
    color: #666;
    font-size: 0.85rem;
}

.price-summary {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.summary-item.total {
    border-top: 2px solid #ddd;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.security-note {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.5rem;
    background: #e8f5e8;
    border-radius: 5px;
}

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

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