/* =========================
 BASE STYLES & RESET
========================= */
.jaeg-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.jaeg-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* =========================
 HEADER STYLES
========================= */
.jaeg-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.jaeg-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.jaeg-header .dashicons {
    font-size: 2.2rem;
    width: auto;
    height: auto;
}

.jaeg-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* =========================
 FORM STYLES
========================= */
.jaeg-form-wrapper {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.jaeg-form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e9ecef;
}

.jaeg-form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.jaeg-form-section h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.jaeg-form-group {
    margin-bottom: 25px;
}

.jaeg-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jaeg-form-group label.jaeg-required::after {
    content: '*';
    color: #dc3545;
    margin-left: 4px;
}

.jaeg-input,
.jaeg-select,
.jaeg-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.jaeg-input:focus,
.jaeg-select:focus,
.jaeg-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.jaeg-input.error {
    border-color: #dc3545;
}

.jaeg-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.jaeg-hint {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* =========================
 TABS STYLES
========================= */
.jaeg-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.jaeg-tab {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
}

.jaeg-tab:hover {
    background: #e9ecef;
}

.jaeg-tab.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.jaeg-tab-content {
    display: none;
}

.jaeg-tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =========================
 OPTIONS GRID
========================= */
.jaeg-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.jaeg-option-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.jaeg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.jaeg-checkbox-label:hover {
    background: #f8f9fa;
}

.jaeg-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* =========================
 ACTIONS BUTTONS
========================= */
.jaeg-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.jaeg-generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.jaeg-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.jaeg-generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* =========================
 LOADING STATE
========================= */
.jaeg-loading {
    background: white;
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    margin: 30px 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.jaeg-spinner {
    display: inline-block;
    width: 80px;
    height: 80px;
    margin-bottom: 25px;
}

.jaeg-spinner-circle {
    width: 100%;
    height: 100%;
    border: 6px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: jaeg-spin 1s linear infinite;
}

@keyframes jaeg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.jaeg-loading-content h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.jaeg-loading-content p {
    color: #6c757d;
    margin-bottom: 20px;
}

.jaeg-progress {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    max-width: 400px;
    margin: 20px auto;
}

.jaeg-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.jaeg-loading-hint {
    font-size: 0.9rem;
    color: #adb5bd;
    font-style: italic;
}

/* =========================
 ERROR DISPLAY
========================= */
.jaeg-error {
    background: #fee;
    border: 2px solid #f5c6cb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    color: #721c24;
}

.jaeg-error-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.jaeg-error-content .dashicons {
    color: #dc3545;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.jaeg-error-content strong {
    display: block;
    margin-bottom: 5px;
}

/* =========================
 RESULTS SECTION
========================= */
.jaeg-results {
    animation: slideUp 0.8s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jaeg-results-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 12px;
    color: white;
}

.jaeg-results-header h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.jaeg-results-header p {
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* =========================
 EMAIL VARIATIONS
========================= */
.jaeg-emails-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}

.jaeg-email-variation {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease;
}

.jaeg-email-variation:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.12);
}

.jaeg-email-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.jaeg-email-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.jaeg-email-meta h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0;
}

.jaeg-variation-badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.jaeg-email-actions {
    display: flex;
    gap: 10px;
}

.jaeg-email-actions button {
    padding: 8px 16px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.jaeg-email-actions .jaeg-copy-email {
    color: #28a745;
    border-color: #c3e6cb;
}

.jaeg-email-actions .jaeg-copy-email:hover {
    background: #d4edda;
    border-color: #28a745;
}

.jaeg-email-actions .jaeg-download-email {
    color: #007bff;
    border-color: #b3d7ff;
}

.jaeg-email-actions .jaeg-download-email:hover {
    background: #e7f3ff;
    border-color: #007bff;
}

.jaeg-email-actions button.copied {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.jaeg-subject-line {
    background: #e7f3ff;
    padding: 15px 20px;
    border-bottom: 1px solid #cfe2ff;
    font-size: 1.1rem;
}

.jaeg-subject-line strong {
    color: #0056b3;
}

.jaeg-email-body {
    padding: 25px;
    font-size: 1rem;
    line-height: 1.8;
}

.jaeg-email-body pre {
    white-space: pre-wrap;
    font-family: inherit;
    margin: 0;
}

.jaeg-email-footer {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.jaeg-email-strengths h5,
.jaeg-best-for h5 {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jaeg-email-strengths ul {
    list-style: none;
    padding: 0;
}

.jaeg-email-strengths li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.jaeg-email-strengths li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.jaeg-best-for p {
    background: #fff3cd;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    margin: 0;
}

/* =========================
 SUMMARY CARD
========================= */
.jaeg-summary-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
}

.jaeg-summary-card h4 {
    color: #495057;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =========================
 BULK ACTIONS
========================= */
.jaeg-bulk-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 30px;
    background: white;
    border-radius: 12px;
    margin-top: 40px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.jaeg-download-btn,
.jaeg-copy-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.jaeg-download-btn {
    background: #28a745;
    color: white;
}

.jaeg-download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.jaeg-copy-btn {
    background: #6c757d;
    color: white;
}

.jaeg-copy-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* =========================
 RESPONSIVE DESIGN
========================= */
@media (max-width: 768px) {
    .jaeg-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .jaeg-options-grid {
        grid-template-columns: 1fr;
    }
    
    .jaeg-email-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .jaeg-email-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .jaeg-email-footer {
        grid-template-columns: 1fr;
    }
    
    .jaeg-bulk-actions {
        flex-direction: column;
    }
    
    .jaeg-bulk-actions button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .jaeg-form-wrapper {
        padding: 20px;
    }
    
    .jaeg-generate-btn {
        width: 100%;
        justify-content: center;
    }
    
    .jaeg-tabs {
        flex-direction: column;
    }
}

/* =========================
 DASHICONS STYLING
========================= */
.dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
    vertical-align: middle;
}