/**
 * Energy Savings Calculator - Public Styles
 * 
 * Professional styling that matches the original client design
 * 
 * @package EnergyCalculator
 * @since 1.0.0
 */

/* Reset and Base Styles */
.energy-calculator-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.energy-calculator-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Header Section */
.energy-calc-header {
    background: linear-gradient(135deg, rgb(0, 39, 104) 0%, #8c0909 100%);
    color: white;
    padding: 40px;
    text-align: center;
    position: relative;
}

.energy-calc-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.energy-calc-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    font-weight: 700;
}

.energy-calc-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.energy-calc-icon {
    margin-right: 10px;
}

/* Main Content Grid */
.energy-calc-main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

/* Form Section */
.energy-calc-form-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.energy-calc-section-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #374151;
    font-weight: 600;
}

.energy-calc-section-icon {
    font-size: 1.5rem;
}

/* Input Groups */
.energy-calc-input-group {
    margin-bottom: 25px;
}

.energy-calc-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 1rem;
}

.energy-calc-input-group input,
.energy-calc-input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e8f4f8;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fbff;
    font-family: inherit;
}

.energy-calc-input-group input:focus,
.energy-calc-input-group select:focus {
    outline: none;
    border-color: rgb(0, 39, 104);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 39, 104, 0.2);
}

.energy-calc-input-group input:invalid {
    border-color: #ef4444;
}

.energy-calc-input-group input:valid {
    border-color: #10b981;
}

/* Calculate Button */
.energy-calc-calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #8c0909 0%, #7f1d1d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: inherit;
}

.energy-calc-calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(140, 9, 9, 0.3);
}

.energy-calc-calculate-btn:active {
    transform: translateY(-1px);
}

.energy-calc-calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.energy-calc-results-section {
    background: linear-gradient(135deg, rgb(0, 39, 104) 0%, rgb(0, 29, 78) 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.energy-calc-results-section .energy-calc-section-title {
    color: white;
}

/* Loading State */
.energy-calc-loading {
    text-align: center;
    padding: 20px;
}

.energy-calc-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* Results Display */
.energy-calc-results {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

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

.energy-calc-result-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.energy-calc-result-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.energy-calc-result-label {
    font-size: 1rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Savings Breakdown */
.energy-calc-savings-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.energy-calc-breakdown-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.energy-calc-breakdown-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.energy-calc-breakdown-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Additional Metrics */
.energy-calc-additional-metrics {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.energy-calc-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.energy-calc-metric:last-child {
    border-bottom: none;
}

.energy-calc-metric-label {
    font-weight: 500;
}

.energy-calc-metric-value {
    font-weight: 600;
    color: #fbbf24;
}

/* Action Buttons */
.energy-calc-action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.energy-calc-show-more,
.energy-calc-download-pdf {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9rem;
    flex: 1;
    min-width: 140px;
}

.energy-calc-show-more:hover,
.energy-calc-download-pdf:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.energy-calc-download-pdf {
    background: rgba(140, 9, 9, 0.8);
    border-color: rgba(140, 9, 9, 0.9);
}

.energy-calc-download-pdf:hover {
    background: rgba(140, 9, 9, 0.9);
}

/* Error Display */
.energy-calc-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: #fecaca;
}

.energy-calc-error-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.energy-calc-error-message {
    font-weight: 500;
}

/* Features Section */
.energy-calc-features-section {
    grid-column: 1 / -1;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.energy-calc-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.energy-calc-feature {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.energy-calc-feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.energy-calc-feature-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgb(0, 39, 104) 0%, rgb(0, 29, 78) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.energy-calc-feature-content {
    flex: 1;
}

.energy-calc-feature-content strong {
    color: #374151;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .energy-calc-main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .energy-calc-header {
        padding: 20px;
    }

    .energy-calc-title {
        font-size: 2rem;
    }

    .energy-calc-subtitle {
        font-size: 1rem;
    }

    .energy-calc-form-section,
    .energy-calc-results-section,
    .energy-calc-features-section {
        padding: 20px;
    }

    .energy-calc-savings-breakdown {
        grid-template-columns: 1fr;
    }

    .energy-calc-features-grid {
        grid-template-columns: 1fr;
    }

    .energy-calc-result-value {
        font-size: 2rem;
    }

    .energy-calc-breakdown-value {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .energy-calculator-container {
        margin: 10px;
        border-radius: 15px;
    }

    .energy-calc-main-content {
        padding: 15px;
    }

    .energy-calc-title {
        font-size: 1.5rem;
    }

    .energy-calc-section-title {
        font-size: 1.5rem;
    }

    .energy-calc-feature {
        flex-direction: column;
        text-align: center;
    }

    .energy-calc-feature-icon {
        margin-bottom: 10px;
    }
}

/* Accessibility Improvements */
.energy-calc-input-group input:focus-visible,
.energy-calc-input-group select:focus-visible,
.energy-calc-calculate-btn:focus-visible,
.energy-calc-show-more:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

/* Animation for results */
.energy-calc-result-card {
    animation: fadeInUp 0.5s ease-out;
}

.energy-calc-breakdown-item {
    animation: fadeInUp 0.5s ease-out;
}

.energy-calc-breakdown-item:nth-child(2) {
    animation-delay: 0.1s;
}

.energy-calc-breakdown-item:nth-child(3) {
    animation-delay: 0.2s;
}

.energy-calc-breakdown-item:nth-child(4) {
    animation-delay: 0.3s;
}

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

/* Form Validation Styles */
.energy-calc-input-group input.error,
.energy-calc-input-group select.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.energy-calc-field-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 5px;
    font-weight: 500;
}

/* Form Loading State */
.energy-calc-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success State */
.energy-calc-input-group input:valid:not(:focus) {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* Print Styles */
@media print {
    .energy-calc-calculate-btn,
    .energy-calc-show-more {
        display: none;
    }

    .energy-calculator-container {
        box-shadow: none;
        background: white;
    }

    .energy-calc-header {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}