/**
 * GreenIT - CO2 Calculator Styles
 */

.calculator-section {
    padding: var(--spacing-xxl) 0;
    background-color: var(--color-light);
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.calculator-form {
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.calculator-results {
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    padding-top: calc(var(--spacing-xl) + 35px); /* Restore original top padding */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
}

.calculator-form h2 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
    margin-top: 0;
    font-size: 1.8rem;
}

.calculator-results h2 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-md); /* Restore original bottom margin for title */
    margin-top: 0;
    font-size: 1.8rem;
    position: absolute;
    top: var(--spacing-xl); /* Restore original top position */
    left: var(--spacing-md);
}

.calculator-form h2 .green-text {
    color: var(--color-primary);
}

.calculator-form p {
    margin-bottom: var(--spacing-md);
    color: var(--color-gray-600);
}

/* Essential input area styles */
.essential-inputs {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-gray-200);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group.required label::after {
    content: " *";
    color: var(--color-danger);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--color-gray-700);
}

.form-group select,
.form-group input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius-sm);
    background-color: var(--color-white);
    font-family: inherit;
    font-size: 1rem;
}

.form-group input[type="range"] {
    width: 100%;
    margin-top: var(--spacing-sm);
}

.form-group input[type="number"]::placeholder {
    color: var(--color-gray-400);
    font-style: italic;
}

.form-group .input-hint {
    display: block;
    margin-top: 5px;
    color: var(--color-gray-500);
    font-size: 0.85rem;
}

/* Refurbishment level description styles */
.refurbishment-description {
    display: flex;
    align-items: flex-start;
    margin-top: 8px;
    padding: 10px;
    background-color: rgba(46, 204, 113, 0.1);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.refurbishment-icon {
    flex-shrink: 0;
    margin-right: 8px;
    color: var(--color-primary);
}

.refurbishment-text {
    font-size: 0.85rem;
    color: var(--color-gray-700);
    line-height: 1.4;
}

/* Colors for different refurbishment levels */
.refurbishment-basic {
    background-color: rgba(52, 152, 219, 0.1);
    border-left-color: #3498db;
}

.refurbishment-basic .refurbishment-icon {
    color: #3498db;
}

.refurbishment-standard {
    background-color: rgba(46, 204, 113, 0.1);
    border-left-color: var(--color-primary);
}

.refurbishment-standard .refurbishment-icon {
    color: var(--color-primary);
}

.refurbishment-premium {
    background-color: rgba(155, 89, 182, 0.1);
    border-left-color: #9b59b6;
}

.refurbishment-premium .refurbishment-icon {
    color: #9b59b6;
}

.range-value {
    margin-top: var(--spacing-xs);
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-gray-600);
}

/* Advanced and custom options buttons */
.options-toggle {
    margin-bottom: var(--spacing-md);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-700);
    padding: 10px 15px;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: var(--color-gray-100);
}

.toggle-icon {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.btn-outline.active .toggle-icon {
    transform: rotate(45deg);
}

/* Collapsible panel styles */
.options-panel {
    background-color: var(--color-gray-50);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.options-panel.active {
    max-height: 1000px;
    opacity: 1;
    border: 1px solid var(--color-gray-200);
}

.panel-content {
    padding: var(--spacing-md);
}

.panel-content h3 {
    color: var(--color-gray-800);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
}

.option-description {
    color: var(--color-gray-600);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

/* Calculate button styles */
.calculate-btn {
    margin-top: var(--spacing-sm);
    width: 100%;
    padding: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    background-color: var(--color-primary);
    border: none;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.2);
    transform: translateY(0);
    transition: all 0.3s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.3);
    background-color: #27ae60; /* Slightly darker green on hover */
}

/* Primary result - CO2 reduction */
.primary-result {
    background-color: var(--color-light);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: var(--spacing-sm);
    border-left: 4px solid var(--color-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.primary-result:hover {
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.1);
    transform: translateY(-3px);
}

/* Optimize CO2 icon display */
.primary-result .result-icon {
    height: 90px;
    width: 90px;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(46, 204, 113, 0.1);
    border-radius: 50%;
    position: relative;
}

.primary-result .result-icon img {
    height: 60px;
    width: 60px;
    color: var(--color-primary);
    filter: drop-shadow(0 2px 3px rgba(46, 204, 113, 0.2));
    transition: transform 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.primary-result-value {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: var(--spacing-sm) 0;
}

.primary-result-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-gray-700);
}

/* Equivalent indicator notice */
.equivalent-notice {
    text-align: center;
    margin: var(--spacing-sm) 0; /* Restore original top and bottom margins */
    font-size: 1rem;
    color: var(--color-gray-600);
    font-style: italic;
}

/* Secondary result - Equivalent indicator */
.secondary-results {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md); /* Restore original bottom margin */
}

.secondary-result-box {
    background-color: rgba(46, 204, 113, 0.05);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    text-align: center;
    transition: transform 0.3s ease;
}

.secondary-result-box:hover {
    transform: translateY(-3px);
}

.secondary-result-box .result-icon {
    height: 70px;
    width: 70px;
    margin: 0 auto var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(46, 204, 113, 0.05);
    border-radius: 50%;
    position: relative;
}

.secondary-result-box .result-icon img {
    height: 45px;
    width: 45px;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.secondary-result-box:hover .result-icon img {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12);
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

.result-label {
    font-size: 0.9rem;
    color: var(--color-gray-600);
}

.result-explanation {
    font-size: 0.75rem;
    color: var(--color-gray-500);
    font-style: italic;
    margin-top: 3px;
}

/* Calculation breakdown styles */
.calculation-breakdown {
    background-color: var(--color-light);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    margin-top: var(--spacing-md); /* Restore original top margin */
    margin-bottom: var(--spacing-md); /* Restore original bottom margin */
}

.calculation-breakdown h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm); /* Restore original bottom margin for title */
    font-size: 1.4rem;
}

.breakdown-grid {
    display: grid;
    gap: var(--spacing-xs);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px dashed var(--color-gray-300);
    position: relative;
}

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

.breakdown-label {
    font-weight: 500;
    color: var(--color-gray-700);
    display: flex;
    align-items: center;
}

/* Add reduction/emission indicator */
.breakdown-item:not(.total) .breakdown-label::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Reduction item styles (positive environmental impact) - Use green minus icon */
.breakdown-item.reduction .breakdown-label::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232ecc71' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

/* Emission item styles (negative environmental impact) - Use red plus icon */
.breakdown-item.emission .breakdown-label::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23e74c3c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

.breakdown-value {
    font-weight: 600;
    color: var(--color-success);
    display: flex;
    align-items: center;
}

/* Add value styles for reduction/emission */
.breakdown-item.reduction .breakdown-value {
    color: var(--color-success);
    position: relative;
}

.breakdown-item.reduction .breakdown-value::before {
    content: "";
    margin-right: 0;
}

.breakdown-item.emission .breakdown-value {
    color: var(--color-danger);
    position: relative;
}

.breakdown-item.emission .breakdown-value::before {
    content: "";
    margin-right: 0;
}

/* Add background color hint */
.breakdown-item.reduction {
    background-color: rgba(46, 204, 113, 0.05);
    border-left: 3px solid var(--color-success);
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
    padding-left: 8px;
}

.breakdown-item.emission {
    background-color: rgba(231, 76, 60, 0.05);
    border-left: 3px solid var(--color-danger);
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
    padding-left: 8px;
}

.breakdown-item.total {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-xs);
    border-top: 2px solid var(--color-gray-300);
    border-bottom: none;
    background-color: rgba(46, 204, 113, 0.1);
    border-radius: var(--border-radius-sm);
}

.breakdown-item.total .breakdown-label {
    font-size: 1.1rem;
    font-weight: 600;
}

.breakdown-item.total .breakdown-value {
    font-size: 1.1rem;
}

/* Total positive (reduction) styles */
.breakdown-item.total.positive .breakdown-value {
    color: var(--color-success);
}

/* Total negative (emission) styles */
.breakdown-item.total.negative .breakdown-value {
    color: var(--color-danger);
}

/* Other result area styles */
.result-details {
    background-color: var(--color-light);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
}

.result-details h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
    font-size: 1.4rem;
}

.result-details p {
    margin-bottom: var(--spacing-sm);
    color: var(--color-gray-600);
    line-height: 1.6;
}

.calculator-info {
    padding: var(--spacing-xxl) 0;
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.calculator-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(46, 204, 113, 0.07) 0%, transparent 60%),
                radial-gradient(circle at 90% 80%, rgba(46, 204, 113, 0.07) 0%, transparent 60%);
    z-index: 1;
}

.calculator-info .container {
    position: relative;
    z-index: 2;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns for desktop */
    gap: var(--spacing-xl);
}

.calculator-info .info-card {
    display: block;
    text-align: center;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(46, 204, 113, 0.1);
    overflow: hidden;
}

.calculator-info .info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(46, 204, 113, 0.08) 0%, 
        rgba(46, 204, 113, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.calculator-info .info-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, 
        var(--color-primary) 0%, 
        #27ae60 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1;
}

.calculator-info .info-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.25);
}

.calculator-info .info-card:hover::before {
    opacity: 1;
}

.calculator-info .info-card:hover::after {
    transform: scaleX(1);
}

.calculator-info .info-icon-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(46, 204, 113, 0.12) 0%, 
        rgba(46, 204, 113, 0.18) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.1);
}

.calculator-info .info-icon-wrapper::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px dashed rgba(46, 204, 113, 0.2);
    opacity: 0;
    transform: scale(1.1);
    transition: all 0.4s ease;
}

.calculator-info .info-card:hover .info-icon-wrapper {
    background: linear-gradient(135deg, 
        rgba(46, 204, 113, 0.15) 0%, 
        rgba(46, 204, 113, 0.25) 100%);
    transform: scale(1.05) rotate(5deg);
}

.calculator-info .info-card:hover .info-icon-wrapper::after {
    opacity: 1;
    transform: scale(1);
    animation: rotate 15s linear infinite;
}

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

.calculator-info .info-icon {
    height: 50px;
    width: auto;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

.calculator-info .info-card:hover .info-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.15));
}

.calculator-info .info-card h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

.calculator-info .info-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(46, 204, 113, 0.5) 0%, 
        rgba(46, 204, 113, 0.8) 100%);
}

.calculator-info .info-card p {
    color: var(--color-gray-600);
    line-height: 1.7;
    font-size: 1.02rem;
    position: relative;
}

/* CTA area optimization */
.cta-section {
    padding: var(--spacing-xxl) 0;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: var(--color-white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='rgba(255,255,255,0.05)' fill-rule='evenodd'/%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

.cta-section .container {
    position: relative;
    z-index: 2;
}

.cta-section h2 {
    color: var(--color-white);
    margin-bottom: var(--spacing-md);
    font-size: 2.8rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cta-section p {
    max-width: 700px;
    margin: 0 auto var(--spacing-lg);
    opacity: 1;
    font-size: 1.2rem;
    line-height: 1.7;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.cta-section .btn {
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
    background-color: var(--color-white);
    color: var(--color-primary);
    border: none;
}

.cta-section .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
    background-color: var(--color-white);
}

/* Form validation styles */
/* Show validation styles only after form submission */
.was-validated .form-group select:invalid,
.was-validated .form-group input:invalid {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.was-validated .form-group select:focus:invalid,
.was-validated .form-group input:focus:invalid {
    outline: none;
}

/* Custom validation message styles */
.was-validated select:required:invalid {
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23dc3545' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
}

/* Responsive styles */
@media (max-width: 992px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }

    .calculator-form,
    .calculator-results {
        margin-bottom: var(--spacing-lg);
    }
    
    /* Change info-grid to 2 columns on tablets */
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .calculator-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Change info-grid to single column on mobile */
    .info-grid {
        grid-template-columns: 1fr; /* Single column for mobile */
        gap: var(--spacing-lg);
    }
    
    /* Adjust info-card for single column layout */
    .calculator-info .info-card {
        max-width: 500px;
        margin: 0 auto var(--spacing-md); /* Add bottom margin between cards */
    }
    
    /* Optimize hover effects for touch devices */
    .calculator-info .info-card:hover {
        transform: translateY(-5px); /* Reduced hover effect */
    }

    /* For touch devices, reduce or eliminate hover effects */
    @media (hover: none) {
        .calculator-info .info-card:hover {
            transform: translateY(-5px);
        }
        
        .calculator-info .info-card:active {
            transform: translateY(-5px);
        }
    }
    
    .calculator-form,
    .calculator-results {
        margin-bottom: 0;
        height: auto;
    }
    
    /* Mobile down adjustment for result area padding */
    .calculator-results {
        padding-top: var(--spacing-md);
        padding-bottom: var(--spacing-md);
    }
    
    .calculator-results h2 {
        position: static;
        margin-top: 0;
        margin-bottom: var(--spacing-md);
        text-align: center;
    }
    
    /* Primary result area adjustment on mobile */
    .primary-result {
        padding: var(--spacing-sm);
    }
    
    .primary-result-value {
        font-size: 3rem;
    }
    
    /* Secondary result on mobile to single column */
    .secondary-results {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* hero area text size adjustment */
    #means .hardware-hero-content h2 {
        font-size: clamp(2rem, 3vw, 2.5rem);
        margin-bottom: 0.8rem;
        line-height: 1.3;
    }
    
    #means .hardware-hero-content p {
        font-size: clamp(1rem, 1.5vw, 1.1rem);
        line-height: 1.5;
        max-width: 600px;
        padding: 0 20px;
    }
    
    #means .divider {
        margin: 15px auto 20px;
        width: 80px;
        height: 3px;
    }
    
    /* Title text size adjustment */
    .calculator-section h2 {
        font-size: 1.8rem;
    }
    
    /* Your Environmental Impact title area adjustment */
    .primary-result-label {
        font-size: 1rem;
    }

    #means .hardware-hero-bg {
        object-position: center center; /* Ensure image is centered on mobile */
    }

    /* Add these lines to ensure mobile responsiveness */
    .calculator-section .container {
        padding-left: 10px;
        padding-right: 10px;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .calculator-form,
    .calculator-results {
        padding: var(--spacing-md);
    }
    
    .panel-content {
        padding: var(--spacing-sm);
    }
    
    .simple-hero-content h1 {
        font-size: clamp(1.8rem, 3.5vw, 2.2rem) !important;
    }
    
    .simple-hero-content p {
        font-size: clamp(0.85rem, 1.5vw, 1rem) !important;
        max-width: 90% !important;
    }
    
    #means .hardware-hero-content h2 {
        font-size: 1.6rem;
        margin-bottom: 0.4rem;
        padding: 0 10px;
    }
    
    #means .hardware-hero-content p {
        font-size: 0.85rem;
        line-height: 1.3;
        padding: 0 15px;
    }
    
    #means .divider {
        margin: 10px auto 12px;
        width: 60px;
        height: 3px;
    }
    
    .primary-result-value {
        font-size: 2.2rem;
    }
    
    .primary-result-label {
        font-size: 1rem;
    }
    
    .calculator-results {
        margin-top: var(--spacing-lg);
    }

    /* Further optimize info cards */
    .calculator-info .info-card {
        padding: var(--spacing-lg);
    }
    
    .calculator-info .info-icon-wrapper {
        width: 70px;
        height: 70px;
        margin-bottom: var(--spacing-sm);
    }
    
    .calculator-info .info-icon {
        height: 40px;
    }
    
    .calculator-info .info-card h3 {
        font-size: 1.3rem;
        margin-bottom: var(--spacing-sm);
        padding-bottom: 10px;
    }
    
    .calculator-info .info-card p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Reduce calculator-info padding on mobile */
    .calculator-info {
        padding: var(--spacing-xl) 0;
    }
}

@media (max-width: 375px) {
    /* Force viewport content to stay within boundaries - Only apply specific properties */
    html, body {
        overflow-x: hidden !important;
    }
    
    /* Ensure the calculator section doesn't overflow but preserves layout */
    .calculator-section .container,
    .calculator-container,
    .calculator-form,
    form,
    .tabs-container,
    .tab-content,
    .essential-inputs {
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    /* Keep tab buttons in one line for mobile */
    .tabs-header {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px; /* Add small padding to prevent scrollbar overlap */
    }
    
    /* Make tab buttons smaller to fit in one row */
    .tab-btn {
        padding: 8px 6px;
        font-size: 0.85rem;
        margin-right: 2px;
        white-space: nowrap;
    }
    
    .tab-btn[data-tab="basic"] {
        padding: 8px 8px;
        font-size: 0.9rem;
    }
    
    .simple-hero-content h1 {
        font-size: clamp(1.6rem, 3vw, 1.8rem) !important;
        padding: 0 10px;
    }
    
    .simple-hero-content p {
        padding: 0 15px;
        line-height: 1.4 !important;
    }
    
    .calculator-form h2,
    .calculator-results h2 {
        font-size: 1.5rem;
    }
    
    .calculator-form p {
        font-size: 0.9rem;
    }
    
    /* Mobile hero area adjustment for very small screens */
    #means .hardware-hero-content h2 {
        font-size: clamp(1.5rem, 2vw, 1.8rem);
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    #means .hardware-hero-content p {
        font-size: 0.85rem;
        line-height: 1.3;
        padding: 0 15px;
    }
    
    #means .divider {
        margin: 10px auto 12px;
        width: 50px;
    }
    
    /* "Your Environmental Impact" title area adjustment */
    .calculator-container {
        gap: var(--spacing-md);
    }
    
    .primary-result-value {
        font-size: 2.2rem;
        margin: 0.3rem 0;
    }
    
    .primary-result-label {
        font-size: 0.9rem;
    }
    
    /* Calculator form title adjustment */
    .calculator-form h2 {
        font-size: 1.4rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .calculator-form p {
        font-size: 0.85rem;
    }
    
    /* Further optimize info cards for very small screens */
    .calculator-info .info-card {
        padding: var(--spacing-md);
    }
    
    .calculator-info .info-icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .calculator-info .info-icon {
        height: 35px;
    }
    
    .calculator-info .info-card h3 {
        font-size: 1.2rem;
    }
    
    .calculator-info .info-card p {
        font-size: 0.9rem;
    }

    /* Simplified padding for small screens */
    .calculator-form {
        padding: 15px 10px;
    }
    
    /* Fix tabs to be more compact */
    .tabs-header {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
        justify-content: flex-start;
        scrollbar-width: none;
    }
    
    .tabs-header::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        padding: 8px 10px;
        font-size: 0.9rem;
        margin-bottom: 0;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Fix the refurbishment text overflow */
    .refurbishment-description {
        flex-wrap: wrap;
    }
    
    .refurbishment-text {
        width: 100%;
        margin-top: 5px;
    }
}

/* Ultra small screen fixes (iPhone SE and similar) */
@media (max-width: 320px) {
    .calculator-form {
        padding: var(--spacing-sm);
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group select,
    .form-group input[type="number"] {
        padding: 10px 8px;
        font-size: 0.9rem;
    }
    
    /* More compact tabs - already set in media queries above, can be deleted or kept consistent */
    /* .tabs-header {
        justify-content: center;
    }
    
    .tab-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .tab-btn[data-tab="basic"] {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .tab-btn[data-tab="advanced"]::after,
    .tab-btn[data-tab="custom"]::after {
        font-size: 0.6rem;
    } */
    
    /* Redefine ultra-small screen device tab styles, consistent with above styles but further reduced */
    .tab-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
        margin-right: 2px;
        margin-bottom: 2px;
    }
    
    .tab-btn[data-tab="basic"] {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .tab-btn[data-tab="advanced"]::after,
    .tab-btn[data-tab="custom"]::after {
        font-size: 0.55rem;
    }
    
    /* Ensure all content uses border-box sizing */
    .essential-inputs,
    .panel-content,
    #co2-calculator {
        width: 100%;
        box-sizing: border-box;
        padding-left: 0;
        padding-right: 0;
    }
}

/* Tabs styles optimization */
.tabs-container {
    margin-bottom: var(--spacing-md);
}

.tabs-header {
    display: flex;
    /* No wrapping by default on desktop */
    flex-wrap: nowrap;
    border-bottom: 2px solid var(--color-gray-300);
    margin-bottom: var(--spacing-md);
    position: relative;
}

/* Medium screen optimization (iPhone 12 Pro, etc.) */
@media (max-width: 428px) {
    .tabs-header {
        flex-wrap: nowrap; /* Keep tabs in a single row */
        justify-content: space-between; /* Distribute tabs evenly */
        width: 100%; /* Ensure tab container takes full width */
        margin-bottom: var(--spacing-sm); /* Reduce bottom margin */
    }
    
    .tab-btn {
        padding: 8px 4px; /* Reduce padding */
        font-size: 0.75rem; /* Further reduce font size */
        margin-right: 2px; /* Reduce right margin */
        margin-bottom: 0; /* Remove bottom margin */
        width: 32%; /* Set width slightly less than 1/3 of screen */
        text-align: center; /* Center text */
        box-sizing: border-box; /* Ensure padding doesn't increase element width */
        height: auto; /* Auto-adjust height based on content */
        white-space: normal; /* Force text wrapping */
        overflow-wrap: break-word; /* Ensure long words can wrap */
        line-height: 1.1; /* Reduce line height */
    }
    
    /* Apply smaller font to Advanced and Custom words */
    .tab-btn[data-tab="advanced"] {
        font-size: 0.7rem; /* Smaller font */
    }
    
    .tab-btn[data-tab="custom"] {
        font-size: 0.7rem; /* Smaller font */
    }
    
    .tab-btn[data-tab="basic"] {
        padding: 8px 4px; /* Consistent padding with other tabs */
        font-size: 0.8rem; /* Slightly larger font */
    }
    
    /* Reduce optional label text */
    .tab-btn[data-tab="advanced"]::after,
    .tab-btn[data-tab="custom"]::after {
        font-size: 0.55rem; /* Smaller optional label */
        margin-top: 1px; /* Reduce top margin */
    }
}

/* Small screen further optimization (iPhone SE, etc.) */
@media (max-width: 375px) {
    .tabs-header {
        flex-wrap: nowrap; /* Keep tabs in a single row */
        justify-content: space-between; /* Distribute tabs evenly */
        width: 100%; /* Ensure tab container takes full width */
        margin-bottom: var(--spacing-sm); /* Reduce bottom margin */
    }
    
    .tab-btn {
        padding: 6px 3px; /* Further reduce padding */
        font-size: 0.7rem; /* Smaller font */
        margin-right: 1px; /* Smaller right margin */
        margin-bottom: 0; /* Remove bottom margin */
        width: 32%; /* Set width slightly less than 1/3 of screen */
        text-align: center; /* Center text */
        box-sizing: border-box; /* Ensure padding doesn't increase element width */
        height: auto; /* Auto-adjust height based on content */
        white-space: normal; /* Force text wrapping */
        overflow-wrap: break-word; /* Ensure long words can wrap */
        line-height: 1.1; /* Reduce line height */
    }
    
    /* Apply smaller font to Advanced and Custom words */
    .tab-btn[data-tab="advanced"] {
        font-size: 0.65rem; /* Smaller font */
    }
    
    .tab-btn[data-tab="custom"] {
        font-size: 0.65rem; /* Smaller font */
    }
    
    .tab-btn[data-tab="basic"] {
        padding: 6px 3px; /* Consistent padding with other tabs */
        font-size: 0.75rem; /* Slightly larger font */
    }
    
    /* Smaller optional label text */
    .tab-btn[data-tab="advanced"]::after,
    .tab-btn[data-tab="custom"]::after {
        font-size: 0.5rem; /* Smaller optional label */
        margin-top: 1px; /* Reduce top margin */
        letter-spacing: 0; /* Remove letter spacing */
    }
}

/* Tabs button styles */
.tab-btn {
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-gray-400);
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 8px;
    font-size: 1.05rem;
    position: relative;
}

/* Basic tab styles more prominent */
.tab-btn[data-tab="basic"] {
    padding: 14px 24px;
    font-weight: 700;
    color: var(--color-gray-700);
    font-size: 1.15rem;
    /* Add background color highlight */
    background-color: rgba(46, 204, 113, 0.05);
    border-radius: 6px 6px 0 0;
}

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

.tab-btn.active {
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-primary);
    font-weight: 600;
}

/* Basic tab activated styles more prominent */
.tab-btn[data-tab="basic"].active {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-primary);
}

/* Optional tab styles optimization */
.tab-btn[data-tab="advanced"]::after,
.tab-btn[data-tab="custom"]::after {
    content: "optional";
    display: block;
    font-size: 0.7rem;
    color: var(--color-gray-400);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.tab-content {
    display: none;
}

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

/* Show on calculation completion - not needed anymore */
.calculator-results.visible {
    display: block;
}

/* Basic info note styling */
.basic-info-note {
    margin-top: var(--spacing-md);
    padding: 12px 15px;
    background-color: rgba(46, 204, 113, 0.08);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--color-gray-700);
}

.note-icon {
    margin-right: 10px;
    font-style: normal;
}

/* Modify hover effect */
.primary-result:hover .result-icon img {
    transform: translate(-50%, -50%) scale(1.12);
}

/* Ensure hover icon moves, not affecting internal icon position */
.primary-result:hover {
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.1);
    transform: translateY(-3px);
}

/* Enhance background image text effect - New design */
#means {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 25%; /* Desktop aspect ratio 4:1 */
    overflow: hidden;
    background-color: #000;
    margin-top: 40px;
    margin-bottom: 60px;
    transform-style: preserve-3d;
    will-change: transform;
}

#means::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        /* Top navigation bar gradient effect */
        linear-gradient(to bottom, 
            rgba(25, 55, 109, 0.5) 0%, 
            rgba(25, 55, 109, 0.35) 10%, 
            rgba(25, 55, 109, 0.2) 20%,
            rgba(25, 55, 109, 0.1) 30%,
            rgba(25, 55, 109, 0) 40%),
        /* Overall mask effect */
        linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.4) 0%,
            rgba(21, 101, 60, 0.5) 100%
        );
    backdrop-filter: brightness(0.95) contrast(1.05);
    z-index: 2;
    pointer-events: none;
}

#means::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center,
        rgba(46, 204, 113, 0.08) 0%,
        transparent 70%
    );
    mix-blend-mode: overlay;
    z-index: 3;
    pointer-events: none;
}

#means .hardware-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center; /* Ensure image is centered */
    opacity: 0.9;
    z-index: 1;
    filter: brightness(0.95) contrast(1.05);
    transform: scale(1.01); /* Slight zoom to avoid edge blank */
}

#means .hardware-hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    padding: 0 20px;
    z-index: 3;
    max-height: 100%; /* Increase maximum height to ensure all content is displayed */
    overflow-y: visible; /* Ensure content is not truncated */
}

#means .hardware-hero-content h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.2rem;
    line-height: 1.2;
    color: #ffffff;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
}

#means .hardware-hero-content .divider {
    width: 100px;
    height: 4px;
    background-color: var(--color-primary);
    margin: 20px auto 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#means .hardware-hero-content p {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    line-height: 1.5; /* Reduce line height for tighter text */
    color: #ffffff;
    margin: 0 auto;
    max-width: 800px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.3);
    font-weight: 400;
    opacity: 0.95;
}

/* Responsive adjustment - Increase height for tablets and mobile devices */
@media (max-width: 992px) {
    #means {
        padding-bottom: 50%; /* Increase height for tablet devices */
    }
    
    #means .hardware-hero-content p {
        font-size: 0.95rem;
        line-height: 1.4; /* Reduce line height */
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    #means {
        padding-bottom: 65%; /* Increase height for mobile devices */
    }
    
    #means .hardware-hero-content h2 {
        font-size: clamp(1.8rem, 2.5vw, 2rem);
        margin-bottom: 0.5rem;
    }
    
    #means .hardware-hero-content p {
        font-size: 0.9rem;
        line-height: 1.3; /* Further reduce line height */
        padding: 0 15px;
    }
    
    #means .divider {
        margin: 10px auto 15px;
    }
}

@media (max-width: 576px) {
    #means {
        padding-bottom: 85%; /* Increase height for small screen phones */
    }
    
    #means .hardware-hero-content p {
        font-size: 0.85rem;
    }
}

@media (max-width: 375px) {
    #means {
        padding-bottom: 100%; /* Use 1:1 ratio for very small screens */
    }
    
    #means .hardware-hero-content h2 {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }
    
    #means .hardware-hero-content p {
        font-size: 0.8rem;
        line-height: 1.25;
        max-width: 95%; /* Ensure text doesn't overflow */
        margin: 0 auto; /* Center horizontally */
    }
    
    #means .divider {
        margin: 8px auto 10px;
        width: 40px;
        height: 2px;
    }
}

/* Extra optimization for ultra-small screens */
@media (max-width: 320px) {
    #means {
        padding-bottom: 120%; /* Provide more space */
    }
    
    #means .hardware-hero-content h2 {
        font-size: 1.2rem;
    }
    
    #means .hardware-hero-content p {
        font-size: 0.75rem;
        line-height: 1.2;
    }
}

/* Mobile fixes - prevent horizontal scrolling and adjust tab display */
@media (max-width: 576px) {
    /* Prevent horizontal scrolling */
    html, body {
        overflow-x: hidden;
    }
    
    /* Ensure form elements display correctly on small screens */
    .form-group select,
    .form-group input[type="number"],
    .form-group input[type="range"] {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 375px) {
    /* Adjust tabs to display in one line - now allowing wrapping */
    /*
    .tabs-header {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
        scrollbar-width: none;
        justify-content: flex-start; 
    }
    */
    
    /* No longer need to hide scrollbar */
    /* .tabs-header::-webkit-scrollbar {
        display: none;
    } */
    
    /* Original tab button styles have been overridden by media queries above */
    /* .tab-btn {
        padding: 8px 10px;
        font-size: 0.9rem;
        margin-bottom: 0;
        white-space: nowrap;
        flex-shrink: 0;
    } */
    
    /* Keep other styles unchanged */
    .calculator-form {
        padding: 15px 10px;
    }
    
    .basic-info-note {
        font-size: 0.85rem;
        padding: 10px;
    }
    
    .refurbishment-description {
        flex-wrap: wrap;
    }
    
    .refurbishment-text {
        width: 100%;
        margin-top: 5px;
    }
}

/* Reduce tab button size */
.tab-btn {
    padding: 8px 10px;
    font-size: 0.9rem;
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Adjust basic tab button style */
.tab-btn[data-tab="basic"] {
    padding: 8px 14px;
    font-size: 0.95rem;
    background-color: rgba(46, 204, 113, 0.05);
}

/* Reduce optional label text size */
.tab-btn[data-tab="advanced"]::after,
.tab-btn[data-tab="custom"]::after {
    font-size: 0.65rem;
    margin-top: 2px;
} 