/* ====================================================
   GlobalModal — Global Input / Alert / Confirm Modal
   Shared CSS — loaded on every page via head.php
   ==================================================== */

/* Backdrop */
.gmodal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: gmodal-fade-in 0.22s ease;
}

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

/* Modal Box */
.gmodal-box {
    background: var(--surface);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.12));
    border-radius: 20px;
    padding: 32px 28px 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.04);
    animation: gmodal-slide-up 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes gmodal-slide-up {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Icon Circle */
.gmodal-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 16px;
    flex-shrink: 0;
}
.gmodal-icon.info    { background: rgba(99,102,241,0.12); color: var(--primary-500, #6366f1); }
.gmodal-icon.warning { background: rgba(245,158,11,0.12); color: #f59e0b; }
.gmodal-icon.error   { background: rgba(239,68,68,0.12);  color: #ef4444; }
.gmodal-icon.success { background: rgba(34,197,94,0.12);  color: #22c55e; }

/* Title */
.gmodal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

/* Message */
.gmodal-message {
    font-size: 13.5px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.55;
}

/* Input Wrapper */
.gmodal-input-wrapper {
    margin-bottom: 20px;
}

.gmodal-input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 7px;
}

.gmodal-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

textarea.gmodal-input {
    resize: vertical;
    min-height: 90px;
    line-height: 1.5;
}

.gmodal-input:focus {
    border-color: var(--primary-500, #6366f1);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Actions Row */
.gmodal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Base Button */
.gmodal-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.18s ease;
    font-family: inherit;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* Cancel */
.gmodal-btn-cancel {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.gmodal-btn-cancel:hover {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

/* Confirm (default — purple) */
.gmodal-btn-confirm {
    background: var(--primary-500, #6366f1);
    color: #fff;
}
.gmodal-btn-confirm:hover {
    background: var(--primary-600, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

/* Confirm (danger — red) */
.gmodal-btn-danger {
    background: #ef4444;
    color: #fff;
}
.gmodal-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239,68,68,0.35);
}

/* Close × button */
.gmodal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    flex-shrink: 0;
}
.gmodal-close-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* ====================================================
   Tool Instruction Banner
   Used in doc-converter and other tool pages to explain
   what a tool does and list known limitations / tips.
   ==================================================== */
.tool-instruction-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.06));
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.tool-instruction-banner .tib-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(99,102,241,0.12);
    color: var(--primary-500, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    margin-top: 1px;
}

.tool-instruction-banner .tib-body { flex: 1; min-width: 0; }

.tool-instruction-banner strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

/* ⚠ Limitation badge */
.tool-instruction-banner .tib-note {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.25);
    color: #b45309;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11.5px;
    font-weight: 600;
    margin-top: 6px;
}

/* 💡 Tip badge */
.tool-instruction-banner .tib-tip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.15);
    color: var(--primary-600, #4f46e5);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11.5px;
    font-weight: 600;
    margin-top: 6px;
    margin-left: 4px;
}
