/* Import Poppins font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

.materialpriser-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.materialpriser-container h2 {
    margin-top: 0;
    color: #333;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.price-table {
    margin-bottom: 30px;
}

.price-table table {
    width: 100%;
    border-collapse: collapse;
}

.price-table th,
.price-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.price-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.price-table tr:hover {
    background-color: #f8f9fa;
}

.price-info {
    margin-top: 30px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.price-info p {
    margin: 5px 0;
    color: #666;
}

.last-updated {
    margin-top: 20px;
    font-size: 0.9em;
    color: #666;
    text-align: right;
}

.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    padding: 15px;
    border-radius: 4px;
}

/* Kalkulator styling */
.gold-calculator {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.gold-calculator h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.sliders-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.calculator-inputs {
    display: flex;
    gap: 50px;
    margin-bottom: 30px;
    position: relative;
    padding: 15px 0;
    align-items: flex-start;
    min-height: 100px;
}

.calculator-input {
    flex: 1;
    position: relative;
    padding: 35px 0;
    display: flex;
    flex-direction: column;
    height: 100px;
}

.calculator-input label {
    display: block;
    margin-bottom: 0;
    font-weight: 600;
    color: #333;
    font-size: 1.6rem;
    height: 40px;
}

.calculator-input input[type="range"] {
    width: 100%;
    height: 0px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 4px;
    outline: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    position: absolute;
    bottom: 0;
}

.calculator-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #685434;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.calculator-input input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #685434;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* For Firefox */
.calculator-input input[type="range"]::-moz-range-track {
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    border: none;
}

/* For Webkit */
.calculator-input input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    border: none;
}

.value-display {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: #685434;
    color: white;
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 1.7rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calculator-result {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-top: 15px;
}

.calculator-result h4 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: #333;
    font-weight: 600;
}

.calculator-result .total {
    font-size: 1.8rem !important;
    font-weight: 600;
    color: #685434;
    margin-top: 20px;
}

#calculation-summary p {
    margin: 0.8rem 0;
    color: #4a5568;
    font-size: 1.6rem;
    line-height: 1.5;
    font-family: 'Poppins', sans-serif;
}

/* Responsive styling */
@media screen and (max-width: 1024px) {
    .materialpriser-container {
        padding: 15px;
    }

    .gold-calculator {
        padding: 1.5rem;
    }

    .gold-calculator h3 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .calculator-input label {
        font-size: 1.2rem;
    }

    .value-display {
        font-size: 1.2rem;
        padding: 5px 14px;
    }

    #calculation-summary p {
        font-size: 1.1rem;
    }

    .total {
        font-size: 1.6rem;
    }
}

@media screen and (max-width: 768px) {
    .materialpriser-container {
        padding: 12px;
        margin: 15px 0;
    }

    .price-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .price-table table {
        min-width: 100%;
    }

    .gold-calculator {
        padding: 1.25rem;
    }

    .gold-calculator h3 {
        font-size: 1.8rem;
        margin-bottom: 1.2rem;
    }

    .sliders-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .calculator-inputs {
        flex-direction: column;
        gap: 35px;
        margin-bottom: 25px;
        padding: 10px 0;
        width: 100%;
    }
    
    .calculator-input {
        padding: 30px 0;
        width: 100%;
        max-width: 100%;
    }

    .calculator-input input[type="range"] {
        width: 100%;
        max-width: 100%;
    }
    
    .calculator-input label {
        font-size: 1.5rem;
        margin-bottom: 25px;
        width: 100%;
    }
    
    .value-display {
        font-size: 1.5rem;
        padding: 8px 20px;
        white-space: nowrap;
    }

    .calculator-result {
        margin-top: 10px;
        width: 100%;
    }

    .calculator-result h4 {
        font-size: 1.6rem;
    }

    #calculation-summary p {
        font-size: 1.4rem;
    }

    .total {
        font-size: 1.6rem !important;
    }

    .last-updated {
        font-size: 0.9rem;
        text-align: center;
    }

    .slider-wrapper {
        padding: 2rem 0 1rem;
    }
}

@media screen and (max-width: 480px) {
    .materialpriser-container {
        padding: 10px;
        margin: 10px 0;
    }

    .gold-calculator {
        padding: 1rem;
    }

    .gold-calculator h3 {
        font-size: 1.4rem;
    }

    .calculator-inputs {
        padding: 5px 0;
        gap: 30px;
    }

    .calculator-input {
        padding: 25px 0;
    }

    .calculator-input label {
        font-size: 1.4rem;
    }

    .value-display {
        font-size: 1.4rem;
        padding: 6px 16px;
    }

    .calculator-result h4 {
        font-size: 1.2rem;
    }

    #calculation-summary p {
        font-size: 0.95rem;
    }

    .total {
        font-size: 1.3rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }

    /* Improve touch targets for mobile */
    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    input[type="range"]::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    .slider-wrapper {
        padding: 2rem 0 0.75rem;
    }
}

/* Prevent text selection on labels and values */
.calculator-input label,
.value-display {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Improve touch area for sliders */
.slider-wrapper {
    touch-action: none;
}

input[type="range"] {
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

/* Fane styling */
.material-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background-color: #f0f0f0;
    cursor: pointer;
    border-radius: 5px;
}

.tab-button.active {
    background-color: #685434;
    color: white;
}

.material-content {
    display: none;
}

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

/* Her kan vi legge til mer styling etter behov */ 