/**
 * Modern Form Styles for Erin's Seed Catalog
 */

/* Enable smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* For JavaScript-based smooth scrolling (more compatible) */
html.smooth-scroll {
    scroll-behavior: auto; /* Let JS handle it */
}

/* Base Form Styles */
.esc-modern-form {
    /* Use !important to override theme styles */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    max-width: 1400px;
    margin: 0 auto;
    color: #2d3748;
    padding: 30px;
    background-color: #f7fafc;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.03);
    scroll-margin-top: 80px; /* Adds margin when scrolling to this element */
}

/* Apply consistent font to all elements within the form */
.esc-modern-form *,
.esc-modern-form h1,
.esc-modern-form h2,
.esc-modern-form h3,
.esc-modern-form h4,
.esc-modern-form p,
.esc-modern-form input,
.esc-modern-form textarea,
.esc-modern-form select,
.esc-modern-form button,
.esc-modern-form label,
.esc-modern-form ::placeholder,
.esc-form-card,
.esc-form-card *,
.esc-card-header,
.esc-card-header *,
.esc-card-content,
.esc-card-content *,
.esc-ai-card,
.esc-ai-card * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

/* Wider form for larger screens */
@media (min-width: 1600px) {
    .esc-modern-form {
        max-width: 1800px;
    }
}

/* Ultra-wide screens */
@media (min-width: 2560px) {
    .esc-modern-form {
        max-width: 2200px;
    }
}

/* Add a subtle gradient background to the entire form */
body.wp-admin #wpbody-content {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    min-height: 100vh;
    padding-top: 20px;
}

/* Desktop Optimizations */
@media screen and (min-width: 1200px) {
    .esc-modern-form {
        padding: 40px 50px;
    }

    .esc-card-content {
        padding: 40px 40px;
    }

    .esc-form-row {
        margin: 0 -20px 40px;
    }

    .esc-form-field {
        flex: 1 1 calc(50% - 40px);
        margin: 0 20px 25px;
    }

    .esc-form-field.esc-full-width {
        flex: 1 1 calc(100% - 40px);
    }

    .esc-button-large {
        max-width: 400px;
        margin: 0 auto;
    }
}

/* Large Desktop Optimizations */
@media screen and (min-width: 1600px) {
    .esc-modern-form {
        padding: 50px 60px;
    }

    .esc-card-content {
        padding: 50px 50px;
    }

    .esc-form-row {
        margin: 0 -25px 50px;
    }

    .esc-form-field {
        flex: 1 1 calc(50% - 50px);
        margin: 0 25px 30px;
    }

    .esc-form-field.esc-full-width {
        flex: 1 1 calc(100% - 50px);
    }

    .esc-button-large {
        max-width: 500px;
        font-size: 18px;
        padding: 18px 30px;
    }

    /* Increase font sizes for better readability on large screens */
    .esc-modern-form h2 {
        font-size: 32px;
    }

    .esc-modern-form h3 {
        font-size: 24px;
    }

    .esc-modern-form input,
    .esc-modern-form textarea,
    .esc-modern-form select,
    .esc-modern-form label {
        font-size: 18px;
    }
}

/* Ultra-wide Desktop Optimizations */
@media screen and (min-width: 2560px) {
    .esc-modern-form {
        padding: 60px 80px;
    }

    .esc-card-content {
        padding: 60px 60px;
    }

    .esc-form-row {
        margin: 0 -30px 60px;
    }

    .esc-form-field {
        flex: 1 1 calc(50% - 60px);
        margin: 0 30px 40px;
    }

    .esc-form-field.esc-full-width {
        flex: 1 1 calc(100% - 60px);
    }

    /* Even larger elements for 4K displays */
    .esc-modern-form h2 {
        font-size: 36px;
        margin-bottom: 36px;
    }

    .esc-modern-form h3 {
        font-size: 28px;
    }

    .esc-modern-form input,
    .esc-modern-form textarea,
    .esc-modern-form select {
        font-size: 20px;
        padding: 18px 24px;
    }

    .esc-modern-form label {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .esc-button-large {
        max-width: 600px;
        font-size: 22px;
        padding: 22px 36px;
    }
}

/* Animations and Transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.esc-form-card {
    animation: fadeIn 0.5s ease-out;
}

.esc-form-card:nth-child(2) {
    animation-delay: 0.1s;
}

.esc-form-card:nth-child(3) {
    animation-delay: 0.2s;
}

.esc-form-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* Smooth transitions for all interactive elements */
.esc-modern-form input,
.esc-modern-form textarea,
.esc-modern-form select,
.esc-modern-form button,
.esc-modern-form a,
.esc-form-card,
.esc-ai-status-badge,
.esc-confidence-indicator,
.esc-ai-success,
.esc-ai-error,
.esc-ai-loading,
.esc-ai-result-summary {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.esc-modern-form h2 {
    font-size: 28px;
    margin-bottom: 24px;
    color: #2c3e50;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    line-height: 1.3;
}

.esc-modern-form h3 {
    font-size: 20px;
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    line-height: 1.3;
}

.esc-modern-form h4 {
    font-size: 16px;
    margin: 0 0 12px;
    color: #2c3e50;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    line-height: 1.3;
}

/* Card Layout */
.esc-modern-form .esc-form-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    margin-bottom: 40px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
}

.esc-modern-form .esc-form-card:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    transform: translateY(-4px);
    border-color: rgba(203, 213, 224, 0.9);
}

.esc-modern-form .esc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    background-color: #ffffff;
    border-bottom: 1px solid #edf2f7;
    position: relative;
}

.esc-card-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.esc-modern-form .esc-card-content {
    padding: 35px 30px;
    position: relative;
}

.esc-card-description {
    margin-top: 0;
    margin-bottom: 24px;
    color: #666;
    font-size: 16px;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

/* Info text styling */
.esc-info-text {
    background-color: #f0f9ff;
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    color: #2c5282;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

/* Description text styling */
.description,
p.description {
    font-size: 13px !important;
    color: #666 !important;
    margin-top: 5px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    line-height: 1.5 !important;
}

/* Confidence tooltip styling */
.esc-confidence-tooltip {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
}

/* AI Card Styling */
.esc-ai-card {
    border-left: 4px solid #3498db;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    margin-bottom: 40px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
}

.esc-ai-card .esc-card-header {
    background-color: #ebf5fb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid #edf2f7;
    position: relative;
}

.esc-ai-card .esc-card-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

/* Add a subtle gradient background to the AI card */
.esc-ai-card .esc-card-content {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    padding: 35px 30px;
    position: relative;
}

/* Add a subtle divider between input fields and button */
.esc-ai-card .esc-button-large {
    position: relative;
}

.esc-ai-card .esc-button-large:before {
    content: '';
    position: absolute;
    top: -20px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(to right, rgba(226, 232, 240, 0), rgba(226, 232, 240, 0.7), rgba(226, 232, 240, 0));
}

/* AI Card on larger screens */
@media (min-width: 1600px) {
    .esc-ai-card .esc-card-content {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 1200px;
        margin: 0 auto;
    }

    .esc-ai-card .esc-card-description {
        width: 100%;
        text-align: center;
        font-size: 18px;
        margin-bottom: 30px;
    }

    .esc-ai-card .esc-floating-label {
        width: 45%;
        margin: 0 2.5% 30px;
    }

    .esc-ai-card .esc-variety-field-container {
        width: 45%;
        margin: 0 2.5% 30px;
    }

    /* Improve input fields on large screens */
    .esc-ai-card input[type="text"] {
        height: 60px;
        font-size: 18px;
        border-radius: 12px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    }

    /* Center the button and make it not too wide */
    .esc-ai-card .esc-button-large {
        max-width: 500px;
        margin: 30px auto;
    }

    /* Make the AI status container more centered */
    .esc-ai-card .esc-ai-status-container {
        max-width: 800px;
        margin: 20px auto;
        text-align: center;
    }

    /* Center the manual toggle link */
    .esc-ai-card .esc-manual-toggle {
        text-align: center;
        margin-top: 20px;
    }
}

@media (min-width: 2560px) {
    .esc-ai-card .esc-card-content {
        max-width: 1600px;
    }

    .esc-ai-card .esc-card-description {
        font-size: 22px;
        margin-bottom: 40px;
    }

    .esc-ai-card .esc-floating-label,
    .esc-ai-card .esc-variety-field-container {
        width: 40%;
        margin: 0 5% 40px;
    }

    /* Even larger input fields for 4K displays */
    .esc-ai-card input[type="text"] {
        height: 70px;
        font-size: 20px;
        border-radius: 16px;
        box-shadow: 0 6px 12px rgba(0,0,0,0.05);
        padding: 0 24px;
    }

    /* Improve label positioning for larger inputs */
    .esc-ai-card .esc-floating-label label {
        font-size: 18px;
        top: 22px;
    }

    .esc-ai-card .esc-floating-label input:focus + label,
    .esc-ai-card .esc-floating-label input.has-value + label {
        top: -10px;
        font-size: 16px;
        padding: 0 8px;
    }

    /* Larger button but still contained */
    .esc-ai-card .esc-button-large {
        max-width: 600px;
    }

    /* Wider status container for ultra-wide screens */
    .esc-ai-card .esc-ai-status-container {
        max-width: 1000px;
    }
}

/* Form Layout */
.esc-modern-form .esc-form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px 35px;
    position: relative;
    align-items: flex-start;
}

.esc-modern-form .esc-form-row:last-child {
    margin-bottom: 10px;
}

.esc-modern-form .esc-form-field {
    flex: 1 1 calc(50% - 30px);
    margin: 0 15px 20px;
    min-width: 250px;
    position: relative;
}

.esc-modern-form .esc-form-field.esc-full-width {
    flex: 1 1 calc(100% - 30px);
}

/* Add a subtle separator between form rows */
.esc-modern-form .esc-form-row:not(:last-child):after {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(to right, rgba(226, 232, 240, 0), rgba(226, 232, 240, 0.7), rgba(226, 232, 240, 0));
    position: absolute;
    bottom: -18px;
    left: 15px;
    right: 15px;
}

/* Input Styling */
.esc-modern-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4a5568;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

.esc-modern-form input[type="text"],
.esc-modern-form input[type="url"],
.esc-modern-form input[type="number"],
.esc-modern-form input[type="date"],
.esc-modern-form input[type="search"],
.esc-modern-form textarea,
.esc-modern-form select,
#esc_seed_name,
#esc_variety_name,
input[id^="esc_seed_name"],
input[id^="esc_variety_name"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background-color: #fff;
    font-size: 16px;
    line-height: 1.5;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    color: #2d3748;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    height: auto !important;
    display: block !important;
}

/* Placeholder styling */
.esc-modern-form input::placeholder,
.esc-modern-form textarea::placeholder,
.esc-modern-form select::placeholder,
#esc_seed_name::placeholder,
#esc_variety_name::placeholder,
input[id^="esc_seed_name"]::placeholder,
input[id^="esc_variety_name"]::placeholder {
    color: #a0aec0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    opacity: 0.8;
}

.esc-modern-form input[type="text"]:hover,
.esc-modern-form input[type="url"]:hover,
.esc-modern-form input[type="number"]:hover,
.esc-modern-form input[type="date"]:hover,
.esc-modern-form textarea:hover,
.esc-modern-form select:hover {
    border-color: #cbd5e0;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.esc-modern-form input[type="text"]:focus,
.esc-modern-form input[type="url"]:focus,
.esc-modern-form input[type="number"]:focus,
.esc-modern-form input[type="date"]:focus,
.esc-modern-form textarea:focus,
.esc-modern-form select:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
    outline: none;
    transform: translateY(-2px);
}

.esc-modern-form textarea {
    min-height: 100px;
    resize: vertical;
}

.esc-modern-form .description {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Floating Labels */
.esc-floating-label {
    position: relative;
    margin-bottom: 24px;
}

/* Improve description text appearance */
.esc-floating-label .description {
    color: #718096;
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.4;
}

@media (min-width: 1600px) {
    .esc-floating-label .description {
        font-size: 14px;
        margin-top: 8px;
    }
}

@media (min-width: 2560px) {
    .esc-floating-label .description {
        font-size: 16px;
        margin-top: 10px;
    }
}

.esc-floating-label input,
.esc-floating-label textarea,
.esc-floating-label select {
    height: 62px;
    padding: 28px 18px 12px;
    font-size: 16px;
    position: relative;
    z-index: 1; /* Ensure input is above the label background but below the label text */
    background-color: #fff;
    color: #2d3748; /* Ensure text is visible */
    transition: all 0.3s ease;
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.esc-floating-label input:hover,
.esc-floating-label textarea:hover,
.esc-floating-label select:hover {
    border-color: #cbd5e0;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.esc-floating-label input:focus,
.esc-floating-label textarea:focus,
.esc-floating-label select:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
    outline: none;
    transform: translateY(-2px);
}

/* Adjust padding for inputs with confidence indicators */
.esc-input-with-confidence input {
    padding-right: 50px; /* Make room for the confidence indicator */
}

.esc-floating-label textarea {
    height: auto;
    min-height: 120px;
    padding-top: 32px;
}

.esc-floating-label label {
    position: absolute;
    top: 20px;
    left: 18px;
    transition: all 0.3s ease;
    pointer-events: none;
    color: #718096;
    margin: 0;
    background-color: transparent;
    z-index: 2; /* Ensure label text is above input */
    font-size: 16px;
    font-weight: 500;
}

/* This is the key fix - ensuring the label moves when input has content */
.esc-floating-label input:focus + label,
.esc-floating-label input:not(:placeholder-shown) + label,
.esc-floating-label input.has-value + label,
.esc-floating-label textarea:focus + label,
.esc-floating-label textarea:not(:placeholder-shown) + label,
.esc-floating-label textarea.has-value + label,
.esc-floating-label select:focus + label,
.esc-floating-label select:not([value=""]):not([value="0"]) + label,
.esc-floating-label select.has-value + label {
    top: 10px;
    font-size: 12px;
    color: #4299e1;
    transform: translateY(-5px); /* Move up slightly more to ensure separation */
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Add a background to the label when it's floating to prevent text overlap */
.esc-floating-label input:focus + label,
.esc-floating-label input:not(:placeholder-shown) + label,
.esc-floating-label input.has-value + label,
.esc-floating-label textarea:focus + label,
.esc-floating-label textarea:not(:placeholder-shown) + label,
.esc-floating-label textarea.has-value + label,
.esc-floating-label select:focus + label,
.esc-floating-label select:not([value=""]):not([value="0"]) + label,
.esc-floating-label select.has-value + label {
    background-color: white;
    padding: 0 4px;
    margin-left: -4px;
}

/* Button Styling */
.esc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
}

.esc-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.esc-button .dashicons {
    margin-right: 10px;
}

.esc-button-primary {
    background-color: #4299e1;
    color: white;
    background-image: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.esc-button-primary:hover {
    background-color: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(66, 153, 225, 0.2), 0 2px 4px rgba(66, 153, 225, 0.1);
}

.esc-button-secondary {
    background-color: #edf2f7;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.esc-button-secondary:hover {
    background-color: #e2e8f0;
    color: #2d3748;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.05);
}

.esc-button-large {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    margin-top: 16px;
    margin-bottom: 16px;
}

/* Larger button for larger screens */
@media (min-width: 1600px) {
    .esc-button-large {
        max-width: 60%;
        margin-left: auto;
        margin-right: auto;
        padding: 18px 24px;
        font-size: 18px;
        margin-top: 30px;
        margin-bottom: 30px;
    }
}

@media (min-width: 2560px) {
    .esc-button-large {
        max-width: 50%;
        padding: 22px 30px;
        font-size: 22px;
        margin-top: 40px;
        margin-bottom: 40px;
    }
}

/* AI Status Container */
.esc-ai-status-container {
    margin: 16px 0;
    padding: 16px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.esc-ai-initial p {
    margin: 0;
    text-align: center;
    color: #4a5568;
}

@media (min-width: 1600px) {
    .esc-ai-status-container {
        margin: 30px auto;
        padding: 25px;
        border-radius: 12px;
        max-width: 800px;
    }

    .esc-ai-initial p {
        font-size: 18px;
    }
}

@media (min-width: 2560px) {
    .esc-ai-status-container {
        margin: 40px auto;
        padding: 30px;
        border-radius: 16px;
        max-width: 1000px;
    }

    .esc-ai-initial p {
        font-size: 20px;
    }
}

.esc-ai-loading {
    display: flex;
    align-items: flex-start;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    background-color: #ebf8ff;
    border: 1px solid #bee3f8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.esc-loading-animation {
    margin-right: 20px;
    flex-shrink: 0;
}

.esc-loading-pulse {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    box-shadow: 0 0 20px rgba(66, 153, 225, 0.5);
    animation: esc-pulse 1.5s infinite ease-in-out;
}

@keyframes esc-pulse {
    0% { transform: scale(0.85); opacity: 0.7; box-shadow: 0 0 0 0 rgba(66, 153, 225, 0.7); }
    50% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 10px rgba(66, 153, 225, 0); }
    100% { transform: scale(0.85); opacity: 0.7; box-shadow: 0 0 0 0 rgba(66, 153, 225, 0); }
}

.esc-loading-stages {
    flex: 1;
}

.esc-loading-stage {
    padding: 10px 0;
    color: #718096;
    opacity: 0.6;
    transition: all 0.3s ease;
    font-size: 15px;
    position: relative;
    padding-left: 28px;
}

.esc-loading-stage:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e0;
    transition: all 0.3s ease;
}

.esc-loading-stage.active {
    color: #4299e1;
    opacity: 1;
    font-weight: 600;
}

.esc-loading-stage.active:before {
    border-color: #4299e1;
    background-color: #ebf8ff;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

/* Success and Error States */
.esc-ai-success, .esc-ai-error {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.esc-ai-success {
    background-color: #f0fff4;
    border: 1px solid #c6f6d5;
}

.esc-ai-error {
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
}

.esc-success-icon, .esc-error-icon {
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.esc-success-icon {
    background-color: #9ae6b4;
    color: #22543d;
}

.esc-error-icon {
    background-color: #feb2b2;
    color: #742a2a;
}

.esc-success-icon .dashicons {
    color: #38a169;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.esc-error-icon .dashicons {
    color: #e53e3e;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.esc-success-message h4, .esc-error-message h4 {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.esc-success-message p, .esc-error-message p {
    margin: 0 0 10px;
    color: #4a5568;
    line-height: 1.5;
}

/* Manual Toggle */
.esc-manual-toggle {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

.esc-manual-toggle a {
    color: #3498db;
    text-decoration: none;
}

.esc-manual-toggle a:hover {
    text-decoration: underline;
}

/* Phase 2: Review & Edit */
.esc-ai-result-summary {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 25px;
    background-color: #ebf8ff;
    border-radius: 12px;
    border: 1px solid #bee3f8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.esc-ai-result-summary:hover {
    box-shadow: 0 6px 16px rgba(66, 153, 225, 0.1);
    transform: translateY(-2px);
}

.esc-ai-result-icon {
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #bee3f8;
    flex-shrink: 0;
}

.esc-ai-result-icon .dashicons {
    color: #3182ce;
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.esc-ai-result-text h3 {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.esc-ai-result-text p {
    margin: 0;
    color: #4a5568;
    line-height: 1.5;
    font-size: 15px;
}

/* AI Changes Summary */
.esc-ai-changes-summary {
    margin-bottom: 24px;
}

.esc-toggle-changes {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: #3498db;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
}

.esc-toggle-changes .dashicons {
    margin-right: 8px;
}

.esc-changes-detail {
    margin-top: 16px;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.esc-changes-list {
    margin: 0;
    padding-left: 20px;
}

/* Review Mode Toggle - Removed */

/* AI Status Badge */
.esc-ai-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

.esc-ai-status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.esc-form-card[data-ai-status="fully-populated"] .esc-ai-status-badge {
    background-color: #f0fff4;
    color: #38a169;
    border-color: #c6f6d5;
}

.esc-form-card[data-ai-status="partially-populated"] .esc-ai-status-badge {
    background-color: #fffaf0;
    color: #dd6b20;
    border-color: #feebc8;
}

.esc-form-card[data-ai-status="not-populated"] .esc-ai-status-badge {
    background-color: #fff5f5;
    color: #e53e3e;
    border-color: #fed7d7;
}

.esc-form-card[data-ai-status="needs-review"] .esc-ai-status-badge {
    background-color: #ebf8ff;
    color: #3182ce;
    border-color: #bee3f8;
}

.esc-ai-status-badge .dashicons {
    margin-right: 6px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    position: relative;
    top: 1px;
}

/* Special AI Complete Badge */
.esc-ai-complete {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    background-color: #f0fff4;
    color: #38a169;
    border: 1px solid #c6f6d5;
}

.esc-ai-complete:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(56, 161, 105, 0.15);
}

.esc-ai-complete .dashicons {
    margin-right: 6px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    position: relative;
    top: 1px;
}

/* Confidence Indicators */
.esc-input-with-confidence {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

.esc-input-with-confidence input {
    width: 100%;
}

.esc-confidence-indicator {
    margin-left: 8px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.esc-confidence-indicator:hover {
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #cbd5e0;
}

.esc-confidence-indicator[data-confidence="high"] {
    color: #38a169;
    border-color: #c6f6d5;
    background-color: #f0fff4;
}

.esc-confidence-indicator[data-confidence="medium"] {
    color: #dd6b20;
    border-color: #feebc8;
    background-color: #fffaf0;
}

.esc-confidence-indicator[data-confidence="low"] {
    color: #e53e3e;
    border-color: #fed7d7;
    background-color: #fff5f5;
}

.esc-confidence-tooltip {
    position: absolute;
    bottom: 130%;
    right: -10px;
    transform: translateX(0);
    background-color: #333;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: none;
    width: 220px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.esc-confidence-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 15px;
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.esc-confidence-indicator:hover .esc-confidence-tooltip {
    opacity: 1;
    visibility: visible;
}

/* AI Suggestions */
.esc-ai-suggestions {
    margin-top: 16px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.esc-suggestion-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #3498db;
    font-weight: 500;
}

.esc-suggestion-header .dashicons {
    margin-right: 8px;
}

.esc-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.esc-suggestion {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.esc-suggestion:hover {
    background-color: #ebf5fb;
    border-color: #3498db;
}

/* Retry AI Button */
.esc-retry-ai {
    margin-top: 16px;
    text-align: center;
}

/* Quick Review Mode Styles */
.esc-ai-populated {
    margin-top: 24px;
}

.esc-ai-summary {
    margin-top: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.esc-summary-message {
    margin-bottom: 20px;
    font-size: 16px;
    color: #333;
}

.esc-summary-list {
    margin-bottom: 20px;
}

.esc-ai-summary .esc-button {
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 16px;
}

.esc-ai-populated {
    margin-top: 24px;
    position: relative;
}

.esc-ai-populated::after {
    content: none;
    display: none;
    width: 0;
    height: 0;
    background-color: transparent;
}

.esc-ai-populated input,
.esc-ai-populated textarea,
.esc-ai-populated select {
    border-left: none;
    background-color: transparent;
}

.esc-ai-populated::before {
    content: 'AI Populated';
    position: absolute;
    top: -8px;
    right: 10px;
    background-color: #27ae60;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
    z-index: 3;
}

.esc-ai-populated:hover::before {
    opacity: 1;
    transform: translateY(0);
}

/* AI Badge for labels */
.esc-ai-badge {
    display: inline-block;
    background-color: #27ae60;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
    animation: fadeIn 0.5s ease-out;
}

/* Highlight the variety field when populated by AI */
#esc_variety_name.has-value,
#esc_variety_name_review.has-value {
    border-color: #27ae60;
    background-color: rgba(39, 174, 96, 0.03);
    box-shadow: 0 0 0 1px rgba(39, 174, 96, 0.2);
}

.esc-ai-processed {
    margin-top: 24px;
    position: relative;
}

.esc-ai-processed::after {
    content: none;
    display: none;
    width: 0;
    height: 0;
    background-color: transparent;
}

.esc-ai-processed input,
.esc-ai-processed textarea,
.esc-ai-processed select {
    border-left: none;
    background-color: transparent;
}

.esc-ai-processed::before {
    content: 'AI Processed';
    position: absolute;
    top: -8px;
    right: 10px;
    background-color: #95a5a6;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
    z-index: 3;
}

.esc-ai-processed:hover::before {
    opacity: 1;
    transform: translateY(0);
}

/* Make sure the detailed view is always visible */
.esc-review-mode {
    display: block !important;
}

/* Form Actions */
.esc-form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

/* Range Slider */
.esc-range-slider {
    display: flex;
    flex-direction: column;
}

.esc-slider {
    width: 100%;
    margin: 8px 0;
}

.esc-slider-value {
    display: flex;
    align-items: center;
}

.esc-slider-value input {
    width: 60px;
    text-align: center;
    margin-right: 8px;
}

.esc-unit {
    color: #666;
}

/* Toggle Group */
.esc-toggle-group {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.esc-toggle {
    flex: 1;
    position: relative;
    margin: 0;
}

.esc-toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.esc-toggle-label {
    display: block;
    padding: 8px 12px;
    text-align: center;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.esc-toggle input:checked + .esc-toggle-label {
    background-color: #3498db;
    color: white;
}

/* Select Multiple */
.esc-select-multiple {
    height: 150px !important;
}

/* Variety Dropdown Enhancements */
.esc-variety-field-container {
    position: relative;
    margin-bottom: 16px;
}

.esc-variety-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 100;
}

.esc-variety-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.esc-variety-option:hover {
    background-color: #ebf5fb;
}

.esc-variety-option.selected {
    background-color: #ebf5fb;
    font-weight: 500;
}

/* Spinner Animation */
.esc-spin {
    animation: esc-spin 2s linear infinite;
}

@keyframes esc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Image Upload */
.esc-image-upload-container {
    display: flex;
}

.esc-upload-button {
    margin-left: 8px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .esc-form-row {
        flex-direction: column;
    }

    .esc-form-field {
        flex: 1 1 100%;
        margin-bottom: 16px;
    }

    .esc-button-large {
        padding: 16px;
    }

    .esc-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .esc-ai-status-badge {
        margin-top: 8px;
    }

    .esc-form-actions {
        flex-direction: column;
    }

    .esc-form-actions .esc-button {
        width: 100%;
        margin-bottom: 8px;
    }

    .esc-ai-result-summary {
        flex-direction: column;
        text-align: center;
    }

    .esc-ai-result-icon {
        margin-right: 0;
        margin-bottom: 8px;
    }
}

/* Add a subtle animation to the form */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.esc-form-card {
    animation: fadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

/* Add a subtle animation to focused fields */
@keyframes fieldFocus {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

.esc-modern-form input:focus,
.esc-modern-form textarea:focus,
.esc-modern-form select:focus {
    animation: fieldFocus 0.3s ease-out;
}

/* Manual Toggle */
.esc-manual-toggle {
    margin-top: 16px;
    text-align: center;
}

.esc-manual-toggle a {
    color: #718096;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
}

.esc-manual-toggle a:hover {
    color: #4299e1;
    background-color: #f7fafc;
    text-decoration: none;
}

@media (min-width: 1600px) {
    .esc-manual-toggle {
        margin-top: 25px;
    }

    .esc-manual-toggle a {
        font-size: 16px;
        padding: 10px 20px;
    }
}

@media (min-width: 2560px) {
    .esc-manual-toggle {
        margin-top: 35px;
    }

    .esc-manual-toggle a {
        font-size: 18px;
        padding: 12px 24px;
    }
}
