/* =========================================
   BEREGNER WIDGET STYLES
   ========================================= */
#el-beregner {
    max-width: 600px;
    background: #f8fafc;
    border: 1px solid #e1e5ee;
    border-radius: 20px;
    padding: 32px;
    box-sizing: border-box;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    margin: 0 auto;
    color: #3b3a3a;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, min-height 0.3s ease; 
}

.el-beregner-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-top: 0;
    margin-bottom: 8px;
    text-align: left;
    line-height: 1.3;
}

.el-beregner-subtitle {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 24px;
    font-weight: 500;
}

#el-input-container label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #3b3a3a;
    margin-bottom: 6px;
}

#el-input-container input,
#el-input-container select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 16px;
    background-color: #fff;
    box-sizing: border-box;
    transition: all 0.2s ease;
    margin-bottom: 16px;
    color: #3b3a3a;
    font-family: 'Montserrat', sans-serif; 
}

#el-input-container input:focus,
#el-input-container select:focus {
    border-color: #2bb144;
    outline: none;
    box-shadow: 0 0 0 3px rgba(43, 177, 68, 0.15);
}

/* Custom Search Dropdown */
.el-custom-select-wrapper {
    position: relative;
    margin-bottom: 16px;
}

#el-input-container #el-supplier-search {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%239ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>');
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 20px;
    margin-bottom: 0 !important;
    padding-right: 48px;
}

.el-supplier-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e1e5ee;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 50;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 4px;
}

.el-supplier-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.el-supplier-option:last-child { border-bottom: none; }
.el-supplier-option:hover { background-color: #f9fafb; }

.el-option-logo {
    width: 60px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.el-option-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.el-option-name {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
}

/* Beregn knap */
#el-beregn-btn {
    width: 100%;
    padding: 14px;
    background-color: #FF8930;
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.15s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 10px 20px rgba(255, 137, 48, 0.30);
}

#el-beregn-btn:hover {
    background-color: #e67a2b;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(255, 137, 48, 0.38);
}

#el-beregn-btn:disabled {
    background-color: #ffdcb5;
    box-shadow: none;
    cursor: not-allowed;
}

.el-btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: el-spin 0.8s linear infinite;
    margin-left: 10px;
}
.loading .el-btn-loader { display: inline-block; }
@keyframes el-spin { to { transform: rotate(360deg); } }

/* Forbrugs-hjælper */
#el-input-container .el-consumption-group input { margin-bottom: 8px; }
.el-consumption-group { margin-bottom: 26px; }
.el-consumption-help-row { margin-top: 0; margin-bottom: 0; }

#el-input-container button.el-help-link {
    background: none;
    border: none;
    padding: 0;
    color: #6b7280 !important;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px; 
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s;
    line-height: 1.2;
}

#el-input-container button.el-help-link:hover {
    color: #111 !important;
    text-decoration: underline;
    text-decoration-color: #FF8930; 
    text-underline-offset: 3px;
}

#el-input-container button.el-help-link::before {
    content: "?";
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF8930;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

#el-consumption-estimate-wrapper {
    display: none;
    margin-top: 12px;
    margin-bottom: 12px;
}

#el-consumption-estimate-wrapper label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

#el-consumption-estimate {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    background-color: #fff;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

.el-input-disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* =========================================
   2. BEREGNER RESULTAT STYLES (Cards)
   ========================================= */

/* Container til de to kort */
.el-result-cards {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    margin-top: 20px;
    align-items: center;
}

.el-result-card {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Gør det klikbare kort ikke blå/lilla som link */
a.el-result-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Venstre kort (billigste) */
.el-result-card--cheapest {
    border: 2px solid #ededed;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(0,0,0,0.12) !important;
    z-index: 2;
    padding: 24px;
    transform: scale(1.03);
}

.el-result-card--cheapest:hover {
    transform: scale(1.03) translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

/* Højre kort (nuværende) */
.el-result-card--current {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    color: #666;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 16px;
    transform: scale(0.90);
}

/* Badges */
.el-badge-cheapest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 999px;
    background-color: #2bb144;
    border: none;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(43, 177, 68, 0.25);
    width: auto;
}

.el-label-current {
    font-size: 10px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* Logo + titel styling (Flexbox fixed) */
.el-result-card-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    width: 100%;
    text-align: center;
}

/* Højder/placering pr. korttype */
.el-result-card--cheapest .el-result-card-logo {
    min-height: 60px;
    height: auto;
}
.el-result-card--current .el-result-card-logo {
    min-height: 45px;
    height: auto;
    opacity: 0.8;
}

/* Logo-billede */
.el-result-card-logo img {
    max-width: 150px;
    max-height: 50px;
    object-fit: contain;
}
.el-result-card--current .el-result-card-logo img {
    max-width: 100px;
}

/* Tekstcontainer til højre for logoet */
.el-logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-width: 0; /* VIGTIGT: Tillader tekst-wrap */
}

/* Titler i kort */
.el-result-card-title {
    font-weight: 700;
    color: #3b3a3a;
    margin-bottom: 2px;
    line-height: 1.2;
}

.el-result-card--cheapest .el-result-card-title {
    font-size: 16px;
    font-weight: 700;
}

.el-result-card--current .el-result-card-title {
    font-size: 14px;
    color: #555;
}

/* Subtekst i kort */
.el-result-sub {
    font-size: 13px;
    opacity: 0.85;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    max-width: 100%;
}
.el-result-card--current .el-result-sub {
    font-size: 13px;
    margin-top: 0px;
    color: #888;
}

/* Pris styling i kort */
.el-result-price-label {
    font-size: 13px;
    color: #9ca3af;
    margin-top: -12px;
    margin-bottom: 0;
    text-align: center;
    font-weight: 500;
}

.el-result-price {
    text-align: center;
    margin-top: -10px;
    margin-bottom: 0;
}

.el-result-card--cheapest .el-result-price {
    font-size: 32px;
    font-weight: 600;
    color: black;
}

.el-result-card--current .el-result-price {
    font-size: 22px;
    font-weight: 600;
    color: #999;
    margin-top: -5px;
}

/* Knap i kort (Skift nu) - Med Pil */
.el-beregner-btn-skift {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px; 
    background-color: #FF8930;
    color: white;
    font-weight: 500;
    font-size: 14px; 
    border-radius: 999px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    margin-top: 15px;
    margin-left: auto;
    margin-right: auto;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 4px 10px rgba(255, 137, 48, 0.28);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    
    position: relative;
    padding-right: 36px; /* Plads til pilen */

    /* Sikrer at teksten altid bliver på én linje, uanset skærmzoom */
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

.el-beregner-btn-skift::after {
    content: "➜";
    position: absolute;
    right: 14px; 
    font-size: 16px;
    top: 52%;
    transform: translateY(-50%);
    line-height: 1;
}

.el-beregner-btn-skift:hover {
    background-color: #e67a2b;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(255, 137, 48, 0.34);
}

/* Start forfra knap */
#el-reset-btn {
    display: block;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #d1d5db;
    color: #3b3a3a;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Montserrat', sans-serif;
}
#el-reset-btn:hover {
    border-color: #3b3a3a;
    color: #000;
    background-color: #fafafa;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

/* Resultat besparelse (Kupon-stil) */
.el-result-savings {
    background-color: #fafffc;
    border: 2px dashed #c6f6d5;
    color: #1f2937;
    padding: 12px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 24px;
    display: block;
    position: relative;
}

.el-savings-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.el-savings-amount {
    display: block;
    font-size: 42px;
    font-weight: 800;
    color: #2bb144;
    line-height: 1;
    margin-bottom: 4px;
}

.el-savings-sub {
    font-size: 15px;
    color: #4b5563;
    font-weight: 500;
}

/* Detalje-link */
#el-toggle-details {
    display: block;
    text-align: center;
    color: #1e7b59;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    margin-bottom: 24px;
}

/* Detalje-boks */
#el-details {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #3b3a3a;
}

/* =========================================
   RESPONSIVITET - BEREGNER
   ========================================= */

/* Tablet Fix (Op til 960px) */
@media (max-width: 960px) {
    .el-result-cards {
        flex-direction: column; /* Læg kort under hinanden */
        align-items: stretch;
        gap: 24px;
        margin-top: 24px;
    }
    .el-result-card {
        width: 100%;
        max-width: 100%; 
        margin: 0 auto 16px auto;
    }
    .el-result-card--cheapest,
    .el-result-card--current {
        transform: none !important;
        width: 100%;
        max-width: 100%;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    }
    .el-result-card-logo img {
        max-width: 140px;
        max-height: 45px;
    }
}

/* Mobil Toggle Knap */
#el-mobile-start-btn { display: none; }

@media (max-width: 600px) {
    /* Mobil Toggle */
    #el-mobile-start-btn {
        display: block;
        width: 100%;
        padding: 14px;
        background-color: #FF8930;
        color: white;
        border: none;
        border-radius: 999px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 0;
        font-family: 'Montserrat', sans-serif;
        box-shadow: 0 10px 20px rgba(255, 137, 48, 0.30);
        transition: transform 0.15s, background-color 0.2s;
    }
    #el-mobile-start-btn:hover { background-color: #e67a2b; }
    #el-mobile-start-btn:active { transform: scale(0.98); }
    #el-form-collapsible { display: none; }

    /* Beregner Mobil */
    #el-beregner {
        max-width: 100%;
        padding: 18px;
        border-radius: 16px;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    }
    #el-input-container #el-supplier-search {
        font-size: 16px; 
        padding-left: 10px;
        padding-right: 32px;
        background-position: right 8px center;
        letter-spacing: -0.4px;
    }
    .el-beregner-title {
        font-size: 20px;
        margin-bottom: 8px;
        text-align: center;
    }
    .el-beregner-subtitle {
        text-align: center;
        margin-bottom: 20px;
    }
    
    /* Resultat Cards Mobil */
    .el-result-cards {
        flex-direction: column;
        gap: 14px;
        margin-top: 16px;
        margin-bottom: 18px;
    }
    .el-result-card {
        width: 100%;
        max-width: 100%;
        padding: 18px;
        border-radius: 18px;
        margin: 0 auto;
    }
    .el-result-card--cheapest,
    .el-result-card--current {
        width: 100%;
        max-width: 100%;
        transform: none !important;
        margin-bottom: 10px;
    }
    .el-result-card--cheapest {
        box-shadow: 0 10px 22px rgba(0,0,0,0.10) !important;
    }
    .el-result-card--current {
        box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    }
    .el-result-card-logo img {
        max-width: 120px;
        max-height: 42px;
    }
    .el-result-card--cheapest .el-result-price {
        font-size: 28px;
    }
    .el-result-card--current .el-result-price {
        font-size: 20px;
    }
    
    /* Knapper & Labels mobil */
    .el-beregner-btn-skift {
        margin-top: 12px;
        padding: 10px 40px 10px 16px; 
        font-size: 13px; 
        max-width: 100%;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .el-beregner-btn-skift::after {
        right: 14px;
    }

    .el-badge-cheapest {
        display: inline-block;
        padding: 4px 14px;
        margin-left: auto;
        margin-right: auto;
        width: auto;
        text-align: center;
    }
    .el-label-current {
        text-align: center;
        width: 100%;
        display: block;
    }
    
    /* Besparelsesboks */
    .el-result-savings {
        font-size: 17px;
        padding: 12px 14px;
        border-radius: 14px;
        margin-bottom: 16px;
    }
    .el-savings-amount { font-size: 36px; }
    .el-savings-sub { font-size: 15px; }
    
    /* Diverse */
    #el-toggle-details { margin-bottom: 18px; font-size: 13px; }
    #el-reset-btn { padding: 8px 20px; font-size: 13px; }
    
    /* Justering af logo i mobile card specifikt for calculator */
    .el-result-card--cheapest .el-result-card-logo img { max-width: 170px; max-height: 70px; }
    .el-result-card--current .el-result-card-logo img { max-width: 130px; max-height: 50px; }
}