/* app/styles/components/modals.css */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
}

.modal-content {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--md-sys-shape-corner-medium);
    width: 90%;
    max-width: 650px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modal-fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-fade-in {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: var(--md-sys-spacing-5) 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
    margin: 0;
    font-size: var(--md-sys-typescale-title-small);
    color: var(--md-sys-color-on-surface-strong, #ffffff);
    font-weight: 500;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-5);
    background-color: transparent;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-2);
}

.input-group label {
    font-size: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
}

.input-group input[type="text"],
.input-group textarea,
.input-group input[type="password"] {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--md-sys-color-on-surface);
    padding: var(--md-sys-spacing-3) var(--md-sys-spacing-4);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: var(--md-sys-typescale-title-small);
    transition: all 0.2s ease;
    font-family: inherit;
}

.input-group textarea {
    height: 250px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--md-sys-color-primary);
    background: rgba(0, 0, 0, 0.35);
    outline: none;
    box-shadow: 0 0 8px rgba(25, 127, 230, 0.25);
}

#modal-json-status {
    font-size: var(--md-sys-typescale-body-medium);
    margin-top: var(--md-sys-spacing-1);
    min-height: 16px;
}

.modal-footer {
    padding: var(--md-sys-spacing-5) 20px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-right {
    display: flex;
    gap: var(--md-sys-spacing-3);
    margin-left: auto;
}

.textarea-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

.textarea-actions {
    position: absolute;
    top: var(--md-sys-spacing-3);
    right: var(--md-sys-spacing-3);
    display: flex;
    gap: var(--md-sys-spacing-2);
    z-index: 5;
}

#interface-modal input:focus, #interface-modal textarea:focus {
    border-color: var(--md-sys-color-primary) !important;
    outline: none;
}

/* Modal Close Buttons styling for high-contrast accessibility & micro-animations */
#modal-close, 
#snippet-modal-close, 
#tab-picker-modal-close, 
#diff-modal-close, 
#markdown-viewer-close, 
#onboarding-modal-close,
#timesheet-modal-close,
#kb-modal-close {
    cursor: pointer;
    opacity: 0.8;
    color: var(--md-sys-color-on-surface-strong, #ffffff) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#modal-close:hover, 
#snippet-modal-close:hover, 
#tab-picker-modal-close:hover, 
#diff-modal-close:hover, 
#markdown-viewer-close:hover, 
#onboarding-modal-close:hover,
#timesheet-modal-close:hover,
#kb-modal-close:hover {
    opacity: 1;
    background: rgba(244, 71, 71, 0.2) !important;
    border-color: rgba(244, 71, 71, 0.45) !important;
    color: var(--md-sys-color-error, #ff5252) !important;
    transform: rotate(90deg);
}

#modal-close svg, 
#snippet-modal-close svg, 
#tab-picker-modal-close svg, 
#diff-modal-close svg, 
#markdown-viewer-close svg, 
#onboarding-modal-close svg,
#timesheet-modal-close svg,
#kb-modal-close svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}
