/**
 * Admin Styles for GlowReviews Plugin
 * Modern, attractive admin interface styling
 */

/* Main Admin Container */
.glowrev-admin-wrap {
    max-width: 1200px;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Admin Header */
.glowrev-admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    margin: -20px -20px 30px -20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.glowrev-admin-title h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.glowrev-admin-title .glowrev-icon {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 8px;
    display: inline-block;
}

.glowrev-admin-subtitle {
    margin: 8px 0 0 44px;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

/* Main Content Layout */
.glowrev-admin-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    margin-bottom: 30px;
}

/* Card Styles */
.glowrev-settings-card,
.glowrev-help-card,
.glowrev-features-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glowrev-settings-card:hover,
.glowrev-help-card:hover,
.glowrev-features-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.glowrev-card-header {
    background: #f8f9fa;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5e9;
}

.glowrev-card-header h2,
.glowrev-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.glowrev-card-header h3 {
    font-size: 16px;
}

.glowrev-card-icon {
    font-size: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6px;
    border-radius: 6px;
    display: inline-block;
}

.glowrev-card-header p {
    margin: 8px 0 0 30px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.glowrev-card-body {
    padding: 24px;
}

/* Form Styles */
.glowrev-form-field {
    margin-bottom: 24px;
}

.glowrev-form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.glowrev-form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.glowrev-form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.glowrev-form-description {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* Save Button */
.glowrev-save-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.glowrev-save-button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4) !important;
}

/* Shortcode Sections */
.glowrev-shortcode-section {
    margin-bottom: 20px;
}

.glowrev-shortcode-section:last-child {
    margin-bottom: 0;
}

.glowrev-shortcode-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.glowrev-shortcode-box {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    gap: 8px;
}

.glowrev-shortcode-box code {
    flex: 1;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: #4b5563;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.glowrev-copy-btn {
    background: #667eea;
    border: none;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.glowrev-copy-btn:hover {
    background: #5a67d8;
}

.glowrev-copy-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Features List */
.glowrev-features-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.glowrev-features-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
    color: #4b5563;
    border-bottom: 1px solid #f3f4f6;
}

.glowrev-features-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.glowrev-features-list li:first-child {
    padding-top: 0;
}

.glowrev-features-list .dashicons {
    color: #667eea;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .glowrev-admin-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .glowrev-admin-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .glowrev-admin-header {
        padding: 20px 15px;
        margin: -20px -15px 20px -15px;
    }
    
    .glowrev-admin-title h1 {
        font-size: 24px;
    }
    
    .glowrev-admin-subtitle {
        margin-left: 0;
        margin-top: 6px;
    }
    
    .glowrev-admin-sidebar {
        grid-template-columns: 1fr;
    }
    
    .glowrev-card-header,
    .glowrev-card-body {
        padding: 16px;
    }
    
    .glowrev-admin-content {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .glowrev-admin-title h1 {
        font-size: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .glowrev-admin-title .glowrev-icon {
        font-size: 24px;
        padding: 6px;
    }
    
    .glowrev-shortcode-box {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .glowrev-copy-btn {
        align-self: flex-end;
        width: auto;
        padding: 6px 12px;
    }
}

/* Animation for copy button */
.glowrev-copy-btn.copied {
    background: #10b981;
}

.glowrev-copy-btn.copied .dashicons {
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* WordPress Admin Integration */
.wrap .glowrev-admin-wrap {
    margin: 0;
    padding: 0;
}

.glowrev-admin-wrap .notice {
    margin: 20px 20px 0 20px;
}

/* Form validation styles */
.glowrev-form-field.has-error .glowrev-form-select {
    border-color: #dc3545;
}

.glowrev-form-field.has-success .glowrev-form-select {
    border-color: #28a745;
}

/* Loading states */
.glowrev-admin-wrap.loading {
    opacity: 0.6;
    pointer-events: none;
}

.glowrev-admin-wrap.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Admin Rating Input Styles - Higher Specificity */
.post-type-glowrev_testimonial .glowrev-admin-rating-input,
.glowrev-testimonial-fields .glowrev-admin-rating-input {
    display: flex !important;
    gap: 0.25rem !important;
    align-items: center !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
}

.post-type-glowrev_testimonial .glowrev-admin-rating-input input[type="radio"],
.glowrev-testimonial-fields .glowrev-admin-rating-input input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.post-type-glowrev_testimonial .glowrev-admin-rating-input label,
.glowrev-testimonial-fields .glowrev-admin-rating-input label {
    cursor: pointer !important;
    font-size: 1.5rem !important;
    color: #ccc !important;
    padding: 4px 6px !important;
    border-radius: 3px !important;
    transition: all 0.2s ease !important;
}

.post-type-glowrev_testimonial .glowrev-admin-rating-input label:hover,
.glowrev-testimonial-fields .glowrev-admin-rating-input label:hover {
    color: #ffb900 !important;
    background: rgba(255, 185, 0, 0.1) !important;
}

.post-type-glowrev_testimonial .glowrev-admin-rating-input input[type="radio"]:checked + label,
.glowrev-testimonial-fields .glowrev-admin-rating-input input[type="radio"]:checked + label {
    color: #ffb900 !important;
    background: rgba(255, 185, 0, 0.15) !important;
    box-shadow: 0 1px 3px rgba(255, 185, 0, 0.3) !important;
}

.post-type-glowrev_testimonial .glowrev-admin-rating-input input[type="radio"]:focus + label,
.glowrev-testimonial-fields .glowrev-admin-rating-input input[type="radio"]:focus + label {
    outline: 2px solid #0073aa !important;
    outline-offset: 1px !important;
    border-radius: 3px !important;
}

/* JavaScript-based star classes */
.post-type-glowrev_testimonial .glowrev-admin-rating-input label.star-selected,
.glowrev-testimonial-fields .glowrev-admin-rating-input label.star-selected {
    color: #ffb900 !important;
    background: rgba(255, 185, 0, 0.15) !important;
    box-shadow: 0 1px 3px rgba(255, 185, 0, 0.3) !important;
}

.post-type-glowrev_testimonial .glowrev-admin-rating-input label.star-hover,
.glowrev-testimonial-fields .glowrev-admin-rating-input label.star-hover {
    color: #ffb900 !important;
    background: rgba(255, 185, 0, 0.1) !important;
}

/* Ensure labels are positioned correctly after hidden inputs */
.post-type-glowrev_testimonial .glowrev-admin-rating-input input[type="radio"] + label,
.glowrev-testimonial-fields .glowrev-admin-rating-input input[type="radio"] + label {
    position: relative !important;
    z-index: 1 !important;
}

/* Hide the old select if it exists */
.post-type-glowrev_testimonial .glowrev-testimonial-fields select#glowrev-testimonial_rating,
.glowrev-testimonial-fields select#glowrev-testimonial_rating {
    display: none !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Testimonial Meta Box Styles */
.glowrev-testimonial-fields .glowrev-image-upload-field {
    margin-top: 5px;
    margin-bottom: 10px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
}

.glowrev-testimonial-fields .glowrev-image-upload-field label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    font-size: 14px;
}

.glowrev-image-preview {
    margin-bottom: 10px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px dashed #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.glowrev-image-preview img {
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.glowrev-image-preview:empty::before {
    content: "No image selected";
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
}

.glowrev-upload-image-button,
.glowrev-remove-image-button {
    margin-right: 8px;
    margin-bottom: 5px;
    padding: 8px 16px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

.glowrev-upload-image-button {
    background: #667eea !important;
    border-color: #667eea !important;
    color: white !important;
}

.glowrev-upload-image-button:hover {
    background: #5a67d8 !important;
    border-color: #5a67d8 !important;
}

.glowrev-remove-image-button {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.glowrev-remove-image-button:hover {
    background: #c82333 !important;
    border-color: #c82333 !important;
}

.glowrev-testimonial-fields .description {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    font-style: italic;
}

/* Improve testimonial meta box overall styling */
.glowrev-testimonial-fields p {
    margin-top: 5px;
    margin-bottom: 5px;
}

.glowrev-testimonial-fields label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-size: 13px;
}

.glowrev-testimonial-fields input[type="text"],
.glowrev-testimonial-fields input[type="email"],
.glowrev-testimonial-fields select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glowrev-testimonial-fields input[type="text"]:focus,
.glowrev-testimonial-fields input[type="email"]:focus,
.glowrev-testimonial-fields select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
