// DfE Manual Components

// Hero Section
.dfe-manual-hero {
    background-color: #003a69; // DfE blue
    color: #ffffff;
    padding: 48px 0;
    position: relative;
    overflow: hidden;

    &__content {
        position: relative;
        z-index: 2;
    }

    &__cta {
        margin-top: 32px;
    }

    &__image {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 1;
    }

    &__img {
        max-width: 100%;
        height: auto;
    }

    .govuk-heading-xl {
        color: #ffffff;
    }

    .govuk-body-l {
        color: #ffffff;
        opacity: 0.9;
    }

    .govuk-button--start {
        background-color: #ffffff;
        color: #003a69;
        box-shadow: 0 2px 0 #002a4a;

        &:hover {
            background-color: #f8f8f8;
        }

        &:focus {
            outline: 3px solid #ffdd00;
            outline-offset: 0;
        }
    }
}

// Features Section
.dfe-manual-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 32px 0;

    @media (max-width: 48.0525em) {
        grid-template-columns: 1fr;
    }

    &__item {
        background: #ffffff;
        border-radius: 8px;
        padding: 24px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s ease, box-shadow 0.2s ease;

        &:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
    }

    &__icon {
        margin-bottom: 16px;
        height: 48px;
        display: flex;
        align-items: center;
    }

    &__img {
        height: 100%;
        width: auto;
    }

    &__content {
        h2 {
            margin-bottom: 12px;
        }

        p {
            margin-bottom: 16px;
        }
    }
}

// Content Cards
.dfe-manual-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;

    &--feature {
        padding: 24px;

        &:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
    }

    &--highlight {
        background: #f8f8f8;
        border: 2px solid #003a69;
    }

    &__content {
        padding: 24px;

        h3 {
            margin-bottom: 16px;
        }

        p {
            margin-bottom: 16px;
        }

        ul {
            margin-bottom: 0;
        }
    }

    &--calculator {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border: 2px solid #e2e8f0;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
        border-radius: 12px;
        overflow: hidden;

        &:hover {
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
        }

        .dfe-manual-card__content {
            padding: 32px;
        }
    }

    &--impact {
        border-left: 6px solid #003a69;
    }
}

// Topics Section
.dfe-manual-topics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 32px 0;

    @media (max-width: 48.0525em) {
        grid-template-columns: 1fr;
    }

    &__item {
        height: 100%;
    }

    &__icon {
        margin-bottom: 16px;
        height: 48px;
        display: flex;
        align-items: center;
    }

    &__img {
        height: 100%;
        width: auto;
    }
}

// Help Section
.dfe-manual-help {
    color: #ffffff;

    &__item {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 24px;
        margin-bottom: 24px;
        transition: background-color 0.2s ease;

        &:hover {
            background: rgba(255, 255, 255, 0.15);
        }

        h3 {
            color: #ffffff;
            margin-bottom: 12px;
        }

        p {
            margin-bottom: 16px;
            opacity: 0.9;
        }

        .govuk-link--white {
            color: #ffffff;
            text-decoration: underline;
            text-underline-offset: 0.2em;

            &:hover {
                color: #f8f8f8;
            }

            &:focus {
                color: #0b0c0c;
                background-color: #ffdd00;
                box-shadow: 0 -2px #ffdd00, 0 4px #0b0c0c;
                text-decoration: none;
            }
        }
    }

    &__contact {
        margin-top: 32px;
        padding-top: 24px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    &__image {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }

    &__img {
        max-width: 100%;
        height: auto;
    }
}

// Section Styles
.dfe-manual-section {
    padding: 48px 0;

    &--white {
        background-color: #ffffff;
    }

    &--light {
        background-color: #f8f8f8;
    }

    &--blue {
        background-color: #003a69;
    }
}

// Responsive Adjustments
@media (max-width: 48.0525em) {
    .dfe-manual-hero {
        padding: 32px 0;

        &__image {
            margin-top: 32px;
        }
    }

    .dfe-manual-help {
        &__image {
            margin-top: 32px;
        }
    }
}

// Print Styles
@media print {
    .dfe-manual-hero {
        background-color: #ffffff !important;
        color: #0b0c0c !important;
        padding: 0 !important;

        .govuk-heading-xl,
        .govuk-body-l {
            color: #0b0c0c !important;
        }

        &__image {
            display: none;
        }
    }

    .dfe-manual-features,
    .dfe-manual-topics {
        display: block;
    }

    .dfe-manual-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #b1b4b6;
    }

    .dfe-manual-help {
        color: #0b0c0c !important;
        background-color: #ffffff !important;

        &__item {
            background: #f8f8f8 !important;
            border: 1px solid #b1b4b6;
        }

        &__image {
            display: none;
        }

        .govuk-link--white {
            color: #0b0c0c !important;
        }
    }
}

// Calculator Section
.dfe-manual-calculator {
    &__header {
        margin-bottom: 32px;
        text-align: center;

        h3 {
            color: #003a69;
            margin-bottom: 12px;
        }

        p {
            color: #505a5f;
            font-size: 18px;
            line-height: 1.4;
        }
    }

    &__form {
        margin-bottom: 24px;
    }

    &__input-wrapper {
        display: flex;
        gap: 16px;
        align-items: flex-end;
        flex-wrap: wrap;

        @media (max-width: 48.0525em) {
            flex-direction: column;
            align-items: stretch;
        }
    }

    &__input {
        flex: 1;
        min-width: 200px;
        font-size: 18px;
        padding: 12px 16px;
        border: 2px solid #b1b4b6;
        border-radius: 6px;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;

        &:focus {
            border-color: #003a69;
            box-shadow: 0 0 0 3px rgba(0, 58, 105, 0.1);
            outline: none;
        }

        &::placeholder {
            color: #6b7280;
        }
    }

    &__button {
        background-color: #003a69;
        color: #ffffff;
        border: none;
        padding: 12px 24px;
        border-radius: 6px;
        font-weight: 600;
        font-size: 16px;
        cursor: pointer;
        transition: background-color 0.2s ease, transform 0.1s ease;
        white-space: nowrap;

        &:hover {
            background-color: #002a4a;
            transform: translateY(-1px);
        }

        &:active {
            transform: translateY(0);
        }

        &:focus {
            outline: 3px solid #ffdd00;
            outline-offset: 2px;
        }
    }

    &__example {
        background: #f1f5f9;
        border-left: 4px solid #003a69;
        padding: 16px 20px;
        border-radius: 0 6px 6px 0;

        p {
            margin: 0;
            color: #374151;
            font-style: italic;
        }
    }
}

// Modern Stats Section
.dfe-manual-stats {
    &--modern {
        .dfe-manual-stats__item {
            background: #ffffff;
            border-radius: 12px;
            padding: 24px;
            margin-bottom: 20px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            border: 1px solid #e5e7eb;
            transition: transform 0.2s ease, box-shadow 0.2s ease;

            &:hover {
                transform: translateY(-2px);
                box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
            }

            &--highlight {
                background: linear-gradient(135deg, #003a69 0%, #1d70b8 100%);
                color: #ffffff;
                border: none;

                .dfe-manual-stats__number {
                    color: #ffffff;
                }

                .dfe-manual-stats__label {
                    color: rgba(255, 255, 255, 0.9);
                }

                .dfe-manual-stats__source {
                    color: rgba(255, 255, 255, 0.7);
                }
            }
        }
    }

    &__item {
        text-align: center;

        &:last-child {
            margin-bottom: 0;
        }
    }

    &__number {
        font-size: 2.5rem;
        font-weight: 700;
        color: #003a69;
        line-height: 1;
        margin-bottom: 8px;
        display: block;
    }

    &__label {
        font-size: 16px;
        color: #374151;
        line-height: 1.4;
        margin-bottom: 8px;
        font-weight: 500;
    }

    &__source {
        font-size: 14px;
        color: #6b7280;
        font-style: italic;
    }
}