/* Custom styles for IPH Reports */

/* Base responsive controls */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Ensure all containers respect viewport width */
.container, .max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl, .max-w-3xl, .max-w-2xl {
    max-width: 100%;
    overflow-x: hidden;
}

/* Loading animation improvements */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Radar chart container */
#radarChart {
    max-width: 100%;
    height: auto;
}

/* Ensure canvas is responsive */
canvas {
    max-width: 100% !important;
    height: auto !important;
}

/* Radar chart container - altura mínima, largura relativa */
.radar-chart-container {
    position: relative;
    width: 100%;
    max-width: 90vw;
    margin: 0 auto;
    min-height: 300px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(93, 63, 211, 0.1);
}

/* Pillar score cards */
.pillar-card {
    @apply bg-gray-50 rounded-lg p-3 sm:p-4 border-l-4;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 640px) {
    .pillar-card {
        @apply p-3;
    }
}

.pillar-card:hover {
    @apply shadow-md;
}

/* Text breaking for long content */
.break-anywhere {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Score indicators - DEPRECATED: Now using horizontal bars */
/*
.score-indicator {
    @apply inline-block w-16 h-16 rounded-full flex items-center justify-center text-white font-bold text-sm;
}
*/

/* Benchmark status badges */
.status-badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
    white-space: nowrap;
}

.status-critico {
    @apply bg-red-100 text-red-800;
}

.status-alerta {
    @apply bg-orange-100 text-orange-800;
}

.status-desenvolvimento {
    @apply bg-yellow-100 text-yellow-800;
}

.status-alto_potencial {
    @apply bg-green-100 text-green-800;
}

.status-excelencia {
    @apply bg-purple-100 text-purple-800;
}

/* AI Analysis styling */
#ai-analysis-content {
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#ai-analysis-content h4 {
    @apply text-base sm:text-lg font-semibold text-gray-900 mt-4 sm:mt-6 mb-2 sm:mb-3;
}

#ai-analysis-content p {
    @apply mb-3 sm:mb-4 text-gray-700 text-sm sm:text-base;
}

#ai-analysis-content ul {
    @apply ml-3 sm:ml-4 mb-3 sm:mb-4 space-y-1 sm:space-y-2;
}

#ai-analysis-content li {
    @apply text-gray-700 text-sm sm:text-base;
}

#ai-analysis-content strong {
    @apply font-semibold text-gray-900;
}

/* Progress bars */
.progress-bar {
    transition: width 1.5s ease-in-out;
}

/* Progress bars for company panel */
.progress-container {
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 1.5s ease-in-out;
    min-width: 0%;
    display: block;
}

/* Ensure progress bars are visible even with small values */
.progress-fill[style*="width: 0%"] {
    min-width: 0%;
}

.progress-fill[style*="width: 0.0%"] {
    min-width: 0%;
}

/* Floating share button */
.floating-share-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    z-index: 1000;
    transition: all 0.3s ease;
}

@media (max-width: 640px) {
    .floating-share-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

.floating-share-btn:hover {
    transform: scale(1.1);
}

/* Share Modal Styles */
#shareModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 9999 !important;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Modal content responsive adjustments */
@media (max-width: 768px) {
    #shareModalContent {
        margin: 0 !important;
        border-radius: 1rem 1rem 0 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        transform: translateY(100%) !important;
        transition: transform 0.3s ease-in-out !important;
    }
    
    #shareModalContent.show {
        transform: translateY(0) !important;
    }
}

@media (min-width: 769px) {
    #shareModalContent {
        border-radius: 1rem !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    /* Force all containers to respect mobile width */
    .max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Ensure tables are scrollable */
    .overflow-x-auto {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Reduce radar chart size on mobile */
    #radarChart {
        max-width: 280px !important;
        max-height: 280px !important;
    }
    
    .pillar-card {
        @apply text-sm p-3;
    }
    
    /* Force break long words */
    h1, h2, h3, h4, h5, h6, p, span, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .shadow-sm {
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}