.contact-sections {
    margin: 0;
    padding: 140px var(--tickets-page-section-inline-padding) 50px;
    background-color: var(--articles-background-color);

    background-size: 5% auto;
    transition:
        background 0.3s,
        border-radius 0.3s,
        opacity 0.3s;

    & .text {
        padding-block: 30px;
        text-align: center;
    }

    & .contact-form {
        border-radius: 15px;
        background-color: var(--light-color);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

        & h2 {
            font-size: 24px;
            font-weight: bold;
        }

        & .groups {
            padding: 15px;

            & .group:not(:last-child) {
                margin-bottom: 15px;
            }

            & .group {
                gap: 15px;
                padding: 5px;

                & > div {
                    width: 100%;

                    & label {
                        display: block;
                        font-size: 12px;
                        margin-bottom: 5px;
                    }

                    & .input {
                        padding: 5px;
                        direction: ltr;
                        border-radius: 10px;
                        border: 1px solid var(--dark-muted-color);
                        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);

                        &:has(input:focus),
                        &:has(select:focus),
                        &:has(textarea:focus) {
                            border: 1px solid var(--main-color);
                        }

                        & input,
                        & select,
                        & textarea {
                            width: 100%;
                            text-align: end;
                            padding-inline-end: 10px;

                            &:focus {
                                outline: none;
                            }
                        }

                        & .icon {
                            width: 37px;
                            height: 35px;
                            padding: 7px;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            border-radius: 10px;
                            position: relative;
                            z-index: 1;

                            &::after {
                                content: "";
                                position: absolute;
                                top: 0;
                                left: 0;
                                width: 100%;
                                height: 100%;
                                opacity: 0.2;
                                z-index: -1;
                                border-radius: 10px;
                                transition: opacity 0.3s;
                                background-color: var(--main-color);
                            }
                        }
                    }
                }

                & .add-attachment-input {
                    width: fit-content;
                    font-weight: bold;
                    cursor: pointer;
                    text-align: center;
                    padding: 10px 20px;
                    margin-top: 20px;
                    border-radius: 10px;
                    color: var(--light-main-color);
                    z-index: 5;
                    position: relative;
                    border: none;

                    &::before {
                        content: "";
                        width: 100%;
                        height: 100%;
                        position: absolute;
                        top: 0;
                        left: 0;
                        z-index: 1;
                        opacity: 0.1;
                        border-radius: 10px;
                        background-color: var(--light-main-color);
                    }
                }
            }

            & .verification {
                padding: 15px;
                border-radius: 10px;
                border: 1px dashed var(--light-muted-color);

                & .rotate {
                    width: 45px;
                    height: 45px;
                    padding: 15px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    position: relative;
                    z-index: 3;
                    color: var(--light-main-color);

                    &::after {
                        content: "";
                        position: absolute;
                        width: 100%;
                        height: 100%;
                        top: 0;
                        left: 0;
                        z-index: 1;
                        opacity: 0.1;
                        border-radius: 10px;
                        transition: opacity 0.3s;
                        background-color: var(--light-main-color);
                    }
                }
            }

            .ticket-submit {
                padding: 10px 25px;
            }
        }
    }
}

#attachments-container {
    .input {
        cursor: pointer;
        position: relative;

        &::before {
            content: attr(data-message);
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            right: auto;
            cursor: pointer;
            text-align: end;
            padding-inline: 10px;
            border-radius: 10px;
            pointer-events: none;
            align-content: center;
            z-index: 50;
            color: var(--dark-color);
            background-color: var(--light-color);
        }
    }
}

.ticket-show-sections {
    #attachments-container {
        .input {
            &::before {
                text-align: start;
            }
        }
    }
}

.tickets-section {
    text-align: center;
    padding-block: 170px 100px;

    & .title {
        font-size: 22px;
        color: var(--light-main-color);
    }

    & .tickets-form {
        padding: 15px;
        border-radius: 15px;
        margin-bottom: 30px;
        background-color: var(--light-color);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

        & > h2 {
            font-size: 26px;
            font-weight: bold;
            margin-block: 15px;
        }

        & .group-tickets {
            & label {
                display: block;
                text-align: start;
                margin-bottom: 10px;
            }

            & input {
                width: 100%;
                outline: none;
                border-radius: 50px;
                padding: 10px 20px;
                border: 1px solid var(--light-muted-color);

                &:focus {
                    border: 1px solid var(--light-main-color);
                }
            }

            & button {
                margin: 30px 0 15px;
                transition: all 0.1s ease;
                box-shadow: 0 8px 20px -5px var(--light-main-color);

                &:hover {
                    transform: translateY(-3px);
                    box-shadow:
                        0 8px 20px -5px var(--light-main-color),
                        0 12px 40px -10px var(--light-main-color);
                }
            }
        }
    }
}

html[lang="en"] {
    .contact-sections {
        & .contact-form {
            & .groups {
                & .group {
                    & > div {
                        & .input {
                            direction: rtl;
                        }
                    }
                }
            }
        }
    }

    .ticket-show-sections {
        #attachments-container {
            .input {
                &::before {
                    text-align: start;
                }
            }
        }
    }
}

@media (max-width: 1080px) {
    .contact-sections {
        padding-inline: calc(var(--tickets-page-section-inline-padding) / 2);
    }
}

@media (max-width: 992px) {
    .contact-sections {
        padding-inline: calc(var(--tickets-page-section-inline-padding) / 4);
    }
}

@media (max-width: 768px) {
    .contact-sections {
        padding-inline: var(--small-inline-padding);
    }
}

@media (max-width: 768px) {
    .contact-sections {
        padding: 110px var(--main-inline-padding) 50px;

        & .text {
            padding-block: 15px;
        }

        & .contact-form {
            & .groups {
                & .group {
                    flex-direction: column;
                }

                & .verification {
                    & > div {
                        flex-direction: column-reverse;
                    }

                    & .inter,
                    & .inter > div {
                        width: 100%;
                    }
                }
            }
        }
    }

    .tickets-section {
        & .title {
            font-size: 18px;
        }

        & .tickets-form {
            & > h2 {
                font-size: 20px;
            }
        }
    }
}

@media (max-width: 425px) {
    .contact-sections {
        & .contact-form {
            & h2 {
                font-size: 18px;
            }

            & p {
                font-size: 12px;
            }
        }

        & .contact-form {
            & .groups {
                & .group {
                    & .add-attachment-input {
                        padding: 6px 15px;
                        font-size: 10px;

                        &::before {
                            border-radius: 6px;
                        }
                    }
                }
            }
        }
    }

    .tickets-section {
        & .title {
            font-size: 16px;
        }

        & .tickets-form {
            & > h2 {
                font-size: 18px;
            }
        }
    }
}

/* ── Custom Department Select ──────────────────────────────── */
.custom-dept-select {
    position: relative;
    flex: 1;
    min-width: 0;
}

.dept-hidden-select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    border: none;
    top: 0;
    left: 0;
}

.dept-select-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    cursor: pointer;
    width: 100%;
    min-height: 35px;
    user-select: none;
    border-radius: 8px;
    transition: background 0.15s;
    flex-direction: row-reverse;
    text-align: right;
}

.dept-select-trigger:hover {
    background: rgba(0, 0, 0, 0.03);
}

.dept-trigger-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.05);
    color: var(--light-main-color);
    transition:
        background 0.2s,
        color 0.2s;
}

.dept-trigger-label {
    flex: 1;
    font-size: 13px;
    color: var(--muted-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.dept-trigger-label.has-value {
    color: var(--dark-color);
    font-weight: 500;
}

.dept-trigger-arrow {
    font-size: 10px;
    color: var(--muted-color);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.custom-dept-select.open .dept-trigger-arrow {
    transform: rotate(180deg);
}

.dept-select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: -5px;
    right: -5px;
    background-color: var(--light-color);
    border: 1px solid var(--dark-muted-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    z-index: 200;
    overflow: hidden;
    display: none;
    padding: 4px;
    animation: deptDropIn 0.18s ease;
}

@keyframes deptDropIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-dept-select.open .dept-select-dropdown {
    display: block;
}

.dept-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
    font-size: 13px;
    justify-content: end;
    flex-direction: row-reverse;
}

.dept-select-option:hover {
    background-color: var(--articles-background-color);
}

.dept-select-option.selected {
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.04);
}

.dept-opt-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    font-size: 13px;
    flex-shrink: 0;
    transition: background 0.2s;
}
