/**
 * Electricity Cost Calculator Styles
 * Modern black/red theme with glassmorphism effects
 */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables - Light Theme with Black & Red */
:root {
    --ecc-primary: #ffffff;
    --ecc-primary-light: #f8f9fa;
    --ecc-primary-dark: #e9ecef;
    --ecc-accent: #ff0000;
    --ecc-accent-light: #ff3333;
    --ecc-accent-dark: #cc0000;
    --ecc-accent-glow: rgba(255, 0, 0, 0.25);
    --ecc-text: #1a1a1a;
    --ecc-text-muted: #6c757d;
    --ecc-text-dark: #343a40;
    --ecc-border: rgba(0, 0, 0, 0.12);
    --ecc-glass: rgba(0, 0, 0, 0.03);
    --ecc-glass-hover: rgba(0, 0, 0, 0.06);
    --ecc-success: #10b981;
    --ecc-warning: #f59e0b;
    --ecc-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    --ecc-shadow-accent: 0 4px 20px rgba(255, 0, 0, 0.2);
    --ecc-radius: 5px;
    --ecc-radius-sm: 5px;
    --ecc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Wrapper */
.ecc-calculator-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f8f9fa 100%);
    min-height: 100vh;
    padding: 40px 20px;
    box-sizing: border-box;
}

.ecc-calculator-wrapper *,
.ecc-calculator-wrapper *::before,
.ecc-calculator-wrapper *::after {
    box-sizing: border-box;
}

/* Container */
.ecc-calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: var(--ecc-radius);
    border: 1px solid var(--ecc-border);
    box-shadow: var(--ecc-shadow);
    overflow: hidden;
}

/* Header */
.ecc-header {
    background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ecc-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: ecc-pulse 4s ease-in-out infinite;
}

@keyframes ecc-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}

.ecc-title {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
    font-weight: 800;
    color: #ff0000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    text-shadow: none;
}

.ecc-icon {
    font-size: 2rem;
    animation: ecc-glow 2s ease-in-out infinite;
}

@keyframes ecc-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8));
    }
}

.ecc-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    position: relative;
}

/* Main Content */
.ecc-main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
    align-items: start;
}

/* Section Headers */
.ecc-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ecc-border);
}

.ecc-section-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ecc-text);
}

.ecc-section-icon {
    font-size: 1.2rem;
}

/* Section Divider */
.ecc-section-divider {
    height: 1px;
    background: var(--ecc-border);
    margin: 20px 0;
}

/* Form Groups */
.ecc-form-group {
    margin-bottom: 12px;
}

.ecc-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ecc-text);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ecc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Select Inputs */
.ecc-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--ecc-primary-light);
    border: 2px solid var(--ecc-border);
    border-radius: var(--ecc-radius-sm);
    color: var(--ecc-text);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--ecc-transition);
    appearance: none;
    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='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 40px;
}

.ecc-select:hover:not(:disabled) {
    border-color: var(--ecc-accent);
}

.ecc-select:focus {
    outline: none;
    border-color: var(--ecc-accent);
    box-shadow: 0 0 0 3px var(--ecc-accent-glow);
}

.ecc-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ecc-select option {
    background: var(--ecc-primary);
    color: var(--ecc-text);
    padding: 10px;
}

/* Text/Number Inputs */
.ecc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ecc-input {
    width: 100%;
    padding: 10px 50px 10px 14px;
    background: var(--ecc-primary-light);
    border: 2px solid var(--ecc-border) !important;
    border-radius: var(--ecc-radius-sm);
    color: var(--ecc-text);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    transition: var(--ecc-transition);
}

.ecc-input:hover {
    border-color: var(--ecc-accent) !important;
}

.ecc-input:focus {
    outline: none;
    border-color: var(--ecc-accent) !important;
    box-shadow: 0 0 0 3px var(--ecc-accent-glow);
}

.ecc-input-unit {
    position: absolute;
    right: 12px;
    color: var(--ecc-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.ecc-input-prefix {
    position: absolute;
    left: 12px;
    color: var(--ecc-text-muted);
    font-size: 1rem;
    font-weight: 500;
    z-index: 1;
}

.ecc-input-with-prefix {
    padding-left: 38px;
}

/* Input with inline select */
.ecc-input-with-select {
    display: flex;
    gap: 0;
    width: 100%;
}

.ecc-input-with-select .ecc-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1 1 auto;
    min-width: 80px !important;
    width: auto;
    padding-right: 14px;
}

.ecc-input-select {
    padding: 10px 12px;
    background: var(--ecc-primary-dark);
    border: 2px solid var(--ecc-border) !important;
    border-left: none !important;
    border-radius: 0 var(--ecc-radius-sm) var(--ecc-radius-sm) 0;
    color: var(--ecc-text);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ecc-transition);
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    flex: 0 0 100px;
}

.ecc-input-select:hover {
    border-color: var(--ecc-accent) !important;
}

.ecc-input-select:focus {
    outline: none;
    border-color: var(--ecc-accent) !important;
}

/* Dynamic Inputs */
.ecc-dynamic-inputs {
    margin-bottom: 12px;
}

.ecc-dynamic-inputs .ecc-form-group:last-child {
    margin-bottom: 0;
}

/* Calculate Button */
.ecc-calculate-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--ecc-accent), var(--ecc-accent-dark));
    border: none;
    border-radius: var(--ecc-radius-sm);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--ecc-transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--ecc-shadow-accent);
    margin-top: 15px;
}

.ecc-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(230, 57, 70, 0.5);
}

.ecc-calculate-btn:active {
    transform: translateY(0);
}

.ecc-btn-icon {
    font-size: 1.1rem;
    animation: ecc-glow 2s ease-in-out infinite;
}

/* Results Section */
.ecc-results-section {
    background: linear-gradient(145deg, rgba(230, 57, 70, 0.05), #fafafa);
    padding: 15px;
    border-radius: var(--ecc-radius);
    border: 1px solid var(--ecc-accent);
    box-shadow: inset 0 0 30px rgba(230, 57, 70, 0.03);
    height: auto;
    overflow: visible;
}

/* Power Display */
.ecc-power-display {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: var(--ecc-radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--ecc-border);
}

.ecc-power-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.ecc-power-value span:first-child {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ecc-accent);
    line-height: 1;
}

.ecc-power-unit {
    font-size: 1.2rem;
    color: var(--ecc-text-muted);
    font-weight: 500;
}

.ecc-power-label {
    margin: 5px 0 0 0;
    color: var(--ecc-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Cost Cards */
.ecc-cost-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.ecc-cost-card {
    background: var(--ecc-glass);
    padding: 12px 8px;
    border-radius: var(--ecc-radius-sm);
    border: 1px solid var(--ecc-border);
    text-align: center;
    transition: var(--ecc-transition);
}

.ecc-cost-card:hover {
    transform: translateY(-3px);
    background: var(--ecc-glass-hover);
}

.ecc-cost-card.ecc-featured {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.2), rgba(230, 57, 70, 0.1));
    border-color: var(--ecc-accent);
}

.ecc-cost-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.ecc-cost-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ecc-cost-label {
    font-size: 0.7rem;
    color: var(--ecc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ecc-cost-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ecc-text);
}

.ecc-featured .ecc-cost-value {
    color: var(--ecc-accent-dark);
}

/* Energy Stats */
.ecc-energy-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: var(--ecc-primary-light);
    padding: 12px;
    border-radius: var(--ecc-radius-sm);
    border: 1px solid var(--ecc-border);
}

.ecc-stat {
    text-align: center;
}

.ecc-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ecc-text);
    margin-bottom: 2px;
}

.ecc-stat-label {
    font-size: 0.75rem;
    color: var(--ecc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Reference Section */
.ecc-reference-section {
    padding: 15px;
    background: var(--ecc-glass);
    border-top: 1px solid var(--ecc-border);
}

.ecc-reference-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.ecc-tab-btn {
    padding: 8px 16px;
    background: var(--ecc-primary-light);
    border: 2px solid var(--ecc-border);
    border-radius: var(--ecc-radius-sm);
    color: var(--ecc-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--ecc-transition);
}

.ecc-tab-btn:hover {
    border-color: var(--ecc-accent);
    color: var(--ecc-text);
}

.ecc-tab-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #ffffff;
}

.ecc-tab-panel {
    display: none;
}

.ecc-tab-panel.active {
    display: block;
    animation: ecc-fadeIn 0.3s ease;
}

@keyframes ecc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reference Table */
.ecc-reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.ecc-reference-table th,
.ecc-reference-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--ecc-border);
}

.ecc-reference-table th {
    background: var(--ecc-primary-light);
    color: var(--ecc-accent-dark);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ecc-reference-table td {
    color: var(--ecc-text);
}

.ecc-reference-table tr:hover td {
    background: var(--ecc-glass-hover);
}

/* Reference Grid */
.ecc-reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
}

.ecc-ref-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--ecc-primary-light);
    border-radius: var(--ecc-radius-sm);
    border: 1px solid var(--ecc-border);
    font-size: 0.8rem;
    transition: var(--ecc-transition);
}

.ecc-ref-item:hover {
    border-color: var(--ecc-accent);
    transform: translateX(5px);
}

.ecc-ref-item span:first-child {
    color: var(--ecc-text);
}

.ecc-ref-item span:last-child {
    color: var(--ecc-accent);
    font-weight: 600;
}

/* Footer */
.ecc-footer {
    padding: 12px 15px;
    background: var(--ecc-primary-light);
    border-top: 1px solid var(--ecc-border);
    text-align: center;
}

.ecc-footer p {
    margin: 0;
    color: var(--ecc-text-muted);
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ecc-title {
        font-size: 2rem;
    }

    .ecc-reference-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ecc-calculator-wrapper {
        padding: 20px 10px;
    }

    .ecc-header {
        padding: 30px 20px;
    }

    .ecc-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
    }

    .ecc-icon {
        font-size: 2rem;
    }

    .ecc-subtitle {
        font-size: 0.95rem;
    }

    .ecc-main-content {
        padding: 20px;
    }

    .ecc-form-row {
        grid-template-columns: 1fr;
    }

    .ecc-cost-cards {
        grid-template-columns: 1fr;
    }

    .ecc-energy-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ecc-power-value span:first-child {
        font-size: 2.5rem;
    }

    .ecc-reference-tabs {
        flex-direction: column;
    }

    .ecc-reference-grid {
        grid-template-columns: 1fr;
    }

    .ecc-reference-table {
        font-size: 0.8rem;
    }

    .ecc-reference-table th,
    .ecc-reference-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .ecc-title {
        font-size: 1.25rem;
    }

    .ecc-input-section,
    .ecc-results-section {
        padding: 20px 15px;
    }

    .ecc-section-header h3 {
        font-size: 1.1rem;
    }

    .ecc-cost-value {
        font-size: 1.25rem;
    }

    .ecc-stat-value {
        font-size: 1.1rem;
    }
}

/* Hide number input spinners */
.ecc-input[type="number"]::-webkit-outer-spin-button,
.ecc-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ecc-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Custom scrollbar */
.ecc-calculator-wrapper ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ecc-calculator-wrapper ::-webkit-scrollbar-track {
    background: var(--ecc-primary-light);
}

.ecc-calculator-wrapper ::-webkit-scrollbar-thumb {
    background: var(--ecc-accent);
    border-radius: 4px;
}

.ecc-calculator-wrapper ::-webkit-scrollbar-thumb:hover {
    background: var(--ecc-accent-light);
}