/*
Plugin: Marvio Review Manager Styles
*/

/* --- Global Variables (Optional, but good practice) --- */
:root {
    --marvio-bg-dark: rgba(40, 40, 40, 0.9);
    --marvio-bg-input: rgba(60, 60, 60, 0.8);
    --marvio-border-subtle: rgba(255, 255, 255, 0.15);
    --marvio-accent-primary: #9d50e8; /* Purple */
    --marvio-accent-hover: #7e40b8;
    --marvio-text-light: #e0e0e0;
    --marvio-text-white: #fff;
    --marvio-required-color: #FF5A5A;
    --marvio-rating-color: #FFD700; /* Gold */
}

/* --- Review Submission Form Styles --- */
.marvio-review-form-container {
    max-width: 650px; /* Slightly wider */
    margin: 30px auto;
    padding: 35px;
    border-radius: 16px; /* Smoother corners */
    background: var(--marvio-bg-dark);
    box-shadow: 0 8px 30px 0 rgba(0, 0, 0, 0.4); /* Deeper shadow */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--marvio-border-subtle);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.marvio-form-title {
    color: var(--marvio-text-white); 
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.8em;
}

.marvio-form-subtitle {
    color: var(--marvio-text-light);
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--marvio-border-subtle);
    font-size: 0.95em;
}

/* Input Grid (for name and email) */
.marvio-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.marvio-form-group {
    margin-bottom: 0; /* Managed by grid gap for user info */
}

.marvio-form-group:last-of-type:not(.marvio-rating-group) {
    margin-bottom: 20px; /* Separator for last non-grid group */
}

.marvio-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--marvio-text-light); 
    font-size: 0.95em;
}

.marvio-form-group input:not([type="radio"]),
.marvio-form-group textarea {
    width: 100%;
    padding: 12px 15px; /* More comfortable padding */
    border: 1px solid var(--marvio-border-subtle); 
    border-radius: 8px; /* Smoother border */
    background: var(--marvio-bg-input);
    color: var(--marvio-text-white);
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.marvio-form-group textarea {
    resize: vertical;
}

.marvio-form-group input::placeholder,
.marvio-form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

.marvio-form-group input:focus,
.marvio-form-group textarea:focus {
    outline: none;
    border-color: var(--marvio-accent-primary);
    box-shadow: 0 0 0 3px rgba(157, 80, 232, 0.5); /* Stronger focus ring */
    background: rgba(80, 80, 80, 0.8);
}

.marvio-required {
    color: var(--marvio-required-color);
    font-weight: normal;
}

/* --- Star Rating Section --- */
.marvio-rating-group {
    margin-bottom: 30px;
}

.marvio-rating-label {
    font-size: 1.1em !important;
    margin-bottom: 12px !important;
    font-weight: 700 !important;
}

.marvio-star-input-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Remove padding-left */
    padding-left: 0;
    margin-top: 0;
}

.marvio-star-rating-input {
    direction: rtl; 
    display: inline-block;
    color: #666; 
    font-size: 32px; /* Larger stars */
    line-height: 1;
    cursor: pointer;
}

.marvio-star-rating-input input[type="radio"] {
    display: none;
}

.marvio-star-rating-input label {
    display: inline-block;
    cursor: pointer;
    margin: 0; 
    padding: 0 4px; /* More spacing between stars */
    transition: color 0.2s, transform 0.1s;
    line-height: 1; 
}

/* Animation on hover for better feel */
.marvio-star-rating-input label:hover,
.marvio-star-rating-input label:hover ~ label {
    color: var(--marvio-rating-color);
    transform: scale(1.1);
}

.marvio-star-rating-input input[type="radio"]:checked ~ label {
    color: var(--marvio-rating-color); 
}

/* Hint Text */
.marvio-rating-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9em;
    font-style: italic;
}

/* --- Submit Button --- */
.marvio-submit-container {
    padding-top: 10px;
    text-align: center; /* Center the button */
}

.marvio-submit-btn {
    background-color: var(--marvio-accent-primary); 
    color: var(--marvio-text-white);
    border: none;
    padding: 14px 30px; /* Larger hit area */
    border-radius: 50px; /* Pill shape for modern look */
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s, transform 0.1s;
    position: relative;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(157, 80, 232, 0.4);
    min-width: 200px; /* Ensure button stays a reasonable size */
}

.marvio-submit-btn:hover {
    background-color: var(--marvio-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 80, 232, 0.6);
}

.marvio-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Form Messages */
.marvio-form-message {
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
}

.marvio-form-message.success {
    background-color: #28a74530; 
    color: #40ff6c; /* Brighter green text */
    border: 1px solid #28a745;
}

.marvio-form-message.error {
    background-color: #dc354530; 
    color: #ff8c97; /* Lighter red text */
    border: 1px solid #dc3545;
}

/* Spinner */
.marvio-spinner {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: marvio-spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes marvio-spin {
    to { transform: rotate(360deg); }
}

/* --- Review Display Grid and Card Styles (Optimized) --- */
/* Kept the existing display styles, ensuring responsiveness */
.marvio-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.marvio-review-card {
    padding: 25px;
    border-radius: 15px;
    background: rgba(40, 40, 40, 0.9); 
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    color: #f0f0f0; 
    transition: transform 0.3s, box-shadow 0.3s;
}

.marvio-review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.marvio-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    padding-bottom: 10px;
}

.marvio-reviewer-name {
    font-weight: 700;
    font-size: 1.1em;
    display: block;
    color: var(--marvio-text-white); 
}

.marvio-review-date {
    font-size: 0.85em;
    color: #aaa; 
    display: block;
}

.marvio-star-rating-display {
    color: var(--marvio-rating-color);
    font-size: 1.2em;
    letter-spacing: 2px;
}

.marvio-star-rating-display span.empty {
    color: #444; 
}

.marvio-card-body {
    flex-grow: 1;
}

.marvio-review-message {
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.6;
    overflow-wrap: break-word;
}

.marvio-read-more-toggle {
    color: var(--marvio-accent-primary); 
    text-decoration: none;
    font-weight: 600;
}

.marvio-read-more-toggle:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .marvio-form-grid {
        grid-template-columns: 1fr; /* Stack columns on mobile */
        gap: 0;
    }
    .marvio-review-form-container {
        padding: 25px 20px;
        margin: 20px 10px;
    }
    .marvio-form-group {
        margin-bottom: 20px;
    }
    .marvio-star-rating-input {
        font-size: 28px;
    }
    .marvio-reviews-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1024px) {
    .marvio-reviews-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}