/**
 * Estilos para a página de visualização de relatórios
 * Baseado no design do site de referência TBDC
 */

/* === RESET E VARIÁVEIS === */
#report-content {
    display: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
}

#report-content * {
    box-sizing: border-box;
}

/* === LOADING E ERROR === */
.report-loading, .report-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0077FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* === HEADER === */
.report-header {
    background: linear-gradient(135deg, #1D2D50 0%, #2a4073 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.report-logo {
    height: 50px;
    width: auto;
}

.header-text h1 {
    color: white;
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.action-btn .icon {
    font-size: 1.1rem;
}

/* === CONTAINER PRINCIPAL === */
.report-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    min-height: calc(100vh - 80px);
}

.report-main {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: calc(100vh - 160px);
}

/* === SIDEBAR === */
.report-sidebar {
    background: #f8f9fa;
    padding: 2rem 1.5rem;
    border-right: 1px solid #e9ecef;
}

.visit-info {
    margin-bottom: 2rem;
}

.info-section {
    margin-bottom: 1.5rem;
}

.info-section h3 {
    color: #1D2D50;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.info-section h4 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #333;
    font-weight: 500;
    margin: 0;
}

.responsible-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.responsible-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0077FF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.responsible-name {
    font-weight: 600;
    color: #1D2D50;
}

.location-map {
    background: #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #666;
}

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.map-icon {
    font-size: 2rem;
}

/* === CONTEÚDO PRINCIPAL === */
.report-content-main {
    padding: 2rem;
    overflow-y: auto;
}

.observations-section {
    margin-bottom: 3rem;
}

.observations-section h2 {
    color: #1D2D50;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0077FF;
}

.observations-text {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #0077FF;
}

.observations-text p {
    margin-bottom: 1rem;
    color: #555;
    line-height: 1.7;
}

.observations-text p:last-child {
    margin-bottom: 0;
}

/* === SEÇÃO DE ÁUDIO === */
.audio-section {
    margin-bottom: 2rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
}

.audio-section h3 {
    color: #1D2D50;
    margin-bottom: 1rem;
}

.audio-player-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.audio-player {
    width: 100%;
    height: 40px;
}

.audio-transcription {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    border-left: 3px solid #0077FF;
}

.audio-transcription h4 {
    color: #1D2D50;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.audio-transcription p {
    color: #555;
    font-style: italic;
    margin: 0;
}

/* === GALERIA DE MÍDIA === */
.media-gallery-section {
    margin-bottom: 3rem;
}

.media-gallery-section h2 {
    color: #1D2D50;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0077FF;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.media-item {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.media-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.media-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 40px;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-item:hover .media-overlay {
    opacity: 1;
}

.zoom-icon {
    color: white;
    font-size: 2rem;
}

.media-title {
    padding: 1rem;
    background: white;
    color: #333;
    font-weight: 500;
    text-align: center;
    font-size: 0.9rem;
}

/* === LIGHTBOX === */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(0,0,0,0.9);
}

#lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.lightbox-info {
    padding: 1.5rem;
}

.lightbox-info h3 {
    color: #1D2D50;
    margin-bottom: 0.5rem;
}

.lightbox-info p {
    color: #666;
    margin: 0;
}

/* === FEEDBACK === */
.feedback-section {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid #e9ecef;
}

.feedback-container {
    text-align: center;
}

.feedback-question {
    font-size: 1.1rem;
    color: #1D2D50;
    margin-bottom: 1rem;
    font-weight: 500;
}

.feedback-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.feedback-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.feedback-btn.positive:hover {
    border-color: #28a745;
    background: #28a745;
    color: white;
}

.feedback-btn.negative:hover {
    border-color: #dc3545;
    background: #dc3545;
    color: white;
}

.feedback-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === FOOTER === */
.report-footer {
    background: #1D2D50;
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
}

.footer-logo {
    height: 30px;
    width: auto;
}

.footer-text {
    margin: 0;
    font-size: 0.9rem;
    color: #ccc;
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
    .report-main {
        grid-template-columns: 1fr;
    }
    
    .report-sidebar {
        order: 2;
        border-right: none;
        border-top: 1px solid #e9ecef;
    }
    
    .report-content-main {
        order: 1;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .media-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .feedback-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .feedback-btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .report-container {
        margin: 0;
        box-shadow: none;
    }
    
    .report-content-main,
    .report-sidebar {
        padding: 1rem;
    }
    
    .media-gallery {
        grid-template-columns: 1fr;
    }
    
    .action-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .header-text h1 {
        font-size: 1.4rem;
    }
}
