/**
 * Geoda Calculator Styles
 * Version: 2.1.1
 * Modern, clean design for the calculator
 * Refined borders, colors, and spacing
 */

/* ============================================
   GENERAL STYLES & RESET
   ============================================ */

.geoda-calculator-page {
    direction: rtl;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.geoda-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

* {
    box-sizing: border-box;
}

/* ============================================
   MODE SELECTOR
   ============================================ */

.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 10px;
}

.radio-option {
    display: flex;
    align-items: stretch;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #fafafa;
    transition: all 0.3s ease;
    position: relative;
}

.radio-option:hover {
    border-color: #2c5aa0;
    background: #f0f4f8;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked ~ .radio-label {
    color: #2c5aa0;
}

.radio-option input[type="radio"]:checked ~ .radio-label::before {
    content: "✓";
    position: absolute;
    top: -18px;
    right: 0;
    background: #2c5aa0;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.radio-option:has(input:checked) {
    border-color: #2c5aa0;
    background: #e3f2fd;
    box-shadow: 0 2px 6px rgba(44, 90, 160, 0.1);
}

.radio-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    width: 100%;
}

.radio-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.radio-desc {
    font-size: 0.9em;
    color: #666;
}

/* ============================================
   MIXED USES SECTION
   ============================================ */

.subsection-title {
    font-size: 1.2em;
    color: #2c5aa0;
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
}

#usesContainer {
    margin-bottom: 20px;
}

.use-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 15px;
    align-items: end;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.use-row:hover {
    border-color: #2c5aa0;
    background: #f0f4f8;
}

.use-row .form-group {
    margin-bottom: 0;
}

.btn-remove-use {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-use:hover {
    background: #c82333;
    transform: scale(1.05);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 8px;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

/* ============================================
   USE SUMMARY
   ============================================ */

.use-summary {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(33, 150, 243, 0.15);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: #1565c0;
    font-size: 1em;
}

.summary-value {
    font-weight: 700;
    color: #0d47a1;
    font-size: 1.1em;
}

#summaryDiff.warning {
    background: #fff3cd;
    margin: -10px -20px 0 -20px;
    padding: 15px 20px;
    border-top: 1px solid #ffc107;
    border-radius: 0 0 8px 8px;
}

#summaryDiff.warning .summary-label,
#summaryDiff.warning .summary-value {
    color: #856404;
}

#summaryDiff.success {
    background: #d4edda;
    margin: -10px -20px 0 -20px;
    padding: 15px 20px;
    border-top: 1px solid #28a745;
    border-radius: 0 0 8px 8px;
}

#summaryDiff.success .summary-label,
#summaryDiff.success .summary-value {
    color: #155724;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.geoda-page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #2c5aa0;
}

.geoda-page-title {
    font-size: 2.5em;
    color: #2c5aa0;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.geoda-page-subtitle {
    font-size: 1.2em;
    color: #666;
    margin: 0;
    font-weight: 300;
}

/* ============================================
   FORM STRUCTURE
   ============================================ */

.geoda-calculator-form {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
}

.form-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.5em;
    color: #2c5aa0;
    margin: 0 0 25px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
}

.section-subtitle {
    color: #666;
    font-size: 0.95em;
    margin: -10px 0 20px 0;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.required {
    color: #d32f2f;
    margin-right: 3px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
    background-color: #fdfdfd;
}

.form-control:focus {
    outline: none;
    border-color: #2c5aa0;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.form-control:hover {
    border-color: #a0a0a0;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 0.85em;
    color: #777;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 40px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
    gap: 10px;
}

.btn-large {
    width: 100%;
    padding: 18px 28px;
    font-size: 1.15em;
}

.btn-primary {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a6f 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e3a6f 0%, #2c5aa0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #28a745 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.35);
}

.btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.btn-icon {
    font-size: 1.2em;
}

/* ============================================
   RESULTS SECTION
   ============================================ */

.calculator-results {
    background: #f8f9fa;
    padding: 35px;
    border-radius: 12px;
    margin: 35px 0;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-title {
    font-size: 1.8em;
    color: #2c5aa0;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.results-subtitle {
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

.results-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eeeeee;
}

.results-section-title {
    font-size: 1.2em;
    color: #2c5aa0;
    margin: 0 0 15px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: #555;
    font-size: 1em;
}

.result-value {
    font-weight: 700;
    color: #333;
    font-size: 1.05em;
}

.results-total {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #2c5aa0;
    box-shadow: 0 2px 10px rgba(44, 90, 160, 0.1);
}

.result-subtotal {
    font-size: 1.2em;
    padding: 15px 0;
}

.result-subtotal .result-label,
.result-subtotal .result-value {
    color: #2c5aa0;
}

.result-final {
    font-size: 1.4em;
    padding: 15px 0;
    border-top: 2px solid #e9ecef;
    margin-top: 10px;
}

.result-final .result-label,
.result-final .result-value {
    color: #28a745;
    font-weight: 800;
}

.results-note {
    background: #fff8e1;
    border: 1px solid #ffecb3;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.results-note p {
    margin: 0;
    color: #8d6e63;
    font-size: 0.9em;
}

/* ============================================
   MIXED USES RESULTS
   ============================================ */

#mixedResultsBreakdown {
    margin-bottom: 15px;
}

.use-result-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    border-right: 4px solid #2c5aa0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.use-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.use-result-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #2c5aa0;
}

.use-result-area {
    font-size: 0.95em;
    color: #666;
    font-weight: 600;
}

.use-result-costs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.use-cost-item {
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.use-cost-label {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.use-cost-value {
    display: block;
    font-size: 1.1em;
    font-weight: 700;
    color: #2c5aa0;
}

.use-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #2c5aa0;
    color: white;
    border-radius: 50%;
    font-size: 0.9em;
    font-weight: bold;
    margin-left: 8px;
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact-section {
    background: #f8f9fa;
    padding: 35px;
    border-radius: 12px;
    margin-top: 35px;
    border: 1px solid #e0e0e0;
}

.section-header {
    text-align: center;
    margin-bottom: 25px;
}

.privacy-note {
    text-align: center;
    margin-top: 20px;
}

.privacy-note p {
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

/* ============================================
   LOADING INDICATOR
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1em;
    color: #333;
    margin: 0;
    font-weight: 600;
}

/* ============================================
   MESSAGES
   ============================================ */

.form-messages {
    padding: 18px 20px;
    border-radius: 8px;
    margin: 25px 0;
    font-size: 1em;
    font-weight: 500;
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-messages.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-messages.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-messages.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.form-messages.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.form-messages p {
    margin: 0;
}

/* ============================================
   ADDITIONAL INFO BOX
   ============================================ */

.additional-info {
    margin-top: 40px;
}

.info-box {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 25px;
}

.info-box h3 {
    color: #1565c0;
    margin: 0 0 15px 0;
    font-size: 1.2em;
}

.info-box ul {
    margin: 0;
    padding: 0 0 0 25px;
    list-style-type: none;
}

.info-box li {
    margin-bottom: 10px;
    color: #0d47a1;
    position: relative;
    padding-right: 20px;
}

.info-box li:before {
    content: "✓";
    position: absolute;
    right: 0;
    color: #2196f3;
    font-weight: bold;
}

.info-box li:last-child {
    margin-bottom: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .geoda-container {
        padding: 20px 15px;
    }
    
    .geoda-page-title {
        font-size: 1.8em;
    }
    
    .geoda-page-subtitle {
        font-size: 1em;
    }
    
    .geoda-calculator-form {
        padding: 25px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .calculator-results,
    .contact-section {
        padding: 25px 20px;
    }
    
    .results-title {
        font-size: 1.5em;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .result-final {
        font-size: 1.2em;
    }
    
    .btn-large {
        padding: 16px 24px;
        font-size: 1em;
    }
    
    .section-title {
        font-size: 1.3em;
    }
    
    .info-box {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .geoda-page-title {
        font-size: 1.5em;
    }
    
    .geoda-calculator-form {
        padding: 20px 15px;
    }
    
    .calculator-results,
    .contact-section {
        padding: 20px 15px;
    }
    
    .loading-content {
        padding: 30px 20px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .btn,
    .contact-section,
    .additional-info,
    .privacy-note {
        display: none !important;
    }
    
    .calculator-results {
        border: 2px solid #000;
        box-shadow: none;
    }
    
    .geoda-calculator-form {
        box-shadow: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.form-control:focus,
.btn:focus {
    outline: 3px solid #2c5aa0;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 2px;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
