/* Shared Report Viewer Styles */

.shared-report-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.report-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

.report-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
}

.report-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Tab System */
.tab-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #e9ecef;
}

.tab-button.active {
    background: white;
    border-bottom-color: #007bff;
    color: #007bff;
}

.tab-content {
    padding: 0;
}

.tab-panel {
    display: none;
    min-height: 400px;
}

.tab-panel.active {
    display: block;
}

/* Side Tabs (Attacker/Defender) */
.side-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.side-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.side-tab:hover {
    background: #e9ecef;
}

.side-tab.active {
    background: white;
    border-bottom-color: #28a745;
    color: #28a745;
}

.side-content {
    display: none;
    padding: 20px;
}

.side-content.active {
    display: block;
}

/* Data Tables */
.data-table-container, .analytics-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.data-table, .analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
}

.data-table th, .analytics-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td, .analytics-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #dee2e6;
    text-align: right;
}

.data-table td:first-child, .analytics-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.data-table tbody tr:hover, .analytics-table tbody tr:hover {
    background: #f8f9fa;
}

/* Buffs Display */
.buffs-container {
    padding: 20px;
}

.buffs-data {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.buff-category {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #007bff;
}

.buff-category h4 {
    margin: 0 0 10px 0;
    color: #007bff;
    font-size: 1.1rem;
}

.buff-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #dee2e6;
}

.buff-item:last-child {
    border-bottom: none;
}

.buff-name {
    font-weight: 500;
}

.buff-value {
    color: #28a745;
    font-weight: 600;
}

/* Analytics Controls */
.analytics-controls {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 500;
    min-width: 100px;
}

.control-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Analytics Table Specific */
.analytics-table th:first-child {
    min-width: 200px;
}

.analytics-table th:not(:first-child) {
    min-width: 100px;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin-top: 30px;
}

.cta-section h2 {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
}

.cta-section p {
    margin: 0 0 25px 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.download-button {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 1.1rem;
}

.error {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 20px;
}

/* Loading State */
.loading-container {
    text-align: center;
    padding: 50px;
}

.loading-spinner {
    margin: 20px auto;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .shared-report-container {
        padding: 10px;
    }
    
    .report-header h1 {
        font-size: 2rem;
    }
    
    .report-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .tab-button {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    .data-table, .analytics-table {
        font-size: 0.8rem;
    }
    
    .data-table th, .analytics-table th,
    .data-table td, .analytics-table td {
        padding: 8px 4px;
    }
    
    .buffs-data {
        grid-template-columns: 1fr;
    }
    
    .cta-section h2 {
        font-size: 1.5rem;
    }
    
    .cta-section p {
        font-size: 1rem;
    }
}

/* Visualizations Container */
.visualizations-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

/* Visualization Controls */
.visualization-controls {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.visualization-controls .control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.visualization-controls .control-group label {
    font-weight: 600;
    color: #495057;
    min-width: auto;
}

.visualization-controls .control-group select {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
}

.control-row {
    display: flex;
    gap: 15px;
}

.control-row .control-group {
    flex: 1;
}

/* Three-Column Controls Grid */
.viz-controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 15px;
}

.viz-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Collapsible Filter Panel */
.filter-panel {
    margin-bottom: 15px;
}

.filter-toggle {
    width: 100%;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-toggle:hover {
    background: #e9ecef;
}

.filter-toggle .toggle-icon {
    transition: transform 0.2s;
    display: inline-block;
}

.filter-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

.filter-panel-content {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
    background: white;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.filter-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
}

.filter-tab:hover {
    background: #e9ecef;
}

.filter-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.filter-tab-content {
    padding: 15px;
}

.filter-tab-panel {
    display: none;
}

.filter-tab-panel.active {
    display: block;
}

.filter-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.filter-checkboxes label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.filter-btn {
    padding: 5px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.filter-btn:hover {
    background: #f8f9fa;
}

/* Metrics Checkboxes */
.metrics-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metrics-checkboxes label {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Generate Button */
.generate-button {
    width: 100%;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.generate-button:hover {
    background: #0056b3;
}

/* Visualization Display */
.visualization-display {
    position: relative;
    min-height: 400px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.visualization-image {
    max-width: 100%;
    height: auto;
}

.viz-loading {
    text-align: center;
}

.viz-loading .loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

.viz-error {
    text-align: center;
    color: #dc3545;
}

/* Responsive layout for smaller screens */
@media (max-width: 768px) {
    .visualization-controls {
        padding: 15px 20px;
    }
    
    .viz-controls-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .metrics-checkboxes {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
    }
    
    .filter-tab {
        padding: 8px 12px;
        font-size: 14px;
        flex: 1;
        min-width: 80px;
    }
    
    .filter-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .visualization-display {
        min-height: 300px;
    }
}

/* Extra small screens (phones) */
@media (max-width: 480px) {
    .visualizations-container {
        padding: 10px;
    }
    
    .visualization-controls {
        padding: 15px;
    }
    
    .viz-controls-grid {
        gap: 10px;
    }
    
    .metrics-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .filter-tab {
        padding: 6px 8px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .generate-button {
        padding: 10px 16px;
    }
}