/**
 * GERADOR V3 - ESTILOS PARA SISTEMA DE AVALIAÇÕES ESTÁTICAS
 * 
 * Este arquivo contém todos os estilos CSS para o sistema de avaliações
 * estáticas, incluindo modal de login e componentes de interface.
 * 
 * @author Manus AI
 * @version 3.0.0
 * @since 2025-01-01
 */

/* ============================================================================
   ESTILOS GERAIS DO SISTEMA DE AVALIAÇÕES
   ============================================================================ */

.recipe-ratings-static {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f9f9f9 !important;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.recipe-ratings-static * {
    box-sizing: border-box;
}

/* ============================================================================
   TÍTULO E CABEÇALHO
   ============================================================================ */

.ratings-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ff6b35;
    padding-bottom: 0.5rem;
}

/* ============================================================================
   RESUMO DAS AVALIAÇÕES
   ============================================================================ */

.ratings-summary {
    margin-bottom: 2rem;
}

.ratings-overview {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.average-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 150px;
}

.rating-number {
    font-size: 3rem;
    font-weight: bold;
    color: #ff6b35;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.rating-count {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.no-ratings {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* ============================================================================
   BREAKDOWN DAS AVALIAÇÕES
   ============================================================================ */

.ratings-breakdown {
    flex: 1;
    min-width: 200px;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.star-label {
    font-size: 0.85rem;
    color: #666;
    min-width: 60px;
}

.bar-container {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #ff8c42);
    transition: width 0.3s ease;
}

.bar-count {
    font-size: 0.85rem;
    color: #666;
    min-width: 20px;
    text-align: right;
}

/* ============================================================================
   SISTEMA DE ESTRELAS
   ============================================================================ */

.stars-container {
    display: inline-flex;
    gap: 2px;
}

.stars-display .stars-container {
    margin: 0.5rem 0;
}

.star {
    font-size: 1.2rem;
    color: #ddd;
    transition: color 0.2s ease;
    cursor: default;
}

.star.filled {
    color: #ff6b35;
}

.star.half-filled {
    background: linear-gradient(90deg, #ff6b35 50%, #ddd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stars-container.interactive .star {
    cursor: pointer;
}

.stars-container.interactive .star:hover {
    color: #ff8c42;
}

/* ============================================================================
   BOTÃO DE AVALIAÇÃO
   ============================================================================ */

.rating-form-section {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 2px dashed #ff6b35;
}

.rate-recipe-btn {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.rate-recipe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    background: linear-gradient(135deg, #ff8c42, #ff6b35);
}

.rate-recipe-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
}

.login-hint {
    margin: 1rem 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

/* ============================================================================
   LISTA DE AVALIAÇÕES
   ============================================================================ */

.ratings-list {
    margin-top: 2rem;
}

.comments-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.rating-item {
    background: white !important;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.2s ease;
}

.rating-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.rating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.rating-date {
    font-size: 0.85rem;
    color: #666;
}

.user-rating .stars-container {
    font-size: 1rem;
}

.rating-comment {
    color: #555;
    line-height: 1.6;
}

.rating-comment p {
    margin: 0;
}

/* ============================================================================
   MODAL DE LOGIN
   ============================================================================ */

.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

/* ============================================================================
   FORMULÁRIO DE LOGIN
   ============================================================================ */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.login-btn,
.register-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    color: white;
}

.login-btn:hover {
    background: linear-gradient(135deg, #ff8c42, #ff6b35);
    transform: translateY(-1px);
}

.login-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.register-btn {
    background: white;
    color: #ff6b35;
    border: 2px solid #ff6b35;
}

.register-btn:hover {
    background: #ff6b35;
    color: white;
}

.form-links {
    text-align: center;
    margin-top: 1rem;
}

.form-links a {
    color: #ff6b35;
    text-decoration: none;
    font-size: 0.9rem;
}

.form-links a:hover {
    text-decoration: underline;
}

/* ============================================================================
   MENSAGENS DE FEEDBACK
   ============================================================================ */

.login-message {
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.9rem;
    display: none;
}

.login-message.info {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.login-message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.login-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* ============================================================================
   RESPONSIVIDADE
   ============================================================================ */

@media (max-width: 768px) {
    .recipe-ratings-static {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .ratings-overview {
        flex-direction: column;
        gap: 1rem;
    }
    
    .average-rating {
        min-width: auto;
    }
    
    .rating-number {
        font-size: 2.5rem;
    }
    
    .rate-recipe-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .rating-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .ratings-title {
        font-size: 1.3rem;
    }
    
    .rating-item {
        padding: 1rem;
    }
    
    .star {
        font-size: 1rem;
    }
    
    .rating-bar {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .star-label {
        min-width: 50px;
        font-size: 0.8rem;
    }
}

/* ============================================================================
   ANIMAÇÕES E TRANSIÇÕES
   ============================================================================ */

.rating-item {
    animation: fadeInUp 0.3s ease-out;
}

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

.bar-fill {
    animation: fillBar 1s ease-out 0.5s both;
}

@keyframes fillBar {
    from {
        width: 0;
    }
}

/* ============================================================================
   ACESSIBILIDADE
   ============================================================================ */

.recipe-ratings-static *:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

.recipe-ratings-static button:focus,
.recipe-ratings-static input:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* Reduz animações para usuários que preferem movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    .recipe-ratings-static *,
    .recipe-ratings-static *::before,
    .recipe-ratings-static *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   IMPRESSÃO
   ============================================================================ */

@media print {
    .login-modal,
    .rate-recipe-btn,
    .rating-form-section {
        display: none !important;
    }
    
    .recipe-ratings-static {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}


a.rate-recipe-btn {
    color: #fff;
    border-bottom: 2px solid orange;
}

p.login-hint a {
    border-bottom: none;
    color: #b33900;
    font-weight: bold;
}

a.rate-recipe-btn:hover {
    color: #fff;
    border-bottom: 2px solid #b33900;
}