/**
 * Post Quality Evaluator - Styles
 * Version: 1.0.0
 */

/* ===== Main Container ===== */
.pqe-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.pqe-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ===== Header ===== */
.pqe-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.pqe-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.pqe-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

/* ===== Input Section ===== */
.pqe-input-section {
    padding: 30px;
    border-bottom: 1px solid #e8e8e8;
}

.pqe-input-wrapper {
    position: relative;
}

.pqe-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.pqe-textarea {
    width: 100%;
    min-height: 250px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.pqe-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pqe-textarea::placeholder {
    color: #aaa;
}

.pqe-char-count {
    text-align: right;
    margin-top: 8px;
    font-size: 13px;
    color: #888;
}

/* ===== Rate Button ===== */
.pqe-button-wrapper {
    margin-top: 20px;
    text-align: center;
}

.pqe-rate-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.pqe-rate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.pqe-rate-button:active {
    transform: translateY(0);
}

.pqe-rate-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.pqe-rate-button .pqe-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: pqe-spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

.pqe-rate-button.loading .pqe-spinner {
    display: inline-block;
}

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

/* ===== Loading State ===== */
.pqe-loading {
    display: none;
    padding: 40px;
    text-align: center;
}

.pqe-loading.active {
    display: block;
}

.pqe-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: pqe-spin 1s linear infinite;
    margin: 0 auto 20px;
}

.pqe-loading p {
    color: #666;
    font-size: 16px;
}

/* ===== Results Section ===== */
.pqe-results {
    display: none;
    padding: 30px;
    animation: pqe-fadeIn 0.5s ease;
}

.pqe-results.active {
    display: block;
}

@keyframes pqe-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Total Score Card ===== */
.pqe-total-score {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: white;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.pqe-total-score::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: pqe-pulse 3s ease-in-out infinite;
}

@keyframes pqe-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.pqe-total-score-label {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.pqe-total-score-value {
    font-size: 72px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.pqe-total-score-value .pqe-out-of {
    font-size: 24px;
    opacity: 0.7;
}

.pqe-score-rating {
    font-size: 18px;
    font-weight: 600;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: inline-block;
    position: relative;
    z-index: 1;
}

/* Score colors */
.pqe-score-excellent { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.pqe-score-good { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.pqe-score-average { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.pqe-score-poor { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.pqe-score-bad { background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%); }

/* ===== Statistics Bar ===== */
.pqe-stats {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.pqe-stat-item {
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.pqe-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.pqe-stat-label {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* ===== Criteria Scores ===== */
.pqe-criteria-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8e8e8;
}

.pqe-criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pqe-criterion-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.pqe-criterion-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.pqe-criterion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pqe-criterion-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.pqe-criterion-score {
    font-size: 24px;
    font-weight: 700;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
}

.pqe-criterion-score.high { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.pqe-criterion-score.medium { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.pqe-criterion-score.low { background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%); }

.pqe-progress-bar {
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.pqe-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.pqe-progress-fill.high { background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%); }
.pqe-progress-fill.medium { background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%); }
.pqe-progress-fill.low { background: linear-gradient(90deg, #ff416c 0%, #ff4b2b 100%); }

.pqe-criterion-details {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
}

/* ===== Tips Section ===== */
.pqe-tips-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e0e0e0;
}

.pqe-tips-title {
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.pqe-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pqe-tips-list li {
    padding: 8px 0 8px 25px;
    position: relative;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.pqe-tips-list li::before {
    content: '💡';
    position: absolute;
    left: 0;
    top: 8px;
}

.pqe-tips-list li + li {
    border-top: 1px solid #f0f0f0;
}

/* ===== Summary Section ===== */
.pqe-summary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
}

.pqe-summary-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.pqe-summary-text {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
}

.pqe-summary-text strong {
    color: #667eea;
}

/* ===== Action Buttons ===== */
.pqe-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.pqe-btn {
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.pqe-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pqe-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.pqe-btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.pqe-btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* ===== Error Message ===== */
.pqe-error {
    display: none;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 30px;
    color: #c33;
}

.pqe-error.active {
    display: block;
    animation: pqe-shake 0.5s ease;
}

@keyframes pqe-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .pqe-container {
        margin: 15px auto;
    }
    
    .pqe-header {
        padding: 20px;
    }
    
    .pqe-header h2 {
        font-size: 22px;
    }
    
    .pqe-input-section,
    .pqe-results {
        padding: 20px;
    }
    
    .pqe-textarea {
        min-height: 180px;
    }
    
    .pqe-rate-button {
        padding: 12px 35px;
        font-size: 16px;
    }
    
    .pqe-total-score-value {
        font-size: 56px;
    }
    
    .pqe-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .pqe-criteria-grid {
        grid-template-columns: 1fr;
    }
    
    .pqe-actions {
        flex-direction: column;
    }
    
    .pqe-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .pqe-total-score {
        padding: 20px;
    }
    
    .pqe-total-score-value {
        font-size: 48px;
    }
    
    .pqe-criterion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .pqe-criterion-score {
        align-self: flex-end;
    }
}

/* ===== Print Styles ===== */
@media print {
    .pqe-rate-button,
    .pqe-actions {
        display: none !important;
    }
    
    .pqe-wrapper {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .pqe-results {
        display: block !important;
    }
}

/* ===== Admin Page Styles ===== */
.pqe-admin-wrap {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.pqe-admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.pqe-admin-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
}

.pqe-admin-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.pqe-admin-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pqe-admin-card h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.pqe-admin-card h3 {
    font-size: 16px;
    color: #555;
    margin: 20px 0 10px 0;
}

.pqe-admin-card p {
    color: #666;
    line-height: 1.6;
}

.pqe-admin-card code {
    background: #f4f4f4;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    color: #667eea;
}

.pqe-feature-list {
    list-style: none;
    padding: 0;
}

.pqe-feature-list li {
    padding: 10px 0 10px 30px;
    position: relative;
    color: #555;
}

.pqe-feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #11998e;
    font-weight: bold;
    font-size: 18px;
}

.pqe-criteria-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.pqe-criteria-table th,
.pqe-criteria-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.pqe-criteria-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.pqe-criteria-table tr:hover {
    background: #f8f9fa;
}

.pqe-score-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.pqe-score-badge.high {
    background: #d4edda;
    color: #155724;
}

.pqe-score-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.pqe-score-badge.low {
    background: #f8d7da;
    color: #721c24;
}
