/**
 * Comments Section Styles for GenesisOwl
 * Integrates with existing design system
 */

/* Comments Section */
.comments-section {
    padding: 4rem 0;
}

.comments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Comment Card */
.comment-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-normal);
    border-left: 4px solid var(--primary);
}

.comment-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.comment-author-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.comment-author h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-dark);
}

.comment-date {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.comment-rating {
    color: var(--accent);
    font-size: 1.125rem;
    letter-spacing: 2px;
}

.comment-text {
    color: var(--text-dark);
    line-height: 1.7;
    margin: 0;
}

/* Comment Form Wrapper */
.comment-form-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

.comment-form-wrapper h3 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

/* Star Rating Input */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

.star-rating input[type="radio"] {
    display: none;
}

.star-rating label {
    cursor: pointer;
    font-size: 2rem;
    color: #ddd;
    transition: color var(--transition-fast);
}

.star-rating label:hover,
.star-rating label:hover~label,
.star-rating input[type="radio"]:checked~label {
    color: var(--accent);
}

.star-rating:hover label {
    color: #ddd;
}

.star-rating label:hover,
.star-rating label:hover~label {
    color: var(--accent);
}

/* Alert Messages */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

/* Empty State for Comments */
.comments-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}

.comments-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.comments-empty h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.comments-empty p {
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .comments-grid {
        grid-template-columns: 1fr;
    }

    .comment-card {
        padding: 1.25rem;
    }

    .author-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .star-rating label {
        font-size: 1.75rem;
    }

    .comment-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .comment-rating {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .comments-section {
        padding: 2rem 0;
    }

    .comment-author-section {
        gap: 0.5rem;
    }

    .author-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    .comment-author h4 {
        font-size: 0.9375rem;
    }

    .comment-text {
        font-size: 0.9375rem;
    }
}

/* Loading State */
.comment-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.comment-loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.star-rating input[type="radio"]:focus+label {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

/* Print Styles */
@media print {

    .comment-form-wrapper,
    .star-rating {
        display: none;
    }

    .comment-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}