/* ============================================================
   MXUber support / ticket page layer
   Pushed only on the ticket create page (see ticket create blade).
   All colors via --mx-* vars so dark mode inverts cleanly.
   Data-URI icons cannot use vars, so dark variants are scoped
   under html[data-theme="dark"] below.
   ============================================================ */

/* ------------------------------------------------------------
   1. Hero — "How can we help?" + search-like quick-describe bar
   ------------------------------------------------------------ */
.ticket-create-section {
    background: var(--mx-bg);
}

.ticket-create-section .mx-supporthead {
    max-width: 680px;
    margin-bottom: 34px;
    animation: mx-fade-in 0.4s ease both;
}

/* search-like input visual — sits outside the ticket <form> so it
   never touches validation; Enter prefills the subject field */
.mx-support-search {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(100%, 540px);
    margin-top: 24px;
    height: 56px;
    padding: 0 18px;
    background: var(--mx-surface-2);
    border: 1px solid transparent;
    border-radius: 999px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mx-support-search i {
    font-size: 19px;
    color: var(--mx-ink-2);
    transition: color 0.2s ease;
}

.mx-support-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    color: var(--mx-ink);
}

.mx-support-search input::placeholder {
    color: var(--mx-ink-3);
}

.mx-support-search kbd {
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--mx-ink-2);
    background: var(--mx-surface);
    border: 1px solid var(--mx-border);
    border-radius: 6px;
    padding: 3px 7px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.mx-support-search:focus-within {
    background: var(--mx-surface);
    border-color: var(--mx-ink);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .mx-support-search:focus-within {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.mx-support-search:focus-within i,
.mx-support-search:focus-within kbd {
    color: var(--mx-ink);
}

.mx-support-search:focus-within kbd {
    border-color: var(--mx-ink);
}

/* ------------------------------------------------------------
   2. Layout — form main column + sticky help sidebar
   ------------------------------------------------------------ */
.mx-ticket-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: start;
}

.mx-ticket-main {
    min-width: 0;
}

.mx-ticket-side {
    position: sticky;
    top: 92px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: mx-rise-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.mx-ticket-side__card {
    background: var(--mx-surface);
    border: 1px solid var(--mx-border);
    border-radius: 16px;
    padding: 22px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.mx-ticket-side__card:hover {
    border-color: var(--mx-border-2);
    box-shadow: var(--mx-shadow);
    transform: translateY(-2px);
}

.mx-ticket-side__card h3 {
    font-family: var(--mx-font-display, 'Inter Tight', Inter, sans-serif);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--mx-ink);
    margin: 0 0 12px;
}

.mx-ticket-side__card p {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--mx-ink-2);
    margin: 0 0 12px;
}

.mx-ticket-side__card a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--mx-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--mx-ink);
    padding-bottom: 1px;
    transition: opacity 0.2s ease;
}

.mx-ticket-side__card a:hover {
    opacity: 0.65;
}

.mx-ticket-side__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mx-ticket-side__steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--mx-ink-2);
}

.mx-ticket-side__steps span {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--mx-accent);
    color: var(--mx-on-accent);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

/* ------------------------------------------------------------
   3. Form card entrance — slideUp 20px + fadeIn, 400ms
   ------------------------------------------------------------ */
.ticket-create-section .contentbox {
    animation: mx-rise-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

@keyframes mx-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ------------------------------------------------------------
   4. Inputs — ink focus ring, 200ms ease
   ------------------------------------------------------------ */
.ticket-create-section .form-control {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ticket-create-section .form-control:focus {
    border-color: var(--mx-ink) !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08) !important;
    background: var(--mx-surface) !important;
}

html[data-theme="dark"] .ticket-create-section .form-control:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12) !important;
}

.ticket-create-section textarea.form-control {
    min-height: 120px;
}

/* ------------------------------------------------------------
   5. Department / priority selects styled as cards
   (native select + select2 widget + body-level dropdown)
   ------------------------------------------------------------ */

/* native department select: card + custom chevron */
.ticket-create-section select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--mx-surface) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230A0A0A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

html[data-theme="dark"] .ticket-create-section select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

body.rtl .ticket-create-section select.form-control {
    background-position: left 14px center;
    padding-right: 14px;
    padding-left: 40px;
}

/* select2 closed widget: same card language */
.ticket-create-section .select2-container {
    width: 100% !important;
}

.ticket-create-section .select2-container .select2-selection {
    height: 48px;
    background: var(--mx-surface-2);
    border: 1px solid var(--mx-border);
    border-radius: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230A0A0A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

html[data-theme="dark"] .ticket-create-section .select2-container .select2-selection {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

body.rtl .ticket-create-section .select2-container .select2-selection {
    background-position: left 14px center;
}

.ticket-create-section .select2-container .select2-selection .select2-selection__rendered {
    line-height: 46px;
    padding: 0 14px;
    font-size: 14.5px;
    color: var(--mx-ink);
}

.ticket-create-section .select2-container .select2-selection .select2-selection__arrow {
    display: none;
}

.ticket-create-section .select2-container .select2-selection .select2-selection__choice {
    background: var(--mx-surface);
    border: 1px solid var(--mx-border);
    border-radius: 999px;
    color: var(--mx-ink);
    font-size: 13px;
    line-height: 2;
    margin-top: 9px;
}

.ticket-create-section .select2-container:hover .select2-selection {
    border-color: var(--mx-ink-3);
}

.ticket-create-section .select2-container--open .select2-selection,
.ticket-create-section .select2-container--focus .select2-selection {
    border-color: var(--mx-ink);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .ticket-create-section .select2-container--open .select2-selection,
html[data-theme="dark"] .ticket-create-section .select2-container--focus .select2-selection {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

/* select2 dropdown is appended to <body>, so it cannot be scoped
   under the section — vars still resolve (inherited from <html>),
   and this styling only ships on this page */
.select2-container--default .select2-dropdown {
    background: var(--mx-surface);
    border: 1px solid var(--mx-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--mx-shadow-lg);
    overflow: hidden;
}

.select2-container--default .select2-results__option {
    padding: 10px 14px;
    font-size: 14.5px;
    color: var(--mx-ink);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--mx-surface-2) !important;
    color: var(--mx-ink) !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    font-weight: 600;
    color: var(--mx-ink);
}

.select2-container--default .select2-search--dropdown {
    padding: 10px;
    border-bottom: 1px solid var(--mx-border);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--mx-border) !important;
    border-radius: 8px !important;
    padding: 8px 10px;
    font-size: 14px;
    outline: 0;
    background: var(--mx-bg);
    color: var(--mx-ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--mx-ink) !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------
   6. Submit button — accent, hover deepen, press feedback
   ------------------------------------------------------------ */
.ticket-create-section .submit-btn .btn-solid {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ticket-create-section .submit-btn .btn-solid:hover {
    background: var(--mx-accent-hover) !important;
}

.ticket-create-section .submit-btn .btn-solid:active {
    transform: translateY(1px);
}

.ticket-create-section .submit-btn .btn-solid:focus-visible {
    outline: 2px solid var(--mx-ink);
    outline-offset: 3px;
}

.ticket-create-section .submit-btn .btn-solid:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

/* ------------------------------------------------------------
   7. File upload — dashed drop area, icon + hint centered,
   drag-over state (class toggled by the page script)
   ------------------------------------------------------------ */
.ticket-create-section .form-box.mx-drop--over {
    border-color: var(--mx-ink) !important;
    background: var(--mx-surface-2) !important;
}

.ticket-create-section .form-box.mx-drop--over::after {
    color: var(--mx-ink) !important;
}

@supports selector(:has(*)) {
    .ticket-create-section .form-box:has(> input[type="file"]) {
        position: relative;
        display: block;
        min-height: 150px;
        background: var(--mx-surface);
        border: 1.5px dashed var(--mx-border-2);
        border-radius: 12px;
        transition: border-color 0.2s ease, background-color 0.2s ease;
    }

    .ticket-create-section .form-box:has(> input[type="file"]) > label {
        position: absolute;
        top: 12px;
        left: 16px;
        margin: 0;
        z-index: 2;
    }

    body.rtl .ticket-create-section .form-box:has(> input[type="file"]) > label {
        left: auto;
        right: 16px;
    }

    /* invisible full-area hit target: click anywhere browses */
    .ticket-create-section .form-box:has(> input[type="file"]) > input[type="file"] {
        position: absolute;
        inset: 0;
        width: 100% !important;
        height: 100% !important;
        opacity: 0;
        cursor: pointer;
        z-index: 3;
    }

    /* centered icon + hint (text via data-mx-hint, set by script) */
    .ticket-create-section .form-box:has(> input[type="file"])::after {
        content: attr(data-mx-hint);
        position: absolute;
        inset: 30px 16px 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-top: 46px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%23545454' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4m0 0l-4 4m4-4l4 4'/%3E%3Cpath d='M4 16v3a1 1 0 001 1h14a1 1 0 001-1v-3'/%3E%3C/svg%3E") no-repeat center 4px / 30px 30px;
        color: var(--mx-ink-2);
        font-size: 13.5px;
        font-weight: 500;
        line-height: 1.45;
        text-align: center;
        pointer-events: none;
        transition: color 0.2s ease;
    }

    html[data-theme="dark"] .ticket-create-section .form-box:has(> input[type="file"])::after {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='%23a6a6a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4m0 0l-4 4m4-4l4 4'/%3E%3Cpath d='M4 16v3a1 1 0 001 1h14a1 1 0 001-1v-3'/%3E%3C/svg%3E");
    }

    .ticket-create-section .form-box:has(> input[type="file"]) .invalid-feedback {
        position: absolute;
        left: 16px;
        right: 16px;
        bottom: 8px;
        font-size: 12px;
        z-index: 2;
    }
}

/* ------------------------------------------------------------
   8. Success state — green check, message, bold destination
   ------------------------------------------------------------ */
.mx-ticket-success {
    background: var(--mx-surface);
    border: 1px solid var(--mx-border);
    border-radius: 24px;
    box-shadow: var(--mx-shadow-lg);
    padding: 56px 40px;
    text-align: center;
    animation: mx-rise-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mx-ticket-success[hidden] {
    display: none;
}

.mx-ticket-success__badge {
    width: 68px;
    height: 68px;
    border-radius: 999px;
    background: var(--mx-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 10px rgba(6, 169, 92, 0.12);
    animation: mx-pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.mx-ticket-success__badge svg {
    width: 32px;
    height: 32px;
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: mx-check-draw 0.35s ease 0.2s forwards;
}

.mx-ticket-success h2 {
    font-family: var(--mx-font-display, 'Inter Tight', Inter, sans-serif);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--mx-ink);
    margin: 22px 0 10px;
}

.mx-ticket-success p {
    max-width: 44ch;
    margin: 0 auto 26px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--mx-ink-2);
}

.mx-ticket-success p strong {
    color: var(--mx-ink);
    font-weight: 700;
    word-break: break-word;
}

.mx-ticket-success__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 28px;
    background: var(--mx-accent);
    color: var(--mx-on-accent) !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 9999px !important;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.mx-ticket-success__link:hover {
    background: var(--mx-accent-hover);
    color: var(--mx-on-accent);
}

.mx-ticket-success__link:active {
    transform: translateY(1px);
}

@keyframes mx-pop-in {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes mx-check-draw {
    to { stroke-dashoffset: 0; }
}

/* ------------------------------------------------------------
   9. Misc — recaptcha breathing room, responsive
   ------------------------------------------------------------ */
.ticket-create-section .g-recaptcha {
    margin: 6px 0 10px;
}

@media (max-width: 1199.98px) {
    .mx-ticket-layout {
        grid-template-columns: 1fr;
    }

    .mx-ticket-side {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 575.98px) {
    .mx-ticket-success {
        padding: 40px 22px;
    }

    .ticket-create-section .submit-btn .btn-solid {
        width: 100%;
    }
}
