/**
 * ITReviews Templates Stylesheet
 * 
 * 리뷰 폼과 리스트 템플릿을 위한 기본 스타일시트
 * 
 * @package ITReviews
 * @since 1.0.0
 */

/* ==========================================================================
   기본 변수 및 설정
   ========================================================================== */
:root {
    --itreviews-primary: #0073aa;
    --itreviews-primary-hover: #005a87;
    --itreviews-success: #46b450;
    --itreviews-warning: #ffb900;
    --itreviews-error: #dc3232;
    --itreviews-text: #1e1e1e;
    --itreviews-text-light: #757575;
    --itreviews-border: linear-gradient(90deg, #2B68FF 0%, #6854FF 100%);
    --itreviews-bg: #ffffff;
    --itreviews-bg-light: #f6f7f7;
    --itreviews-star-filled: #ffc107;
    --itreviews-star-empty: #e0e0e0;
    --itreviews-radius: 8px;
    --itreviews-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --itreviews-transition: all 0.3s ease;
}

/* ==========================================================================
   리뷰 폼 스타일
   ========================================================================== */
.itreviews-form-container {
    background: var(--itreviews-bg);
    border: 1px solid var(--itreviews-border);
    border-radius: var(--itreviews-radius);
    padding: 32px;
    margin: 24px auto;
    box-shadow: var(--itreviews-shadow);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.itreviews-form-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--itreviews-border);
}

.itreviews-form-title {
    color: var(--itreviews-text);
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.itreviews-form-description {
    color: var(--itreviews-text-light);
    margin: 0;
    font-size: 16px;
}

.itreviews-form-description strong {
    color: var(--itreviews-primary);
    font-weight: 600;
}

.itreviews-review-form {
    display: grid;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.col-half {
    /* 그리드 아이템 스타일 */
}

.form-label {
    font-weight: 600;
    color: var(--itreviews-text);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.required-star {
    color: var(--itreviews-error);
    font-weight: bold;
}

.form-control {
    padding: 12px 16px;
    border: 2px solid var(--itreviews-border);
    border-radius: var(--itreviews-radius);
    font-size: 16px;
    line-height: 1.5;
    transition: var(--itreviews-transition);
    background: var(--itreviews-bg);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--itreviews-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.form-control::placeholder {
    color: var(--itreviews-text-light);
    opacity: 0.8;
}

.form-control.over-limit {
    border-color: var(--itreviews-error);
}

.character-count {
    text-align: right;
    font-size: 14px;
    color: var(--itreviews-text-light);
    margin-top: 4px;
}

.form-help {
    font-size: 14px;
    color: var(--itreviews-text-light);
    margin-top: 4px;
}

/* 평점 입력 스타일 */
.rating-group {
    background: var(--itreviews-bg-light);
    padding: 20px;
    border-radius: var(--itreviews-radius);
    border: 1px solid var(--itreviews-border);
}

.rating-stars {
    display: flex;
    gap: 4px;
    margin: 12px 0;
}

.rating-stars .star {
    font-size: 32px;
    color: var(--itreviews-star-empty);
    cursor: pointer;
    transition: var(--itreviews-transition);
    user-select: none;
}

.rating-stars .star:hover,
.rating-stars .star.hover,
.rating-stars .star.filled {
    color: var(--itreviews-star-filled);
    transform: scale(1.1);
}

.rating-text {
    margin-top: 8px;
    font-size: 16px;
    font-weight: 500;
    color: var(--itreviews-primary);
    min-height: 24px;
}

/* 체크박스 스타일 */
.checkbox-group {
    margin: 12px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--itreviews-primary);
}

.checkmark {
    display: none; /* 기본 체크박스 사용 */
}

/* 제출 버튼 */
.submit-group {
    margin-top: 8px;
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--itreviews-radius);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--itreviews-transition);
    min-width: 140px;
}

.btn-primary {
    background: var(--itreviews-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--itreviews-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.btn-primary:disabled {
    background: var(--itreviews-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loading {
    display: none;
}

/* 알림 메시지 */
.form-messages {
    margin-top: 20px;
}

.form-messages .success,
.form-messages .error {
    padding: 12px 16px;
    border-radius: var(--itreviews-radius);
    font-weight: 500;
    margin-bottom: 12px;
}

.form-messages .success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-messages .error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-notice {
    margin-top: 20px;
    padding: 16px;
    background: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: var(--itreviews-radius);
    font-size: 14px;
    color: #0c5460;
}

.form-notice p {
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   리뷰 목록 스타일
   ========================================================================== */
.itreviews-list {
    max-width: 1000px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 리뷰 요약 */
.reviews-summary {
    background: var(--itreviews-bg);
    border: 1px solid var(--itreviews-border);
    border-radius: var(--itreviews-radius);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: var(--itreviews-shadow);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.reviews-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--itreviews-text);
    margin: 0;
}

.average-rating .rating-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--itreviews-text);
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 18px;
}

.star.filled {
    color: var(--itreviews-star-filled);
}

.star.empty {
    color: var(--itreviews-star-empty);
}

.rating-text {
    font-size: 14px;
    color: var(--itreviews-text-light);
}

.rating-breakdown {
    display: grid;
    gap: 12px;
}

.rating-row {
    display: grid;
    grid-template-columns: 50px 1fr 80px;
    align-items: center;
    gap: 16px;
}

.rating-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--itreviews-text);
}

.rating-bar {
    height: 12px;
    background: var(--itreviews-bg-light);
    border-radius: 6px;
    overflow: hidden;
}

.rating-fill {
    height: 100%;
    background: var(--itreviews-star-filled);
    transition: width 0.5s ease;
}

.rating-count {
    font-size: 14px;
    color: var(--itreviews-text-light);
    text-align: right;
    font-weight: 500;
}

/* 필터 및 정렬 */
.reviews-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    min-width: 120px;
}

.filter-group select:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.1);
}

/* 리뷰 아이템 */
.review-item {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.review-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.reviewer-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.reviewer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.reviewer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.reviewer-details h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.review-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.review-date {
    font-size: 13px;
    color: #666;
}

.verified-badge, .recommend-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.verified-badge {
    background: #d4edda;
    color: #155724;
}

.recommend-badge {
    background: #cce7ff;
    color: #004085;
}

.review-rating {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 16px;
    color: #ddd;
}

.star.filled {
    color: #ff6b35;
}

.star.empty {
    color: #ddd;
}

.rating-number {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.review-content {
    margin-bottom: 16px;
}

.review-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.review-text {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 12px;
}

.review-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.review-pros, .review-cons {
    padding: 12px;
    border-radius: 8px;
}

.review-pros {
    background: #f0f9f0;
    border-left: 3px solid #28a745;
}

.review-cons {
    background: #fdf2f2;
    border-left: 3px solid #dc3545;
}

.pros-title, .cons-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.review-pros p, .review-cons p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* 리뷰 액션 버튼 */
.review-actions {
    display: flex;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.helpful-btn, .report-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.helpful-btn:hover {
    background: #f8f9fa;
    border-color: #28a745;
    color: #28a745;
}

.helpful-btn.voted {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.helpful-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.report-btn:hover {
    background: #f8f9fa;
    border-color: #dc3545;
    color: #dc3545;
}

.report-btn.reported {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.report-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 더보기 버튼 */
.itreviews-load-more-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 24px auto;
    padding: 12px 24px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.itreviews-load-more-btn:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.itreviews-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 로딩 인디케이터 */
.itreviews-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    color: #666;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 더 이상 리뷰 없음 메시지 */
.itreviews-no-more {
    text-align: center;
    padding: 24px;
    color: #666;
    font-style: italic;
}

/* 에러 메시지 */
.itreviews-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    text-align: center;
}

.itreviews-error .retry-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    margin-top: 8px;
    cursor: pointer;
    font-size: 13px;
}

.itreviews-error .retry-btn:hover {
    background: #c82333;
}

/* 토스트 메시지 */
.itreviews-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.itreviews-toast.show {
    transform: translateX(0);
}

.itreviews-toast-success {
    border-left: 4px solid #28a745;
}

.itreviews-toast-error {
    border-left: 4px solid #dc3545;
}

.itreviews-toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    margin-left: auto;
}

.toast-close:hover {
    color: #333;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .itreviews-filters {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-group {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .filter-group label {
        min-width: 60px;
    }
    
    .review-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .review-rating {
        align-items: flex-start;
    }
    
    .review-pros-cons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .review-actions {
        flex-wrap: wrap;
    }
    
    .itreviews-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* 리뷰 편집 폼 스타일 */
.itreviews-edit-form {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.edit-form-inner {
    max-width: 100%;
}

.edit-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.edit-form-field {
    flex: 1;
}

.edit-form-field label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.edit-form-field input,
.edit-form-field select,
.edit-form-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.edit-form-field input:focus,
.edit-form-field select:focus,
.edit-form-field textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.edit-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.edit-form-field-rating {
    min-width: 140px;
}

.edit-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.itreviews-btn-cancel,
.itreviews-btn-save {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 70px;
}

.itreviews-btn-cancel {
    background: #6c757d;
    color: white;
}

.itreviews-btn-cancel:hover {
    background: #5a6268;
}

.itreviews-btn-save {
    background: #007cba;
    color: white;
}

.itreviews-btn-save:hover:not(:disabled) {
    background: #005a87;
}

.itreviews-btn-save:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 성공 메시지 스타일 */
.itreviews-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
}

.itreviews-message.success {
    background: #28a745;
}

.itreviews-message.error {
    background: #dc3545;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 반응형 처리 */
@media (max-width: 768px) {
    .edit-form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .edit-form-field-rating {
        min-width: auto;
    }
    
    .edit-form-actions {
        flex-direction: column;
    }
    
    .itreviews-btn-cancel,
    .itreviews-btn-save {
        width: 100%;
    }
} 