/**
 * IT Websmith Interactive Questionnaire - Admin Stylesheet
 */

/* Estimate Actions Bar in Metabox */
.iq-estimate-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #dc2626;
    border-radius: 6px;
    padding: 12px 18px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.iq-action-bar-info {
    font-size: 14px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.iq-action-bar-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.iq-action-bar-buttons .button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    padding: 4px 14px;
    height: auto;
    font-size: 13px;
}

.iq-badge-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.iq-badge-published {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.iq-badge-draft {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* Custom Repeater Tables (Custom Add-ons & Custom Fields) */
.iq-repeater-container {
    margin: 15px 0 25px 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.iq-repeater-desc {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.iq-repeater-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}

.iq-repeater-table th {
    background: #f1f5f9;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-align: left;
    border-bottom: 2px solid #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.iq-repeater-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.iq-repeater-table tr:hover td {
    background: #f8fafc;
}

.iq-repeater-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.iq-repeater-input:focus {
    border-color: #dc2626;
    outline: none;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.iq-repeater-number {
    width: 110px;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    box-sizing: border-box;
}

.iq-repeater-number:focus {
    border-color: #dc2626;
    outline: none;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.iq-btn-remove-row {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.iq-btn-remove-row:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.iq-btn-add-row {
    background: #f8fafc;
    border: 1px dashed #94a3b8;
    color: #334155;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.iq-btn-add-row:hover {
    background: #f1f5f9;
    border-color: #dc2626;
    color: #dc2626;
}

.iq-repeater-empty {
    text-align: center;
    padding: 18px !important;
    color: #94a3b8;
    font-style: italic;
    font-size: 13px;
}

/* Post list table row actions and buttons */
.iq-row-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 3px;
    text-decoration: none;
    cursor: pointer;
    margin-right: 4px;
}

.iq-row-btn-view {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.iq-row-btn-view:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.iq-row-btn-pdf {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.iq-row-btn-pdf:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* Modal Overlay & Dialog for Viewing Completed Estimates */
.iq-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: iqModalFadeIn 0.2s ease;
}

@keyframes iqModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.iq-modal-dialog {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.iq-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.iq-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.iq-modal-close {
    background: none;
    border: none;
    font-size: 26px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.iq-modal-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.iq-modal-body {
    padding: 24px 30px;
    overflow-y: auto;
    flex: 1;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #334155;
    line-height: 1.5;
}

.iq-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.iq-modal-footer-actions {
    display: flex;
    gap: 10px;
}

/* Modal View Document Styling */
.iq-preview-invoice-container {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    background: #ffffff;
}

.iq-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.iq-preview-logo-title {
    font-size: 22px;
    font-weight: 800;
    color: #dc2626;
    margin: 0;
}

.iq-preview-header-meta {
    text-align: right;
    font-size: 12px;
    color: #64748b;
}

.iq-preview-client-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    background: #f8fafc;
    border-radius: 6px;
    padding: 14px 18px;
}

.iq-preview-client-col h4 {
    margin: 0 0 6px 0;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
}

.iq-preview-client-col p {
    margin: 2px 0;
    font-size: 13px;
    color: #0f172a;
}

.iq-preview-banner {
    background: #0f172a;
    color: #ffffff;
    border-radius: 8px;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 24px;
}

.iq-preview-banner-col {
    display: flex;
    flex-direction: column;
}

.iq-preview-banner-col.divider {
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 24px;
}

.iq-preview-banner-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #f87171;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.iq-preview-banner-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
}

.iq-preview-banner-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.iq-preview-section {
    margin-bottom: 20px;
}

.iq-preview-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.iq-preview-table-items {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 13px;
}

.iq-preview-table-items th {
    background: #f1f5f9;
    padding: 8px 12px;
    text-align: left;
    font-weight: 700;
    color: #334155;
    border-bottom: 1px solid #cbd5e1;
}

.iq-preview-table-items td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.iq-preview-disclaimer {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    margin-top: 20px;
    border-top: 1px dashed #cbd5e1;
    padding-top: 10px;
}

/* Floating Toast Alert */
.iq-copy-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #0f172a;
    color: #ffffff;
    padding: 14px 22px;
    border-radius: 8px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.35);
    font-size: 13px;
    font-weight: 600;
    z-index: 999999;
    display: none;
    align-items: center;
    gap: 10px;
    border-left: 5px solid #10b981;
    letter-spacing: 0.01em;
}

.iq-copy-toast .dashicons {
    color: #34d399;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Share Link Modal Styles & Animation */
@keyframes iqModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#iq-share-link-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(2px);
    z-index: 100050;
    align-items: center;
    justify-content: center;
}

/* AI Estimation Modal & Components */
@keyframes iqSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.iq-ai-spinner {
    border-radius: 50%;
    animation: iqSpin 0.8s linear infinite;
}

#iq-ai-results-modal .iq-modal-dialog {
    animation: iqModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.iq-ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e2e8f0;
    color: #1e293b;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    border: 1px solid #cbd5e1;
}

.iq-ai-chip-icon {
    color: #dc2626;
    font-size: 14px;
    line-height: 1;
}

