/**
 * Supaks Quote Forms - Modern Frontend CSS
 * Fixed layout, dropdown, and spacing issues
 *
 * @package SupaksQuoteForms
 */

/* Form Container */
.supaks-quote-form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.supaks-form-title {
    text-align: center;
    color: #2c3e50;
    font-weight: 600;
    font-size: 28px;
    margin: 0 0 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Required Fields Note */
.supaks-required-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #f39c12;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    border-radius: 4px;
}

.required {
    color: #e74c3c;
    font-weight: 600;
}

/* Fieldsets */
.supaks-fieldset {
    border: 1px solid #dee2e6;
    margin-bottom: 25px;
    padding: 0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    box-sizing: border-box;
}

.supaks-fieldset legend {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    padding: 16px 20px;
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    width: 100%;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}

.supaks-fieldset legend::before {
    content: '';
    width: 4px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* Modern Form Layout */
.supaks-form-row {
    display: block;
    margin-bottom: 0;
}

.supaks-form-group {
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid #f1f3f4;
    min-height: 50px;
    transition: background-color 0.2s ease;
}

.supaks-form-group:hover {
    background-color: #f8f9fa;
}

.supaks-form-group:last-child {
    border-bottom: none;
}

.supaks-form-group label {
    flex: 0 0 150px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    font-weight: 500;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
    align-self: center;
    margin: 0;
    box-sizing: border-box;
}

/* Secondary labels in inline groups - smaller flex basis */
.supaks-qty-label {
    flex: 0 0 30px !important;
    min-width: 30px !important;
}

.supaks-secondary-label {
    flex: 0 0 100px !important;
    min-width: 100px !important;
}

.supaks-form-group > :not(label) {
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

/* Address Layout Groups */
.supaks-address-row {
    display: flex;
    gap: 12px;
    width: 100%;
    align-items: center;
}

.supaks-address-row .supaks-form-control {
    flex: 1;
    margin: 0;
}

.supaks-address-row .supaks-city {
    flex: 2;
    min-width: 150px;
}

.supaks-address-row .supaks-state {
    flex: 1;
    min-width: 100px;
}

.supaks-address-row .supaks-zip {
    flex: 0 0 100px;
}

.supaks-same-billing {
    padding: 12px !important;
}

/* Form Controls - Ensure padding is never overridden */
.supaks-form-control,
input.supaks-form-control,
select.supaks-form-control,
textarea.supaks-form-control {
    border: 2px solid #e9ecef;
    border-radius: 4px;
    padding: 8px 10px !important;
    margin: 5px 10px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    transition: all 0.2s ease;
    min-height: 18px;
    box-sizing: border-box;
    width: auto;
}

.supaks-form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.supaks-form-control.error {
    border-color: #e74c3c;
    background-color: #fdedec;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Input Sizes */
.supaks-form-control.full-width {
    width: 100%;
    max-width: 350px;
}

.supaks-form-control.medium {
    width: 180px;
}

.supaks-form-control.small {
    width: 80px;
}

.supaks-form-control.zip-code {
    width: 100px;
}

/* Fixed Select Dropdown Styling - Remove Double Carets */
select.supaks-form-control {
    min-width: 120px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px 12px;
    padding-right: 28px;
}

/* Firefox-specific dropdown fix */
select.supaks-form-control::-moz-focus-inner {
    border: 0;
}

select.supaks-form-control:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #000;
}

textarea.supaks-form-control {
    width: 100%;
    min-width: 300px;
    min-height: 100px;
    resize: vertical;
    padding: 10px 12px;
}

.supaks-with-color select {
    min-width: 160px;
}

/* Color Picker Styling */
.supaks-color-input {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #c8c8c8!important;
    max-width: 100px;
    font-size: 13px;
}

.supaks-color-display {
    width: 200px;
    cursor: pointer;
}

.supaks-color-btn {
    padding: 8px 12px!important;
    background: #3498db!important;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px!important;
    white-space: nowrap;
}

.supaks-color-btn:hover {
    background: #2980b9;
}

/* Modal Styling */
.supaks-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.supaks-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    position: relative;
}

.supaks-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
}

.supaks-modal-close:hover {
    color: #000;
}

/* Color Grid */
.supaks-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin: 20px 0;
}

.supaks-color-option {
    width: 80px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.supaks-color-option:hover {
    transform: scale(1.05);
    border-color: #3498db;
}

/* CAPTCHA Styling */
.supaks-captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.supaks-captcha-image {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.supaks-captcha-refresh {
    padding: 6px 10px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.supaks-captcha-refresh:hover {
    background: #5a6268;
}

/* Inline Groups - Updated for labels above fields */
.supaks-inline-group {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

/* Labels above fields for dynamic sections */
.supaks-inline-group > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.supaks-inline-group > div label {
    background: none !important;
    border: none !important;
    padding: 0 0 4px 0 !important;
    margin: 0 !important;
    font-weight: 500;
    font-size: 13px;
    color: #495057;
    min-width: auto !important;
    flex: none !important;
    align-self: flex-start;
}

.supaks-inline-group > div select,
.supaks-inline-group > div input {
    margin: 0 !important;
    padding: 8px 10px !important;
}

/* Regular inline group labels (not in divs) - keep old behavior */
.supaks-inline-group > label {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    font-weight: normal;
    font-size: 13px;
    flex: none;
}

.supaks-inline-group > select,
.supaks-inline-group > input {
    margin: 0;
}

/* Ensure buttons align properly */
.supaks-inline-group > button {
    align-self: flex-end;
    margin-left: auto;
}

/* Dynamic Sections (Doors, Windows, etc.) - Properly sized fields */
.supaks-dynamic-section {
    width: 100%;
}

.supaks-dynamic-row {
    margin-bottom: 0;
    border-bottom: 1px solid #f1f3f4;
}

.supaks-dynamic-row:last-child {
    border-bottom: none;
}

/* Better layout for dynamic sections - fields sized appropriately */
.supaks-dynamic-row .supaks-form-group {
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.supaks-dynamic-row .supaks-form-group label {
    flex: 0 0 auto;
    min-width: 80px;
    padding: 8px 10px;
    font-size: 13px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    font-weight: 500;
    white-space: nowrap;
    margin: 0;
}

/* Appropriately sized form controls based on content - WITH PROPER PADDING */
.supaks-dynamic-row .supaks-form-group select,
.supaks-dynamic-row .supaks-form-group input {
    padding: 8px 10px;
    font-size: 13px;
    margin: 0;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.supaks-dynamic-row .supaks-form-group select:focus,
.supaks-dynamic-row .supaks-form-group input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Specific widths for different field types */
.supaks-dynamic-row select[name*="qty"],
.supaks-dynamic-row select[name*="opening_qty"] {
    width: 70px; /* Single/double digit quantities */
}

.supaks-dynamic-row select[name*="inc"],
.supaks-dynamic-row select[name*="Include"] {
    width: 90px; /* Yes/No dropdowns */
}

.supaks-dynamic-row select[name*="size"],
.supaks-dynamic-row select[name*="type"],
.supaks-dynamic-row select[name*="lock"] {
    width: 170px; /* Descriptive dropdowns */
}

.supaks-dynamic-row select[name*="wall"] {
    width: 110px; /* Wall locations */
}

.supaks-dynamic-row input[name*="width"],
.supaks-dynamic-row input[name*="height"] {
    width: 90px; /* Dimension inputs */
}

/* Select dropdown styling - keep single caret */
.supaks-dynamic-row select.supaks-form-control,
.supaks-dynamic-row select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px 12px;
    padding-right: 28px;
    cursor: pointer;
}

/* Remove button styling */
.supaks-remove-row {
    padding: 8px 16px!important;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: 90px;
}

.supaks-remove-row:hover {
    background: #c82333;
}

.supaks-component-grid .supaks-remove-row {
    margin-top: 22px;
}

/* Add Row Button - Fixed width WITHOUT flex conflict */
.supaks-add-row-btn {
    padding: 8px 16px!important;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: 90px;
}

/* Make the form group position relative for absolute positioning */
.supaks-dynamic-row .supaks-form-group {
    position: relative;
    padding-right: 150px; /* Make room for the button */
}

.supaks-add-row-btn:hover {
    background-color: #20903c;
    transform: translateY(-1px);
}

/* Single field sections need padding */
.supaks-form-group.supaks-col-full {
    padding: 5px 20px;
}

.supaks-form-group.supaks-col-full label {
    padding: 0 0 8px 0;
    background: none;
    border: none;
    font-weight: 500;
}

/* Form Actions */
.supaks-form-actions {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin-top: 0;
}

.supaks-submit-btn {
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.supaks-submit-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.supaks-submit-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.supaks-loading {
    margin-top: 16px;
    color: #6c757d;
    font-style: italic;
    font-size: 14px;
}

/* Form Messages */
.supaks-form-messages {
    margin-bottom: 24px;
    padding: 16px 20px;
    border-radius: 6px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.supaks-form-messages.success {
    background: #d1f2eb;
    color: #0e6b47;
    border-left: 4px solid #27ae60;
}

.supaks-form-messages.error {
    background: #fadbd8;
    color: #b03a2e;
    border-left: 4px solid #e74c3c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .supaks-quote-form-container {
        padding: 16px;
        margin: 16px;
        border-radius: 6px;
        max-width: calc(100vw - 32px);
    }
    
    .supaks-form-title {
        font-size: 24px;
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .supaks-form-group {
        flex-direction: column;
        min-height: auto;
    }
    
    .supaks-form-group label {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding: 12px 16px 8px 16px;
        font-size: 13px;
        background: #fff;
    }
    
    .supaks-form-group > :not(label) {
        padding: 8px 16px 16px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .supaks-address-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .supaks-address-row .supaks-form-control {
        width: 100%;
        max-width: none;
        flex: none;
    }
    
    .supaks-inline-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .supaks-inline-group > div {
        align-items: stretch;
    }
    
    .supaks-inline-group > div select,
    .supaks-inline-group > div input {
        width: 100%;
        max-width: none;
    }
    
    .supaks-inline-group > select,
    .supaks-inline-group > input {
        width: 100%;
        max-width: none;
    }
    
    .supaks-color-input {
        flex-direction: column;
        align-items: stretch;
        max-width: none;
    }
    
    .supaks-color-display {
        width: 100%;
    }
    
    .supaks-dynamic-row .supaks-form-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 16px;
        position: static; /* Reset positioning on mobile */
        padding-right: 16px; /* Reset right padding */
    }
    
    .supaks-dynamic-row .supaks-form-group label {
        min-width: auto;
        padding: 8px 10px;
        margin-bottom: 4px;
    }
    
    /* On mobile, keep reasonable widths but allow full width */
    .supaks-dynamic-row .supaks-form-group select,
    .supaks-dynamic-row .supaks-form-group input {
        margin: 0 0 8px 0;
        padding: 8px 10px; /* Maintain proper padding */
        box-sizing: border-box;
    }
    
    .supaks-dynamic-row select[name*="qty"],
    .supaks-dynamic-row select[name*="opening_qty"] {
        width: 100px; /* Slightly wider on mobile */
        flex: none;
    }
    
    .supaks-dynamic-row select[name*="inc"],
    .supaks-dynamic-row select[name*="Include"] {
        width: 120px;
        flex: none;
    }
    
    .supaks-dynamic-row select[name*="size"],
    .supaks-dynamic-row select[name*="type"],
    .supaks-dynamic-row select[name*="lock"] {
        width: 100%; /* Full width for descriptive dropdowns on mobile */
        max-width: 250px;
        flex: none;
    }
    
    .supaks-dynamic-row select[name*="wall"] {
        width: 140px;
        flex: none;
    }
    
    .supaks-dynamic-row input[name*="width"],
    .supaks-dynamic-row input[name*="height"] {
        width: 100px;
        flex: none;
    }
    
    .supaks-add-row-btn {
        position: static; /* Reset absolute positioning */
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
        max-width: 200px;
        align-self: stretch;
    }
    
    .supaks-remove-row {
        margin-left: 0;
        margin-top: 8px;
        width: 100px;
    }
    
    .supaks-modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 80vh;
    }
    
    .supaks-color-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .supaks-color-option {
        width: 60px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .supaks-quote-form-container {
        padding: 12px;
        margin: 12px;
    }
    
    .supaks-form-title {
        font-size: 20px;
        padding: 12px;
    }
    
    .supaks-fieldset legend {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .supaks-form-group label {
        padding: 10px 12px 6px 12px;
        font-size: 12px;
    }
    
    .supaks-form-group > :not(label) {
        padding: 6px 12px 12px 12px;
    }
    
    .supaks-form-control {
        font-size: 13px;
        padding: 6px 8px;
    }
    
    .supaks-submit-btn {
        font-size: 13px;
        padding: 10px 20px;
        min-width: 150px;
    }
}

/* Print Styles */
@media print {
    .supaks-quote-form-container {
        box-shadow: none;
        border: 1px solid #ccc;
        background: #fff;
    }
    
    .supaks-color-btn,
    .supaks-add-btn,
    .supaks-remove-btn,
    .supaks-submit-btn {
        display: none;
    }
    
    .supaks-form-group {
        border-bottom: 1px solid #ddd;
    }
    
    .supaks-fieldset legend {
        background: #f0f0f0;
        color: #333;
        -webkit-print-color-adjust: exact;
    }
}

/* Component Grid System CSS */

/* Component Headers - 4 Column Grid */
.supaks-component-headers {
    display: grid;
    grid-template-columns: 80px 200px 1fr 100px;
    gap: 15px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    align-items: center;
}

.supaks-header-qty,
.supaks-header-type,
.supaks-header-options,
.supaks-header-action {
    text-align: left;
}

.supaks-header-qty {
    text-align: center;
}

/* Component Sections */
.supaks-component-section {
    margin-bottom: 25px;
    overflow: hidden;
}

.supaks-component-title {
    background: #007cba;
    color: white;
    padding: 8px 16px;
    margin: 0;
}

.supaks-component-title h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

/* Component Grid - 4 Column Layout */
.supaks-component-grid {
    display: grid;
    grid-template-columns: 80px 200px 1fr 100px;
    gap: 15px;
    align-items: start;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    background: #fff;
}

.supaks-component-section .supaks-dynamic-row:last-child .supaks-component-grid {
    border-bottom: none;
}

/* Column 1: Quantity */
.supaks-qty-column {
   display: flex;
   flex-direction: column;
   gap: 4px;
}

.supaks-qty-column label {
   font-size: 11px;
   color: #666;
   margin: 0;
   padding: 0;
   background: none;
   border: none;
   font-weight: normal;
   white-space: nowrap;
}

.supaks-qty-column input {
    width: 60px;
    text-align: center;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin: 0;
}

/* Column 2: Type */
.supaks-type-column {
   display: flex;
   flex-direction: column;
   gap: 4px;
   align-items: flex-start;
}

.supaks-type-column label {
   font-size: 11px;
   color: #666;
   margin: 0;
   padding: 0;
   background: none;
   border: none;
   font-weight: normal;
   white-space: nowrap;
}

.supaks-type-column select {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin: 0;
}

/* Column 3: Options Grid */
.supaks-options-column {
    display: flex;
    align-items: start;
}

.supaks-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px 15px;
    width: 100%;
    align-items: start;
}

/* Individual Option Items */
.supaks-option-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.supaks-option-item label {
    font-size: 11px;
    color: #666;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.supaks-option-item input,
.supaks-option-item select {
    width: 100%;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin: 0;
    box-sizing: border-box;
}

/* Color Option Special Styling */
.supaks-color-item {
    min-width: 140px;
}

.supaks-color-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.supaks-color-controls input {
    flex: 1;
    min-width: 60px;
}

.supaks-color-picker-btn {
    padding: 8px 12px !important;
    font-size: 11px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.supaks-color-picker-btn:hover {
    background: #005a87;
}

/* Column 4: Action */
.supaks-action-column {
    display: flex;
    align-items: center;
    justify-content: center;
}

.supaks-action-column .supaks-add-row-btn {
    margin-top: 22px;
    padding: 6px 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    width: 80px;
}

.supaks-action-column .supaks-add-row-btn:hover {
    background: #20903c;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .supaks-options-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px 12px;
    }
}

@media (max-width: 900px) {
    .supaks-component-headers,
    .supaks-component-grid {
        grid-template-columns: 60px 150px 1fr 80px;
        gap: 10px;
    }
    
    .supaks-options-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 6px 8px;
    }
    
    .supaks-color-item {
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .supaks-component-headers,
    .supaks-component-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .supaks-qty-column,
    .supaks-type-column,
    .supaks-action-column {
        justify-content: flex-start;
    }
    
    .supaks-options-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .supaks-action-column .supaks-add-row-btn {
        width: 100%;
        max-width: 120px;
    }
}

/* Success Overlay */
.supaks-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.supaks-success-modal {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

.supaks-success-icon {
    color: #28a745;
    margin-bottom: 20px;
}

.supaks-success-icon svg {
    width: 64px;
    height: 64px;
}

.supaks-success-title {
    color: #28a745;
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 15px 0;
}

.supaks-success-message {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 30px 0;
}

.supaks-success-actions {
    margin-top: 20px;
}

.supaks-close-overlay-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.supaks-close-overlay-btn:hover {
    background: #005a87;
}

/* Global Error Message (bottom right) */
.supaks-global-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    min-width: 300px;
    z-index: 10000;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInFromRight 0.3s ease-out;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.supaks-message-content {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    gap: 10px;
}

.supaks-message-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.supaks-message-close {
    background: none;
    border: none;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.supaks-message-close:hover {
    opacity: 1;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.supaks-success-overlay.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.supaks-global-message.fade-out {
    animation: fadeOutRight 0.3s ease-out forwards;
}

@keyframes fadeOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .supaks-success-modal {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .supaks-success-title {
        font-size: 20px;
    }
    
    .supaks-success-message {
        font-size: 14px;
    }
    
    .supaks-global-message {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
    }
}