/* Viral Post Enhancer - V2.0 Styling */

/* --- Base & Layout --- */
.vpe-app { border: 1px solid #dcdcde; padding: 25px 30px; margin-bottom: 30px; background-color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.07); max-width: 900px; margin-left: auto; margin-right: auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; }
.vpe-app h2 { font-size: 1.7em; margin-top: 0; margin-bottom: 10px; color: #1d2327; font-weight: 600;}
.vpe-app h3 { font-size: 1.3em; margin-top: 0; margin-bottom: 15px; color: #1d2327; font-weight: 600;}
.vpe-app h4 { font-size: 1.15em; margin-top: 0; margin-bottom: 15px; color: #2271b1; padding-bottom: 10px; border-bottom: 1px dashed #dcdcde; font-weight: 600;}
.vpe-app h5 { font-size: 1.0em; font-weight: 600; margin-top: 0; margin-bottom: 12px; color: #1d2327; }
.vpe-app p { margin-top: 0; margin-bottom: 1em; line-height: 1.6; }

.vpe-section { margin-bottom: 30px; padding-bottom: 30px; border-bottom: 1px solid #f0f0f1; }
.vpe-app .vpe-section:last-child { border-bottom: none; padding-bottom: 10px; margin-bottom: 10px; }

/* --- Controls Area V2.0 --- */
.vpe-enhancer-controls { display: flex; flex-direction: column; gap: 30px; border-bottom: none; padding-bottom: 0; }
.vpe-fieldset { border: 1px solid #dcdcde; padding: 20px 25px; border-radius: 4px; margin: 0; }
.vpe-fieldset legend { font-weight: 600; font-size: 1.1em; padding: 0 10px; margin-left: -10px; /* Adjust for visual centering */ color: #1d2327; }

.vpe-control-group { margin-bottom: 15px; }
.vpe-control-group:last-child { margin-bottom: 0; }
.vpe-control-group label { font-weight: 500; font-size: 0.95em; color: #333; display: block; margin-bottom: 8px;}
.vpe-control-group select, .vpe-control-group button.button, .vpe-control-group textarea { width: 100%; box-sizing: border-box; }
.vpe-control-group select { padding: 8px 10px; border: 1px solid #8c8f94; border-radius: 3px; background-color: #fff; min-height: 40px; font-size:0.95em; }
.vpe-control-group select:focus { border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; outline: none; }
.vpe-control-group button.button { min-height: 40px; line-height: normal; padding: 8px 15px; font-size: 0.95em; border-radius: 3px; }
.vpe-control-group .vpe-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; } /* Screen reader only label */

/* Input Type Radio Buttons */
.vpe-input-type-group legend + div { margin-top: 10px; } /* Space below legend */
.vpe-radio-group { display: flex; gap: 25px; align-items: center; flex-wrap: wrap; }
.vpe-radio-group label { font-weight: normal; font-size: 0.95em; color: #444; display: inline-flex; align-items: center; cursor: pointer; margin: 0; }
.vpe-radio-group input[type="radio"] { margin-right: 8px; margin-top: 0; flex-shrink: 0; }

/* Text Area Styling */
.vpe-textarea-group textarea { padding: 12px; border: 1px solid #dcdcde; border-radius: 3px; font-size: 1em; line-height: 1.6; min-height: 200px; /* Taller default */ resize: vertical; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.vpe-textarea-group textarea:focus { border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; outline: none; }
.vpe-word-count { text-align: right; font-size: 0.85em; color: #666; margin-top: 5px; padding-right: 5px; }
.vpe-word-count[aria-invalid="true"] { color: #d63638; font-weight: bold; }

/* Options Grid (Tone, Audience, Goal, Format) */
.vpe-options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px 25px; align-items: end; }

/* Focus Checkboxes */
.vpe-focus-group legend + div { margin-top: 10px; }
.vpe-checkbox-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 15px; }
.vpe-checkbox-group label { font-weight: normal; font-size: 0.9em; color: #444; display: flex; align-items: center; cursor: pointer; }
.vpe-checkbox-group input[type="checkbox"] { margin-right: 8px; margin-top: 0; }

/* Button & Usage Area */
.vpe-action-area { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 15px; margin-top: 20px; }
.vpe-generate-button-group { max-width: 300px; flex-grow: 1; /* Allow button group to grow */ }
.vpe-usage-info-group { text-align: right; padding-bottom: 5px; flex-shrink: 0; /* Prevent shrinking */ }
.vpe-usage-info { margin: 0; padding: 0; font-size: 0.9em; color: #50575e; line-height: 1.4; }
.vpe-upgrade-prompt { color: #d63638; font-weight: bold; font-style: italic; }

/* Specific Button Styling (Using vpe prefix for classes) */
.vpe-button-primary { background-color: #87CEEB; border-color: #76bbd8 #65a8c6 #65a8c6; color: #003f5c; font-weight: 500; box-shadow: 0 1px 0 #65a8c6; text-shadow: 0 -1px 1px #76bbd8, 1px 0 1px #76bbd8, 0 1px 1px #76bbd8, -1px 0 1px #76bbd8; transition: all 0.1s linear; }
.vpe-button-primary:hover:not(:disabled) { background-color: #76bbd8; border-color: #65a8c6; color: #002a3d; }
.vpe-button-primary:active:not(:disabled) { background-color: #65a8c6; border-color: #5495b3; box-shadow: inset 0 2px 0 #5495b3; transform: translateY(1px); }
.vpe-button-primary:disabled { background-color: #add8e6 !important; border-color: #a0c7d8 !important; color: #6a8a9a !important; cursor: not-allowed !important; box-shadow: none !important; text-shadow: none !important;}
.vpe-button-secondary { background-color: #f6f7f7; border-color: #dcdcde; color: #2271b1; }
.vpe-button-secondary:hover:not(:disabled) { background-color: #f0f0f1; border-color: #c9c9c9; color: #1b6095; }
.vpe-button-danger { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; }
.vpe-button-danger:hover:not(:disabled) { background-color: #f1b0b7; border-color: #eca5ac; color: #58151a; }


/* --- Messages & Loading --- */
.vpe-message { padding: 15px; margin-bottom: 20px; border-width: 1px; border-style: solid; border-radius: 4px; font-size: 0.95em; }
.vpe-message.vpe-error { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.vpe-message.vpe-success { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }
.vpe-message.vpe-warning { color: #664d03; background-color: #fff3cd; border-color: #ffecb5; }

#vpe-enhancer-loading-indicator { text-align: center; padding: 20px; color: #333; display: none; }
.vpe-spinner { border: 4px solid #f0f0f1; border-top: 4px solid #2271b1; border-radius: 50%; width: 40px; height: 40px; animation: vpe-spin 1s linear infinite; margin: 15px auto; }
@keyframes vpe-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Skeleton Loader Styles --- */
@keyframes vpe-pulse { 0% { background-color: #f0f0f1; } 50% { background-color: #e6e6e6; } 100% { background-color: #f0f0f1; } }
.vpe-skeleton { background-color: #f0f0f1; animation: vpe-pulse 1.5s ease-in-out infinite; border-radius: 4px; }
.vpe-results-comparison.skeleton-active { display: flex; gap: 25px; } /* Display flex for skeleton */
.vpe-results-comparison.skeleton-active .vpe-results-column { flex: 1; }
.vpe-results-comparison.skeleton-active .vpe-results-column h3 { height: 24px; width: 40%; margin-bottom: 15px; background-color: #f0f0f1; animation: vpe-pulse 1.5s ease-in-out infinite; border-radius: 4px; color: transparent; /* Hide text */}
.vpe-skeleton-text-area { min-height: 150px; width: 100%; } /* Simulate text area */
.vpe-skeleton-button { height: 30px; width: 120px; margin-top: 15px; margin-left: auto; /* Align right */ }


/* --- Enhancer Results Area V2.0 --- */
.vpe-enhancer-results { margin-top: 20px; }
.vpe-enhancer-results h3 { margin-bottom: 10px; color: #2271b1; }
.vpe-enhancer-results .vpe-review-notice { font-size: 0.9em; background-color: #fff8e1; border-left: 4px solid #ffb300; padding: 10px 15px; margin-bottom: 15px; border-radius: 3px; color: #6d4c41; }

/* Side-by-Side Comparison */
.vpe-results-comparison {
    display: flex;
    gap: 30px; /* Space between columns */
    margin-top: 15px;
}
.vpe-results-column {
    flex: 1; /* Each column takes half the space */
    min-width: 0; /* Allow columns to shrink */
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fdfdfd;
}
.vpe-results-column h3 {
    font-size: 1.1em;
    padding: 12px 15px;
    margin: 0;
    background-color: #f6f7f7;
    border-bottom: 1px solid #e0e0e0;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}
.vpe-text-content {
    padding: 15px;
    min-height: 150px; /* Ensure columns have some height */
    max-height: 500px; /* Prevent excessive height */
    overflow-y: auto; /* Add scroll if needed */
}
.vpe-text-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-size: 0.95em; /* Slightly smaller pre text */
    line-height: 1.6;
    color: #333;
    background: none;
    border: none;
}
.vpe-copy-area {
    text-align: right;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background-color: #fcfcfc;
}

/* Enhancer Copy Button Position/Style (Inside Results Column) */
.vpe-enhanced-text-col .vpe-copy-button {
   /* No longer absolute */
}

/* Shared Copy Button Styles & Feedback (Using vpe prefix) */
.vpe-copy-button { cursor: pointer; border: 1px solid #ccc; background-color: #f7f7f7; color: #555; font-family: system-ui, sans-serif; padding: 2px 6px; border-radius: 3px; margin-left: 5px; vertical-align: middle; line-height: 1; transition: all 0.2s ease; flex-shrink: 0; }
.vpe-copy-button:hover { background-color: #eee; border-color: #999; }
.vpe-copy-button:active { background-color: #ddd; }
.vpe-copy-button:disabled { cursor: default; opacity: 1 !important; transform: scale(1.1); }
.vpe-copy-button.vpe-copied-success { background-color: #dff0d8; border-color: #d6e9c6; color: #3c763d; }
.vpe-copy-button.vpe-copied-fail { background-color: #f2dede; border-color: #ebccd1; color: #a94442; }
.vpe-copy-button.vpe-copied-error { background-color: #fcf8e3; border-color: #faebcc; color: #8a6d3b; }