/* flatshare-calculator-style.css */
:root {
    --primary-color: #6C5CE7;
    --primary-light: #8983F7;
    --primary-dark: #564AD8;
    --secondary-color: #00B894;
    --secondary-light: #55efc4;
    --secondary-dark: #00a885;
    --background-color: #ffffff;
    --card-background: #f8f9fa;
    --text-color: #2d3436;
    --text-light: #636e72;
    --input-border-color: #dfe6e9;
    --clear-button-color: #ff7675;
    --clear-button-hover-color: #d63031;
    --box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    --border-radius: 12px;
    --input-radius: 8px;
    --success-color: #00b894;
    --info-color: #0984e3;
    --warning-color: #fdcb6e;
}

.flatshare-calculator {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    transition: all 0.3s ease;
}

.flatshare-calculator h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 25px;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

.flatshare-calculator h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--input-border-color);
    border-radius: var(--input-radius);
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
    background-color: #fff;
}

.form-group input.error {
    border-color: var(--clear-button-color);
    background-color: rgba(255, 118, 117, 0.05);
}

.error-message {
    color: var(--clear-button-color);
    font-size: 0.85rem;
    margin-top: 5px;
    margin-bottom: 0;
    font-weight: 500;
}

.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: var(--primary-light);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    margin-left: 5px;
    cursor: help;
}

.button-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.calculate-btn, .clear-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--input-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.calculate-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.calculate-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 7px 15px rgba(108, 92, 231, 0.5);
}

.calculate-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.4);
}

.clear-btn {
    background: linear-gradient(135deg, var(--clear-button-color), var(--clear-button-hover-color));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 118, 117, 0.4);
}

.clear-btn:hover {
    background: linear-gradient(135deg, var(--clear-button-hover-color), var(--clear-button-color));
    transform: translateY(-2px);
    box-shadow: 0 7px 15px rgba(255, 118, 117, 0.5);
}

.clear-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(255, 118, 117, 0.4);
}

.results {
    margin-top: 30px;
    padding: 25px;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    border-left: 4px solid var(--primary-color);
}

.results.show {
    opacity: 1;
    transform: translateY(0);
}

.results h3 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 1.3rem;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.savings-breakdown {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: var(--input-radius);
    margin-bottom: 20px;
    border: 1px solid var(--input-border-color);
}

.savings-breakdown p {
    margin: 10px 0;
    font-size: 1rem;
}

.savings-breakdown p strong {
    color: var(--primary-dark);
}

.monthly-savings-highlight, .annual-savings-highlight {
    font-size: 1.2rem;
    color: var(--secondary-color);
    background-color: rgba(0, 184, 148, 0.1);
    padding: 5px 10px;
    border-radius: var(--input-radius);
    display: inline-block;
    margin-left: 5px;
}

.benefits {
    margin-top: 25px;
    padding: 15px;
    background-color: rgba(0, 184, 148, 0.1);
    border-radius: var(--input-radius);
    border-left: 3px solid var(--secondary-color);
}

.benefits h4 {
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 15px;
}

.benefits ul {
    margin: 0;
    padding-left: 20px;
}

.benefits li {
    margin-bottom: 8px;
    color: var(--text-color);
}

.savings-chart-container {
    margin: 20px 0;
    height: 250px;
    position: relative;
}

.comparison-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--input-radius);
    border: 1px solid var(--input-border-color);
}

.comparison-icon {
    margin-right: 15px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.social-share {
    margin-top: 20px;
    text-align: center;
}

.social-share button {
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: var(--input-radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.social-share button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Styling for range inputs */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--input-border-color);
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

/* Calculator intro text */
.calculator-intro {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.6;
}

/* Tab styling */
.form-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--input-border-color);
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-light);
    position: relative;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
}

.tab.active:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.tab-content.active {
    display: block;
}

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

/* Range input styling */
.range-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.range-container input[type="number"] {
    width: 70px;
    flex-shrink: 0;
}

.range-container input[type="range"] {
    flex-grow: 1;
}

/* Select styling */
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--input-border-color);
    border-radius: var(--input-radius);
    font-size: 16px;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6"><path d="M0 0l6 6 6-6z" fill="%23666"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
    background-color: #fff;
}

/* Custom select with text input option */
.custom-select {
    position: relative;
}

.comparison-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

/* Dark mode styles */
.dark-mode {
    color: var(--text-light);
}

.dark-mode .results {
    border-left-color: var(--primary-light);
}

.dark-mode .savings-breakdown,
.dark-mode .comparison-item {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: var(--primary-dark);
}

.dark-mode .benefits {
    background-color: rgba(0, 184, 148, 0.05);
}

.dark-mode input,
.dark-mode select {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-light);
    border-color: var(--input-border-color);
}

.dark-mode input:focus,
.dark-mode select:focus {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Dark mode toggle */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg);
}

/* Loading indicator */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

.loading:after {
    content: "";
    width: 40px;
    height: 40px;
    border: 5px solid var(--input-border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Feature highlights */
.feature-highlight {
    margin: 30px 0;
    padding: 20px;
    background-color: rgba(108, 92, 231, 0.05);
    border-radius: var(--input-radius);
    border-left: 3px solid var(--primary-color);
    transition: all 0.3s ease;
}

.feature-highlight.environmental-impact {
    background-color: rgba(0, 184, 148, 0.05);
    border-left-color: var(--secondary-color);
}

.feature-title {
    color: var(--primary-color);
    margin-top: 0;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.environmental-impact .feature-title {
    color: var(--secondary-color);
}

.feature-title i {
    margin-right: 8px;
}

.field-note {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 5px;
    font-style: italic;
}

.tax-note {
    margin-top: 20px;
    padding: 10px 15px;
    background-color: rgba(253, 203, 110, 0.1);
    border-radius: var(--input-radius);
    font-size: 0.9rem;
    color: var(--text-light);
    border-left: 2px solid var(--warning-color);
}

.tax-note i {
    color: var(--warning-color);
    margin-right: 5px;
}

/* Responsive styles */
@media (max-width: 700px) {
    .flatshare-calculator {
        padding: 20px 15px;
        margin: 0 10px;
    }

    .form-group input,
    .form-group select {
        font-size: 14px;
        padding: 10px 12px;
    }

    .calculate-btn, .clear-btn {
        font-size: 14px;
        padding: 12px 10px;
    }

    .savings-chart-container {
        height: 200px;
    }

    .benefits ul {
        padding-left: 15px;
    }

    .comparison-container {
        grid-template-columns: 1fr;
    }

    .form-tabs {
        flex-direction: column;
    }

    .tab {
        width: 100%;
        padding: 10px;
        text-align: center;
    }

    .tab.active::after {
        width: 50%;
        left: 25%;
    }

    .range-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .range-container input[type="number"] {
        width: 100%;
        margin-top: 10px;
    }

    .social-share button {
        margin-bottom: 10px;
    }
}

/* Tablet-specific styles */
@media (min-width: 701px) and (max-width: 1024px) {
    .comparison-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .flatshare-calculator {
        max-width: 90%;
    }
}

/* Print styles for sharing */
@media print {
    .flatshare-calculator {
        box-shadow: none;
        max-width: 100%;
        padding: 0;
    }

    .button-group, .theme-toggle, .social-share, .form-tabs {
        display: none;
    }

    .results {
        margin-top: 0;
        opacity: 1 !important;
        transform: none !important;
        box-shadow: none;
        border: none;
    }

    .tab-content {
        display: none !important;
    }

    .savings-chart-container {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .benefits {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .calculator-intro {
        display: none;
    }

    .comparison-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation for benefits and other elements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.benefits li {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.benefits li:nth-child(1) { animation-delay: 0.1s; }
.benefits li:nth-child(2) { animation-delay: 0.2s; }
.benefits li:nth-child(3) { animation-delay: 0.3s; }
.benefits li:nth-child(4) { animation-delay: 0.4s; }
.benefits li:nth-child(5) { animation-delay: 0.5s; }
.benefits li:nth-child(6) { animation-delay: 0.6s; }

.feature-highlight {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.tax-note {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.7s;
    opacity: 0;
}

/* Dark mode adjustments for new elements */
.dark-mode .tax-note {
    background-color: rgba(253, 203, 110, 0.05);
    color: rgba(255, 255, 255, 0.7);
}

.dark-mode .feature-highlight {
    background-color: rgba(108, 92, 231, 0.1);
}

.dark-mode .feature-highlight.environmental-impact {
    background-color: rgba(0, 184, 148, 0.1);
}

.dark-mode .field-note {
    color: rgba(255, 255, 255, 0.6);
}
