/**
 * ISAB Röråldersverktyg - Stilar
 */

/* Variabler - ISAB färger + statusfärger */
:root {
    --isab-blue: #005BAA;
    --isab-blue-dark: #004a8a;
    --isab-blue-light: #e8f1f8;
    --isab-red: #FF0000;
    --isab-red-dark: #cc0000;
    --isab-dark-gray: #2e3335;
    --isab-light-gray: #dadada;
    --isab-bg-gray: #f7f8fa;
    --isab-white: #ffffff;
    /* Tydliga statusfärger */
    --status-green: #22c55e;
    --status-green-light: #dcfce7;
    --status-yellow: #eab308;
    --status-yellow-light: #fef9c3;
    --status-orange: #f97316;
    --status-orange-light: #ffedd5;
    --status-red: #ef4444;
    --status-red-light: #fee2e2;
}

/* Container */
.isab-pipe-tool {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.isab-pipe-tool__header {
    text-align: center;
    margin-bottom: 40px;
}

.isab-pipe-tool__label {
    display: inline-block;
    background: var(--isab-blue-light);
    color: var(--isab-blue);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.isab-pipe-tool__title {
    font-size: 32px;
    font-weight: 700;
    color: var(--isab-dark-gray);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.isab-pipe-tool__subtitle {
    font-size: 16px;
    font-weight: 400;
    color: #666;
    margin: 0;
}

/* Widget Container */
.isab-pipe-tool__widget {
    background: var(--isab-bg-gray);
    border-radius: 16px;
    padding: 40px;
}

/* Age Buttons Grid */
.isab-pipe-tool__ages {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .isab-pipe-tool__ages {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .isab-pipe-tool__ages {
        grid-template-columns: 1fr;
    }
}

/* Age Button */
.isab-pipe-tool__age-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--isab-white);
    border: 2px solid #e0e0e0;
    padding: 24px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.isab-pipe-tool__age-btn:hover {
    background: #f7f8fa;
    border-color: #e0e0e0;
}

.isab-pipe-tool__age-btn.active {
    border-color: var(--isab-blue);
    background: var(--isab-blue);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 91, 170, 0.3);
}

/* Age Button Icon */
.isab-pipe-tool__age-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.isab-pipe-tool__age-icon svg {
    width: 28px;
    height: 28px;
}

.isab-pipe-tool__age-btn[data-age="0-20"] .isab-pipe-tool__age-icon {
    color: var(--status-green);
}

.isab-pipe-tool__age-btn[data-age="20-35"] .isab-pipe-tool__age-icon {
    color: var(--status-yellow);
}

.isab-pipe-tool__age-btn[data-age="35-50"] .isab-pipe-tool__age-icon {
    color: var(--status-orange);
}

.isab-pipe-tool__age-btn[data-age="50+"] .isab-pipe-tool__age-icon {
    color: var(--status-red);
}

.isab-pipe-tool__age-btn.active .isab-pipe-tool__age-icon {
    color: white;
}

/* Age Button Text */
.isab-pipe-tool__age-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--isab-dark-gray);
}

.isab-pipe-tool__age-btn.active .isab-pipe-tool__age-text {
    color: white;
}

/* Age Button Status */
.isab-pipe-tool__age-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #666;
}

.isab-pipe-tool__age-btn[data-age="0-20"] .isab-pipe-tool__age-status {
    background: var(--status-green-light);
    color: var(--status-green);
}

.isab-pipe-tool__age-btn[data-age="20-35"] .isab-pipe-tool__age-status {
    background: var(--status-yellow-light);
    color: #a16207;
}

.isab-pipe-tool__age-btn[data-age="35-50"] .isab-pipe-tool__age-status {
    background: var(--status-orange-light);
    color: var(--status-orange);
}

.isab-pipe-tool__age-btn[data-age="50+"] .isab-pipe-tool__age-status {
    background: var(--status-red-light);
    color: var(--status-red);
}

.isab-pipe-tool__age-btn.active .isab-pipe-tool__age-status {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Submit Button */
.isab-pipe-tool__submit-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 16px 32px;
    background: var(--isab-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.isab-pipe-tool__submit-btn:hover:not(:disabled) {
    background: var(--isab-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 91, 170, 0.3);
    color: white;
}

.isab-pipe-tool__submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Focus states för tangentbordsnavigering (WCAG) */
.isab-pipe-tool__age-btn:focus {
    outline: 3px solid var(--isab-blue);
    outline-offset: 2px;
}

.isab-pipe-tool__age-btn:focus:not(:focus-visible) {
    outline: none;
}

.isab-pipe-tool__age-btn:focus-visible {
    outline: 3px solid var(--isab-blue);
    outline-offset: 2px;
}

.isab-pipe-tool__submit-btn:focus {
    outline: 3px solid var(--isab-dark-gray);
    outline-offset: 2px;
}

.isab-pipe-tool__submit-btn:focus:not(:focus-visible) {
    outline: none;
}

.isab-pipe-tool__submit-btn:focus-visible {
    outline: 3px solid var(--isab-dark-gray);
    outline-offset: 2px;
}

.isab-result__cta-btn:focus,
.isab-result__recommendation-link:focus {
    outline: 3px solid white;
    outline-offset: 2px;
}

.isab-result__cta-btn:focus:not(:focus-visible),
.isab-result__recommendation-link:focus:not(:focus-visible) {
    outline: none;
}

.isab-result__cta-btn:focus-visible,
.isab-result__recommendation-link:focus-visible {
    outline: 3px solid white;
    outline-offset: 2px;
}

/* Result Section */
.isab-pipe-tool__result {
    margin-bottom: 30px;
    animation: slideDown 0.4s ease;
}

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

.isab-pipe-tool__result-content {
    background: var(--isab-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Result Header */
.isab-result__header {
    padding: 30px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.isab-result__header--good {
    background: linear-gradient(135deg, var(--status-green) 0%, #16a34a 100%);
    color: white;
}

.isab-result__header--warning {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
    color: white;
}

.isab-result__header--alert {
    background: linear-gradient(135deg, var(--status-orange) 0%, #ea580c 100%);
    color: white;
}

.isab-result__header--critical {
    background: linear-gradient(135deg, var(--status-red) 0%, #dc2626 100%);
    color: white;
}

.isab-result__icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.isab-result__icon svg {
    width: 26px;
    height: 26px;
}

.isab-result__header-text {
    flex: 1;
}

.isab-result__status-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.isab-result__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
    color: white;
}

.isab-result__description {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    opacity: 0.9;
}

/* Recommendations */
.isab-result__recommendations {
    padding: 30px;
}

.isab-result__recommendations-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin: 0 0 20px 0;
}

.isab-result__recommendation {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--isab-bg-gray);
    border-radius: 10px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.isab-result__recommendation:last-child {
    margin-bottom: 0;
}

.isab-result__recommendation:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.isab-result__recommendation-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.isab-result__recommendation-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.isab-result__recommendation--low .isab-result__recommendation-icon {
    background: var(--status-green);
}

.isab-result__recommendation--medium .isab-result__recommendation-icon {
    background: var(--status-yellow);
}

.isab-result__recommendation--high .isab-result__recommendation-icon {
    background: var(--status-orange);
}

.isab-result__recommendation--critical .isab-result__recommendation-icon {
    background: var(--status-red);
}

.isab-result__recommendation-content {
    flex: 1;
}

.isab-result__recommendation-service {
    font-size: 16px;
    font-weight: 700;
    color: var(--isab-dark-gray);
    margin: 0 0 6px 0;
}

.isab-result__recommendation-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.isab-result__recommendation-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--isab-blue);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
    align-self: center;
}

.isab-result__recommendation-link:hover {
    background: var(--isab-blue-dark);
    transform: scale(1.1);
    text-decoration: none;
    color: white;
}

.isab-result__recommendation-link svg {
    width: 18px;
    height: 18px;
}

/* Tip Section */
.isab-result__tip {
    padding: 20px 30px;
    background: var(--isab-blue-light);
    border-left: 4px solid var(--isab-blue);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.isab-result__tip-icon {
    flex-shrink: 0;
    color: var(--isab-blue);
}

.isab-result__tip-icon svg {
    width: 20px;
    height: 20px;
}

.isab-result__tip-text {
    font-size: 14px;
    color: var(--isab-dark-gray);
    line-height: 1.5;
    margin: 0;
}

/* CTA Section */
.isab-result__cta {
    padding: 25px 30px;
    background: var(--isab-dark-gray);
    text-align: center;
}

.isab-result__cta-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 15px 0;
}

.isab-result__cta-btn,
.isab-result__cta-btn:visited,
.isab-result__cta-btn:link {
    display: inline-block;
    padding: 14px 32px;
    background: var(--isab-red);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
}

.isab-result__cta-btn:hover {
    background: var(--isab-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.3);
    text-decoration: none;
    color: white;
}

/* Loading State */
.isab-pipe-tool__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.isab-pipe-tool__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--isab-blue-light);
    border-top-color: var(--isab-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ================================
   RESPONSIV DESIGN - MOBIL
================================ */

@media (max-width: 768px) {
    .isab-pipe-tool {
        padding: 40px 15px;
    }

    .isab-pipe-tool__title {
        font-size: 24px;
    }

    .isab-pipe-tool__subtitle {
        font-size: 14px;
    }

    .isab-pipe-tool__widget {
        padding: 25px 20px;
    }

    .isab-result__header {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }

    .isab-result__icon {
        margin: 0 auto 10px;
    }

    .isab-result__title {
        font-size: 18px;
    }

    .isab-result__recommendations {
        padding: 20px;
    }

    .isab-result__recommendation {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .isab-result__recommendation-link {
        align-self: center;
    }

    .isab-result__tip {
        padding: 15px 20px;
        flex-direction: column;
        text-align: center;
    }

    .isab-result__tip-icon {
        margin: 0 auto;
    }

    .isab-result__cta {
        padding: 20px;
    }

    .isab-result__cta-btn {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .isab-pipe-tool__label {
        font-size: 10px;
        padding: 5px 12px;
    }

    .isab-pipe-tool__title {
        font-size: 20px;
    }

    .isab-pipe-tool__widget {
        padding: 20px 15px;
        border-radius: 12px;
    }

    .isab-pipe-tool__age-btn {
        padding: 18px 12px;
    }

    .isab-pipe-tool__age-text {
        font-size: 16px;
    }

    .isab-pipe-tool__age-status {
        font-size: 10px;
    }

    .isab-pipe-tool__submit-btn {
        padding: 14px 24px;
        font-size: 14px;
        max-width: 100%;
    }

    .isab-result__description {
        font-size: 13px;
    }

    .isab-result__recommendations-title {
        font-size: 12px;
    }

    .isab-result__recommendation-service {
        font-size: 15px;
    }

    .isab-result__recommendation-description {
        font-size: 13px;
    }
}
