/* ==========================================================================
   Form Validation Styles
   ========================================================================== */

.lh-field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

.lh-field-valid {
    border-color: #28a745 !important;
}

.lh-field-error-msg {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    animation: lh-error-slide 0.3s ease;
}

@keyframes lh-error-slide {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Shake animation */
@keyframes lh-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.lh-shake {
    animation: lh-shake 0.4s ease;
}

/* Input styling enhancements */
.lh-input,
.lh-textarea,
.lh-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dde0e5;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1d23;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lh-input:focus,
.lh-textarea:focus,
.lh-select:focus {
    outline: none;
    border-color: var(--lh-primary, #8B4513);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.12);
}

/* Toggle switch */
.lh-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.lh-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.lh-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 22px;
    transition: background 0.3s;
}

.lh-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.lh-toggle input:checked + .lh-toggle-slider {
    background: var(--lh-primary, #8B4513);
}

.lh-toggle input:checked + .lh-toggle-slider::before {
    transform: translateX(18px);
}

/* Modal styles */
.lh-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lh-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.lh-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: lh-modal-in 0.25s ease;
}

@keyframes lh-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.lh-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f1f3;
}

.lh-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.lh-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #8a8f98;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.lh-modal-body {
    padding: 24px;
}

.lh-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f1f3;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Empty state */
.lh-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8a8f98;
}

.lh-empty-state h3 {
    color: #4a4f5a;
    margin: 16px 0 8px;
}

/* Badge */
.lh-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.lh-badge--recurring {
    background: rgba(139, 69, 19, 0.1);
    color: #8B4513;
}

/* Autocomplete dropdown */
.lh-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dde0e5;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
}

.lh-autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f5f5f7;
    transition: background 0.15s;
}

.lh-autocomplete-item:hover {
    background: #f5f5f7;
}

.lh-autocomplete-item--oos {
    opacity: 0.5;
    cursor: not-allowed;
}

.lh-autocomplete-item:last-child {
    border-bottom: none;
}

/* SKU cell relative for autocomplete */
.lh-sku-cell {
    position: relative;
}

/* Quick order specific */
.lh-quick-order-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.lh-quick-order-info {
    margin-bottom: 16px;
    color: #6c757d;
    font-size: 14px;
}

.lh-quick-order-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f1f3;
}

.lh-quick-order-actions-right {
    display: flex;
    gap: 8px;
}

/* Templates grid */
.lh-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.lh-template-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.lh-template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.lh-template-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.lh-template-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.lh-template-card-body {
    display: flex;
    gap: 24px;
    margin-bottom: 12px;
}

.lh-template-stat {
    display: flex;
    flex-direction: column;
}

.lh-template-stat-value {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    color: #1a1d23;
}

.lh-template-stat-label {
    font-size: 12px;
    color: #8a8f98;
    text-transform: uppercase;
}

.lh-template-card-meta {
    font-size: 12px;
    color: #8a8f98;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lh-template-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f1f3;
}

.lh-template-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.lh-template-toggle small {
    color: #8a8f98;
    font-size: 11px;
}

/* Template list in modal */
.lh-template-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f1f3;
}

.lh-template-list-item:last-child {
    border-bottom: none;
}

/* Button variants */
.btn--large {
    padding: 12px 24px;
    font-size: 15px;
}

.btn--danger {
    background: #dc3545;
    color: #fff;
    border: none;
}

.btn--danger:hover {
    background: #c82333;
}
