﻿/* General App Styling */
.motorvert-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    border: 1px solid #ccd0d4;
    padding: 0; /* Remove padding for the new header bar */
    border-radius: 8px;
    background: #fdfdfd;
    overflow: hidden; /* Contain the header bar */
}

/* NEW: Credit/Trial Bar */
.motorvert-credits-bar {
    padding: 15px 20px;
    font-size: 16px;
    margin: 0;
    border-bottom: 1px solid #ccd0d4;
}
.motorvert-credits-bar.guest {
    background: #fff8e1; /* Light yellow */
    color: #665200;
}
.motorvert-credits-bar.member {
    background: #e7f5ff; /* Light blue */
    color: #004a7c;
}
.motorvert-credits-bar.error {
    background: #fdeaea; /* Light red */
    color: #9a2a2a;
    font-weight: bold;
}
.motorvert-credits-bar a {
    font-weight: bold;
    color: #0073aa;
    text-decoration: underline;
}

/* Form Styling (add padding back) */
#motorvert-form,
.motorvert-app .mv-results,
.motorvert-app #motorvert-message-area {
    padding: 20px;
}

.mv-step {
    margin-bottom: 25px;
}

.mv-step h2 {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* --- Inline settings for scale/margin --- */
.mv-inline-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.mv-inline-settings label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.mv-inline-settings .small-text {
    width: 80px;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}


/* --- Per-Image Text Field Styling --- */
.mv-step label[for="mv_per_image_text"] {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.mv-step .regular-text {
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}
.mv-step .description {
    font-size: 13px;
    color: #50575E;
    margin-top: 5px;
}
.mv-step .description a {
    color: #0073aa;
}


/* Background Selector */
#motorvert-bg-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.bg-option {
    display: block;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
}

.bg-option img {
    display: block;
    width: 100%;
    height: auto;
    border-bottom: 1px solid #eee;
}

.bg-option span {
    display: block;
    padding: 10px;
    font-size: 14px;
    text-align: center;
    background: #f9f9f9;
}

.bg-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.bg-option:hover {
    border-color: #ddd;
}

/* This is a bit of a trick to show selection without :has() */
.bg-option input[type="radio"]:checked + img + span {
    background: #0073aa; /* WordPress Blue */
    color: #fff;
    font-weight: bold;
}


/* Submit Button */
#motorvert-process-btn {
    display: inline-block;
    background-color: #2271b1;
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s ease-in-out;
    position: relative; /* Essential for the new animation overlay */
    overflow: hidden;   /* Essential for the new animation overlay */
}

#motorvert-process-btn:hover {
    background-color: #1d5f96;
}

/* --- Style for regenerate mode --- */
#motorvert-process-btn.regenerate-mode {
    background-color: #1E8E3E; /* Green */
}
#motorvert-process-btn.regenerate-mode:hover {
    background-color: #166a2e;
}

#motorvert-process-btn:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* ---------------------------------------------------------
   POLISH SECTION (Version 1.5.4)
--------------------------------------------------------- */
#mv-polish-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#mv-polish-section h3 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 800; /* Ensure Bold */
}

.mv-polish-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* The Radio Button "Pills" */
.mv-polish-pill {
    position: relative;
    cursor: pointer;
}

.mv-polish-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mv-polish-label {
    display: block;
    padding: 8px 16px;
    background: #f0f0f1;
    border: 1px solid #8c8f94;
    border-radius: 20px; /* Rounded pill shape */
    font-weight: 500;
    color: #1d2327;
    transition: all 0.2s ease;
    font-size: 14px;
}

.mv-polish-pill:hover .mv-polish-label {
    background: #fff;
    border-color: #2271b1;
}

/* Selected State */
.mv-polish-pill input[type="radio"]:checked + .mv-polish-label {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}


/* Results Area */
.mv-results {
    margin-top: 0;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Download All Button */
.motorvert-download-all {
    display: inline-block;
    background-color: #0073aa; /* WordPress Blue */
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    margin-bottom: 20px;
    transition: background-color 0.2s ease-in-out;
}

.motorvert-download-all:hover {
    background-color: #005a87;
}

.motorvert-download-all:disabled {
    background-color: #999;
    cursor: not-allowed;
}


/* Results Grid */
#motorvert-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.motorvert-result-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    background: #fff;
    overflow: hidden;
}

/* --- Title for result items --- */
.mv-result-title {
    display: block;
    padding: 12px 15px;
    font-weight: bold;
    font-size: 16px;
    background: #f9f9f9;
    text-align: center;
}

.motorvert-result-item img {
    display: block;
    width: 100%;
    height: auto;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.motorvert-download-link {
    display: block;
    padding: 15px;
    text-align: center;
    background: #f9f9f9;
    color: #2271b1;
    font-weight: bold;
    text-decoration: none;
}

.motorvert-download-link:hover {
    background: #f0f0f0;
}

/* Message Area */
#motorvert-message-area {
    padding: 15px;
    margin-top: 0; /* Reset margin */
    border-radius: 0; /* Reset border radius */
    border-bottom: 1px solid #ccd0d4; /* Match app border */
    display: none; /* Hidden by default */
}

#motorvert-message-area.success {
    background: #dff0d8;
    border-color: #d6e9c6;
    color: #3c763d;
}

#motorvert-message-area.error {
    background: #f2dede;
    border-color: #ebccd1;
    color: #a94442;
}

/* ---------------------------------------------------------
   ROBUST PROCESSING ANIMATION (Version 1.5.2+)
--------------------------------------------------------- */

@keyframes mv-barberpole {
    from { background-position: 0 0; }
    to {   background-position: 50px 50px; }
}

#motorvert-process-btn.motorvert-processing::after {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    z-index: 1;
    background-image: linear-gradient(
        -45deg, 
        rgba(255, 255, 255, 0.2) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.2) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 50px 50px;
    animation: mv-barberpole 2s linear infinite;
    pointer-events: none; 
}

#motorvert-process-btn.motorvert-processing:disabled {
    background-color: #2271b1 !important; 
    color: #fff !important;
    opacity: 1 !important; 
    cursor: wait !important;
    border: none !important;
}

#motorvert-process-btn.motorvert-processing.regenerate-mode:disabled {
    background-color: #1E8E3E !important;
    color: #fff !important;
}