/* Custom styles for the discount rule builder */

/* Step transitions */
.step.active {
    border-color: #008060;
    box-shadow: 0 4px 16px rgba(0, 128, 96, 0.15);
}

/* Card hover effects */
.parent-category:hover,
.discount-type:hover,
.audience-type:hover,
.schedule-type:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Template card animations */
.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Logic toggle active states */
.logic-btn.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #008060;
}

/* Condition chip animations */
.condition-chip {
    animation: slideIn 0.3s ease-out;
}

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

/* Test cart animations */
.cart-item {
    animation: fadeIn 0.3s ease-out;
}

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

/* Modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success animations */
.success-flash {
    animation: flash 0.5s ease-out;
}

@keyframes flash {
    0% { background-color: rgba(16, 185, 129, 0.2); }
    100% { background-color: transparent; }
}

/* Focus states for accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #008060;
    outline-offset: 2px;
}

/* Pill Button Styles */
.pill-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.pill-button:hover {
    border-color: #008060;
    background: #f0fdf4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 128, 96, 0.15);
}

.pill-button.selected {
    background: #008060;
    border-color: #008060;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 128, 96, 0.3);
}

.pill-button.selected:hover {
    background: #006b4a;
    transform: translateY(-1px);
}

.pill-advanced {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.pill-advanced:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    border-color: #5a67d8;
    transform: translateY(-1px);
}

.pill-icon {
    font-size: 16px;
    line-height: 1;
}

.pill-text {
    font-weight: 500;
    white-space: nowrap;
}

/* Add Buttons */
.add-button {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: white;
    border: 2px solid #008060;
    border-radius: 8px;
    color: #008060;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.add-button:hover {
    background: #008060;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 128, 96, 0.2);
}

/* Exception Pills */
.exception-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #f97316;
    border-radius: 16px;
    font-size: 12px;
    color: #ea580c;
    cursor: pointer;
    transition: all 0.2s ease;
}

.exception-pill:hover {
    background: #fed7aa;
    border-color: #ea580c;
}

/* Product Selection Interface */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.product-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-item:hover {
    border-color: #008060;
    box-shadow: 0 2px 8px rgba(0, 128, 96, 0.1);
}

.product-item.selected {
    border-color: #008060;
    background: #f0fdf4;
}

/* Selected Products Display */
.selected-products-filled {
    background: white !important;
    border: 2px solid #d1d5db !important;
    border-style: solid !important;
}

.product-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #dbeafe;
    color: #1e40af;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    margin: 4px;
}

.product-chip button {
    background: none;
    border: none;
    color: #1e40af;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
}

.product-chip button:hover {
    color: #1e3a8a;
}

/* Compact Quick Buttons */
.compact-quick-btn {
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
}

.compact-quick-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Advanced Discount Buttons */
.advanced-discount-btn {
    padding: 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.advanced-discount-btn:hover {
    border-color: #008060;
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 128, 96, 0.1);
}

/* Discount Configuration Table */
.discount-config-table {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.discount-config-table th {
    background: #f9fafb;
    padding: 12px 16px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.discount-config-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.discount-config-table tr:last-child td {
    border-bottom: none;
}

/* Discount Type Selectors */
.discount-type-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    width: 100%;
}

.discount-value-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    width: 80px;
    text-align: right;
}

/* Customer Type Buttons */
.customer-type-btn {
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: white;
}

.customer-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.customer-type-btn.selected {
    border-color: #008060 !important;
    background: #f0fdf4;
    box-shadow: 0 4px 12px rgba(0, 128, 96, 0.2);
}

/* Condition Category Buttons */
.condition-category {
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: white;
}

.condition-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Tag Buttons */
.tag-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-btn:hover {
    background: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

/* Custom Rule Pills (Compact) */
.custom-rule-pill {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 1px solid #f97316;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #ea580c;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-rule-pill:hover {
    background: #f97316;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

/* Customer Option Items */
.customer-option-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.customer-option-item:hover {
    border-color: #008060;
    background: #f0fdf4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 128, 96, 0.1);
}

/* Condition Pills */
.condition-pill {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 1px solid #6b7280;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.condition-pill:hover {
    background: #008060;
    color: white;
    border-color: #008060;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 128, 96, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .step-header {
        padding: 16px;
    }
    
    .step-header h2 {
        font-size: 1.1rem;
    }
    
    .grid.grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid.grid-cols-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid.grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .flex.gap-4 {
        flex-direction: column;
    }
    
    .condition-chips {
        flex-direction: column;
        align-items: stretch;
    }
}