/* Modern 2026 Design - Clean & User-Friendly */
:root {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-soft: #dbeafe;
    --success: #22c55e;
    --success-soft: #dcfce7;
    --danger: #ef4444;
    --danger-soft: #fee2e2;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --border-radius-lg: 1.5rem;
    --border-radius-md: 1rem;
    --border-radius-sm: 0.75rem;
    --border-radius-xs: 0.5rem;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease;
}

.karma-form-hm-shortcode-wrapper {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
}

.karma-form-hm-shortcode-wrapper form#karma-form-identify {
    width: 100%;
}

.karma-form-hm-shortcode-wrapper .karma-form-hm-shortcode-inner-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.karma-form-hm-shortcode-wrapper .field-container {
    transition: var(--transition);
}

.karma-form-hm-shortcode-wrapper .field-container .field-wrapper {
    display: flex;
    flex-direction: column;
}

.karma-form-hm-shortcode-wrapper .field-container .field-wrapper label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
    letter-spacing: 0.025em;
}

.karma-form-hm-shortcode-wrapper .field-container .field-wrapper input,
.karma-form-hm-shortcode-wrapper .field-container .field-wrapper select,
.karma-form-hm-shortcode-wrapper .field-container .field-wrapper textarea {
    padding: 0.625rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
}

.karma-form-hm-shortcode-wrapper .field-container .field-wrapper input:focus,
.karma-form-hm-shortcode-wrapper .field-container .field-wrapper select:focus,
.karma-form-hm-shortcode-wrapper .field-container .field-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.karma-form-hm-shortcode-wrapper .field-container .field-wrapper input:read-only,
.karma-form-hm-shortcode-wrapper .field-container .field-wrapper select:read-only {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-600);
    cursor: not-allowed;
}

/* Repeater section */
#form-hm-repeater-container {
    grid-column: span 2;
}

.karma-hm-form-repeater {
    background-color: var(--gray-50);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
}

.karma-hm-form-repeater-field {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
    position: relative;
}

.karma-hm-form-repeater-field:hover {
    border-color: var(--primary-light);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.1);
}

.karma-hm-form-repeater-field .product_serial {
    position: relative;
}

.karma-hm-form-repeater-field .product_serial .qrcode-mobile-screen-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.karma-hm-form-repeater-field .product_serial .qrcode-mobile-screen-icon:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.karma-hm-form-repeater-field .product_serial input {
    padding-left: 2.5rem;
}

.remove-product-code-karma-hm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: var(--gray-200);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ef4444' viewBox='0 0 24 24' width='20' height='20'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 1.2rem;
}

.remove-product-code-karma-hm:hover {
    background-color: var(--danger);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24' width='20' height='20'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E");
}

.add-new-product-code-karma-hm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-soft);
    color: var(--primary);
    font-weight: 500;
    border-radius: var(--border-radius-xs);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    margin-top: 0.5rem;
}

.add-new-product-code-karma-hm::before {
    content: "+";
    font-size: 1.25rem;
    line-height: 1;
}

.add-new-product-code-karma-hm:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

/* Scanner modal */
.product-serial-scanner-holder {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 1.5rem;
    z-index: 1000;
    border: 1px solid var(--gray-200);
}

.product-serial-scanner-holder video {
    width: 100%;
    border-radius: var(--border-radius-sm);
}

.product-serial-scanner-holder .close-scanner {
    position: absolute;
    top: -1rem;
    right: -1rem;
    background-color: var(--danger);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    box-shadow: var(--box-shadow-lg);
    transition: var(--transition);
}

.product-serial-scanner-holder .close-scanner:hover {
    transform: scale(1.1);
    background-color: #dc2626;
}

/* Submit button */
.karma-form-hm-submit-area {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.karma-form-hm-submit-button {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background-color: var(--primary);
    border: none;
    border-radius: var(--border-radius-xs);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.karma-form-hm-submit-button:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.karma-form-hm-submit-button:active {
    transform: translateY(0);
}

.karma-form-hm-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* After submit messages */
.after-submit {
    margin-top: 2rem;
    text-align: center;
}

.after-submit p {
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
}

.after-submit p.progress {
    background-color: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.after-submit p.error {
    background-color: var(--danger-soft);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.after-submit p.success {
    background-color: var(--success-soft);
    color: var(--success);
    border: 1px solid #bbf7d0;
}

/* Sorooshan results */
#sorooshan-results {
    background-color: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: right;
}

#sorooshan-results>div {
    margin-bottom: 1rem;
}

/* Hidden fields */
.field-should-hide {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .karma-form-hm-shortcode-wrapper {
        padding: 1rem;
    }

    .karma-form-hm-shortcode-wrapper .karma-form-hm-shortcode-inner-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #form-hm-repeater-container {
        grid-column: span 1;
    }

    .karma-hm-form-repeater-field {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .karma-hm-form-repeater-field .remove-product-code-karma-hm {
        justify-self: end;
    }

    .add-new-product-code-karma-hm {
        width: 100%;
        justify-content: center;
    }

    .product-serial-scanner-holder {
        width: 95%;
        padding: 1rem;
    }

    .product-serial-scanner-holder .close-scanner {
        top: -0.75rem;
        right: -0.75rem;
        width: 2rem;
        height: 2rem;
    }
}

/* Table list frontend */
.rtz-karma-hm-table-list-frontend-container {
    max-width: 100%;
    overflow-x: auto;
    margin: 2rem 0;
}

.karma-hm-table-list-frontend {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.karma-hm-table-list-frontend thead tr {
    background-color: var(--primary-soft);
}

.karma-hm-table-list-frontend th,
.karma-hm-table-list-frontend td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--gray-200);
}

.karma-hm-table-list-frontend tbody tr:last-child td {
    border-bottom: none;
}

.karma-hm-table-list-frontend tbody tr:hover {
    background-color: var(--gray-50);
}

/* Price calculation */
.calculate-price-section {
    background-color: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    margin: 2rem 0;
}

.calculate-price-section .calculate-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--gray-300);
}

.calculate-price-section .calculate-total:last-child {
    border-bottom: none;
}

.calculate-price-section .calculate-total span:first-child {
    font-weight: 500;
    color: var(--gray-700);
}

.calculate-price-section .calculate-total span:last-child {
    font-weight: 700;
    color: var(--primary);
    background-color: var(--primary-soft);
    padding: 0.25rem 1rem;
    border-radius: 9999px;
}

/* User account fields */
.karma-form-user-field input {
    background-color: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
    color: var(--gray-600) !important;
    cursor: not-allowed;
}