/* =================================================================
   v13.0.0: Quote Enhancements - Resizable Modals & Special Features
   ================================================================= */

/* Resizable Modal Base */
.resizable-modal {
    position: fixed !important;
}

.resizable-modal-content {
    resize: both;
    overflow: auto;
    min-width: 600px;
    min-height: 400px;
    max-width: 95vw;
    max-height: 95vh;
    position: relative;
}

/* Drag Handle */
.modal-drag-handle {
    cursor: move;
    user-select: none;
}

.modal-header {
    cursor: move !important;
}

/* Resize Handle Indicator */
.resizable-modal-content::after {
    content: '⋰';
    position: absolute;
    bottom: 5px;
    right: 5px;
    padding: 5px;
    color: #999;
    font-size: 20px;
    pointer-events: none;
    z-index: 1;
}

/* Modal Control Buttons */
.btn-modal-control {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-modal-control:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-modal-control:active {
    transform: translateY(0);
}

/* Special Discount Field - Enhanced Styling */
#specialDiscount {
    transition: all 0.3s ease;
}

#specialDiscount:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5);
}

#specialDiscountAmount {
    transition: all 0.3s ease;
}

/* Auto-Generated Quote Name Field */
#quoteNumberInput {
    transition: all 0.3s ease;
}

#quoteNumberInput:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

/* Editable Quantity Inputs in Quote Table */
.quote-item-qty-input {
    width: 80px;
    padding: 8px;
    text-align: center;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.quote-item-qty-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.quote-item-qty-input:hover {
    border-color: #764ba2;
}

/* Bulk Actions Toolbar - Enhanced */
.bulk-actions-toolbar {
    animation: slideDownBulk 0.3s ease-out;
}

@keyframes slideDownBulk {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bulk-actions-toolbar button {
    transition: all 0.2s ease;
}

.bulk-actions-toolbar button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

.bulk-actions-toolbar button:active {
    transform: translateY(0);
}

/* Highlighted Boxes for Exports */
.valid-until-box {
    background: #FFF9C4;
    padding: 15px;
    border-left: 5px solid #FBC02D;
    border-radius: 4px;
    margin: 20px 0;
}

.special-discount-box {
    background: #FFEBEE;
    padding: 15px;
    border-left: 5px solid #EF5350;
    border-radius: 4px;
    margin: 20px 0;
}

/* Modal Maximize State */
.modal-maximized {
    width: 98vw !important;
    height: 98vh !important;
    max-width: 98vw !important;
    max-height: 98vh !important;
}

/* Modal Minimize State */
.modal-minimized {
    height: 60px !important;
    overflow: hidden;
}

/* Smooth Transitions */
.resizable-modal-content {
    transition: width 0.3s ease, height 0.3s ease;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .resizable-modal-content {
        min-width: 95vw;
        max-width: 95vw;
    }
    
    #specialDiscount {
        font-size: 20px !important;
    }
    
    #specialDiscountAmount {
        font-size: 24px !important;
    }
}

/* Print Styles for Exports */
@media print {
    .valid-until-box {
        border: 2px solid #FBC02D;
        page-break-inside: avoid;
    }
    
    .special-discount-box {
        border: 2px solid #EF5350;
        page-break-inside: avoid;
    }
}

/* Focus Visible for Accessibility */
.resizable-modal-content:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Loading State for Special Discount */
#specialDiscount[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success State Animation */
@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
}

.quote-item-qty-input.updated {
    animation: successPulse 0.6s ease-out;
}

/* Hover Effects for Interactive Elements */
.quote-name-field:hover,
.special-discount-field:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Active State */
.quote-name-field:active,
.special-discount-field:active {
    transform: translateY(0);
}
