/**
 * IT Ticketing - Create Ticket Modal & Form Styles
 * Module: IT / IT Ticketing
 */

/* Reset aturan modal DaisyUI pada modal Ticketing */
.modal.it-ticket-modal {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    outline: 0;
    text-align: left;
    transform: none;
}

.it-ticket-modal *,
.it-ticket-modal *::before,
.it-ticket-modal *::after {
    box-sizing: border-box;
}

.modal.it-ticket-modal.fade {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.it-ticket-modal.show {
    opacity: 1;
}

.it-ticket-modal .modal-dialog {
    position: relative;
    display: flex;
    align-items: center;
    width: auto;
    max-width: 560px;
    min-height: calc(100% - 48px);
    margin: 24px auto;
    padding: 0 16px;
    pointer-events: none;
}

.it-ticket-modal .modal-dialog.modal-lg {
    max-width: 900px;
}

.it-ticket-modal .modal-dialog.modal-xl {
    max-width: 1140px;
}

.it-ticket-modal.fade .modal-dialog {
    transform: translateY(-24px);
    transition: transform 0.3s ease-out;
}

.it-ticket-modal.show .modal-dialog {
    transform: none;
}

.it-ticket-modal .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    pointer-events: auto;
    background: #fff;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.26);
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
}

.it-ticket-modal .modal-content>form {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    min-height: 0;
}

.it-ticket-modal .modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #dbeafe;
    background: linear-gradient(135deg, #f8fbff 0%, #eef2ff 100%);
}

.it-ticket-modal .modal-title {
    margin: 0;
    color: #0f172a;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.it-ticket-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 24px;
    line-height: 1.7;
    overflow-y: auto;
    overflow-wrap: anywhere;
    overscroll-behavior: contain;
}

.it-ticket-modal .modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.it-ticket-form-fields {
    display: grid;
    gap: 18px;
}

.it-ticket-identity-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.it-ticket-readonly {
    background: #f8fafc;
    color: #334155;
    cursor: default;
}

.it-ticket-field {
    display: grid;
    gap: 8px;
}

.it-ticket-label {
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}

.it-ticket-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #94a3b8 !important;
    border-radius: 11px;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.it-ticket-modal textarea.it-ticket-input {
    min-height: 132px;
    padding: 12px 14px;
    line-height: 1.5;
    resize: vertical;
}

.it-ticket-modal input[type="file"].it-ticket-input {
    height: auto;
    padding: 8px;
}

.it-ticket-input:hover:not(:disabled):not(:focus) {
    border-color: #64748b !important;
}

.it-ticket-input:focus,
.it-ticket-input:focus-visible {
    border-color: #2563eb !important;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.it-ticket-input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.it-ticket-input:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    opacity: 1;
}

.it-ticket-modal .it-ticket-readonly {
    border-color: #cbd5e1 !important;
    background: #f8fafc;
    color: #334155;
    box-shadow: none;
}

.it-ticket-help {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.it-ticket-photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    min-height: 54px;
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.it-ticket-photo-preview-empty {
    grid-column: 1 / -1;
    margin: 0;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

.it-ticket-photo-item {
    position: relative;
    min-width: 0;
    margin: 0;
    padding: 6px;
    border: 1px solid #dbe3ee;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
}

.it-ticket-photo-item img {
    display: block;
    width: 100%;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    background: #e2e8f0;
}

.it-ticket-photo-item figcaption {
    margin-top: 6px;
    padding: 0 2px;
    overflow: hidden;
    color: #475569;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.it-ticket-photo-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.24);
    transition:
        background-color 0.18s ease,
        transform 0.18s ease;
}

.it-ticket-photo-remove:hover {
    background: #dc2626;
    transform: scale(1.06);
}

.it-ticket-photo-remove:disabled {
    cursor: wait;
    opacity: 0.55;
    transform: none;
}

.it-ticket-photo-remove:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.5);
    outline-offset: 2px;
}

.it-ticket-photo-count {
    color: #2563eb;
    font-weight: 700;
}

.it-ticket-submit-note {
    flex-basis: 100%;
    margin: 0;
    color: #64748b;
    font-size: 13px;
    text-align: right;
}

.it-ticket-feedback {
    flex-basis: 100%;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.it-ticket-feedback[hidden] {
    display: none;
}

.it-ticket-feedback[data-state="error"] {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.it-ticket-feedback[data-state="success"] {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.it-ticket-feedback p {
    margin: 0;
}

.it-ticket-feedback ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.it-ticket-submit-button[aria-busy="true"] {
    cursor: wait;
}

.it-ticket-modal .modal-footer>.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 138px;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease;
}

.it-ticket-modal .it-ticket-secondary-button {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.it-ticket-modal .it-ticket-secondary-button:hover:not(:disabled) {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
}

.it-ticket-modal .it-ticket-submit-button {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 58%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
}

.it-ticket-modal .it-ticket-submit-button:hover:not(:disabled) {
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.36);
    transform: translateY(-1px);
}

.it-ticket-modal .modal-footer>.btn:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.42);
    outline-offset: 3px;
}

.it-ticket-modal .modal-footer>.btn:disabled {
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
}

.it-ticket-modal .it-ticket-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.it-ticket-modal .it-ticket-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.it-ticket-modal .it-ticket-close:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 3px;
}

/* Backdrop div yang dibuat oleh Bootstrap */
body.it-ticketing-landing>div.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: block;
    width: 100vw;
    height: 100vh;
    background: #0f172a;
    visibility: visible;
    pointer-events: auto;
}

body.it-ticketing-landing>div.modal-backdrop.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

body.it-ticketing-landing>div.modal-backdrop.show {
    opacity: 0.5;
}

body.it-ticketing-landing.modal-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {

    .modal.it-ticket-modal.fade,
    .it-ticket-modal.fade .modal-dialog,
    body.it-ticketing-landing>div.modal-backdrop.fade {
        transition: none;
    }
}

@media (min-width: 768px) {
    .it-ticket-form-fields {
        grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
    }

    .it-ticket-field--title {
        grid-column: 1;
        grid-row: 1;
    }

    .it-ticket-field--date {
        grid-column: 2;
        grid-row: 1;
    }

    .it-ticket-field--full {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .it-ticket-identity-grid {
        grid-template-columns: 1fr;
    }

    .it-ticket-modal .modal-dialog {
        min-height: calc(100% - 24px);
        margin: 12px auto;
        padding: 0 8px;
    }

    .it-ticket-modal .modal-content {
        max-height: calc(100vh - 24px);
        border-radius: 14px;
    }

    .it-ticket-modal .modal-header,
    .it-ticket-modal .modal-body,
    .it-ticket-modal .modal-footer {
        padding-right: 16px;
        padding-left: 16px;
    }

    .it-ticket-modal .modal-footer>.btn {
        width: 100%;
    }

    .it-ticket-submit-note {
        text-align: left;
    }
}
