/* Printing Widget Specific Overrides and Enhancements */

.np-printing-widget-container {
    --otg-accent: #009245;
    --otg-secondary: rgba(0, 146, 69, 0.1);
}

.np-drop-zone {
    border: 2px dashed var(--otg-border);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fcfcfd;
    position: relative;
    z-index: 1;
}

.np-drop-zone:hover, .np-drop-zone.drag-over {
    border-color: var(--otg-accent);
    background: var(--otg-secondary);
}

.np-supported-formats {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--otg-text-muted);
    background: #fff;
    padding: 4px 10px;
    border: 1px solid var(--otg-border);
    border-radius: 4px;
}

/* Toolbar Buttons */
.np-tool-btn {
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.np-tool-btn:hover {
    background: #e2e8f0;
    color: var(--otg-text-main);
}

.np-tool-btn.active {
    background: var(--otg-accent);
    color: #fff;
    border-color: var(--otg-accent);
}

/* Page Wrappers in Preview */
.np-page-wrapper {
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    background: #fff;
    margin-bottom: 50px;
}

.np-page-number {
    position: absolute;
    top: -30px;
    left: 0;
    background: var(--otg-accent);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 4px 4px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.np-page-canvas, .np-fabric-canvas {
    display: block;
}

.canvas-container {
    position: absolute !important;
    top: 0;
    left: 0;
}

/* Form Styles */
.np-settings-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.np-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.np-form-row {
    display: flex;
    gap: 10px;
}

.np-form-row .np-form-group {
    flex: 1;
}

.np-label {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 2px;
}

.otg-input {
    width: 100%;
    height: 40px !important;
    padding: 8px 12px !important;
    border: 1px solid var(--otg-border) !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    color: var(--otg-text-main) !important;
    background: #fff !important;
    transition: all 0.2s ease !important;
}

.otg-input:focus {
    outline: none !important;
    border-color: var(--otg-accent) !important;
    box-shadow: 0 0 0 3px var(--otg-secondary) !important;
}

.np-radio-group {
    display: flex;
    gap: 15px;
    margin-top: 4px;
}

.np-radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--otg-text-main);
    cursor: pointer;
}

.np-radio-group input[type="radio"] {
    margin: 0;
    accent-color: var(--otg-accent);
}

.np-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--otg-text-main);
    cursor: pointer;
    margin-top: 5px;
}

.np-checkbox-label input[type="checkbox"] {
    accent-color: var(--otg-accent);
}

/* Summary Box */
.np-summary-box {
    margin-top: 25px;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid var(--otg-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.np-summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #64748b;
}

.np-summary-line strong {
    color: var(--otg-text-main);
    font-weight: 700;
}

.np-summary-line.total {
    padding-top: 10px;
    border-top: 1px dashed var(--otg-border);
    font-size: 13px;
    color: var(--otg-text-main);
    font-weight: 800;
}

.np-summary-line.total strong {
    color: var(--otg-accent);
    font-size: 16px;
}

/* Modal Styles */
.np-modal {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.np-modal-content {
    background-color: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--otg-border);
    display: flex;
    flex-direction: column;
}

.np-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--otg-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.np-modal-header h3, #np-notify-title { 
    margin: 0; 
    font-size: 16px; 
    font-family: var(--otg-font) !important;
    font-weight: 800;
    color: #1e293b;
}

.np-close-modal, .np-close-btn {
    font-size: 22px;
    cursor: pointer;
    color: #94a3b8;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.np-close-modal:hover, .np-close-btn:hover {
    color: #1e293b;
}

.np-sig-canvas-wrapper {
    background: #f8fafc;
    padding: 20px;
}

#np-sig-pad {
    background: #fff;
    border: 1px solid var(--otg-border);
    border-radius: 4px;
    width: 100%;
    height: 200px;
    cursor: crosshair;
}

.np-modal-footer {
    padding: 15px 25px;
    background: #f8fafc;
    border-top: 1px solid var(--otg-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.np-modal-footer button {
    padding: 10px 25px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    display: inline-block !important;
    min-width: 100px;
    height: auto !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

#np-notify-ok {
    background: var(--otg-accent) !important;
    border: 1px solid var(--otg-accent) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#np-notify-cancel {
    background: #fff !important;
    border: 1px solid var(--otg-border) !important;
    color: #64748b !important;
}

/* Ensure modal is clickable and not hidden by other elements */
#np-notify-modal {
    z-index: 100005 !important;
}

/* Notification Modal Body Overrides */
#np-notify-msg {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #475569;
    font-family: var(--otg-font) !important;
    max-height: 300px;
    overflow-y: auto;
    padding: 20px 25px;
    word-break: break-word;
}

/* Search Group */
.search-group input:focus {
    outline: none;
    border-color: var(--otg-accent);
    box-shadow: 0 0 0 2px var(--otg-secondary);
}

/* Ensure Font Consistency */
.np-printing-widget-container h1,
.np-printing-widget-container h2,
.np-printing-widget-container h3,
.np-printing-widget-container h4,
.np-printing-widget-container h5,
.np-printing-widget-container span,
.np-printing-widget-container p,
.np-printing-widget-container label,
.np-printing-widget-container input,
.np-printing-widget-container select,
.np-printing-widget-container button {
    font-family: var(--otg-font) !important;
}

/* Fix for fabric canvas positioning */
.np-preview-container {
    scrollbar-width: thin;
    scrollbar-color: var(--otg-accent) #475569;
}

.np-preview-container::-webkit-scrollbar {
    width: 8px;
}

.np-preview-container::-webkit-scrollbar-track {
    background: #475569;
}

.np-preview-container::-webkit-scrollbar-thumb {
    background-color: var(--otg-accent);
    border-radius: 20px;
}

/* Animations */
.spinning i {
    animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(359deg); }
}
