/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    color: #2563eb;
    background-color: #f8fafc;
}

.nav-item.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.nav-item i {
    margin-right: 8px;
    font-size: 16px;
}

.nav-item span {
    font-size: 14px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

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

.content-header {
    margin-bottom: 20px;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.content-header p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 20px;
}

/* Power BI Container */
.powerbi-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 720px;
}

.powerbi-container iframe {
    width: 100%;
    height: 720px;
    border: none;
    display: block;
}

/* Footer */
.footer {
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    padding: 10px 20px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-left .powerbi-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.footer-left .powerbi-link:hover {
    text-decoration: underline;
}

.footer-center .pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

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

.page-info {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.footer-right .zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-btn, .fullscreen-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    font-size: 12px;
}

.zoom-btn:hover, .fullscreen-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.zoom-level {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-item {
        padding: 12px 15px;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item i {
        margin-right: 0;
        font-size: 18px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .content-header h1 {
        font-size: 24px;
    }
    
    .powerbi-container iframe {
        height: 500px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .footer-left, .footer-center, .footer-right {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-item {
        padding: 10px 12px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .content-header h1 {
        font-size: 20px;
    }
    
    .powerbi-container iframe {
        height: 400px;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #6b7280;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Fullscreen Mode */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background-color: #000;
}

.fullscreen .powerbi-container {
    height: 100vh;
    border-radius: 0;
}

.fullscreen .powerbi-container iframe {
    height: 100vh;
}

/* Tab Transition Effects */
.tab-transition {
    transition: all 0.3s ease-in-out;
}

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

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Troubleshooting Modal */
.troubleshooting-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.troubleshooting-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.troubleshooting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.troubleshooting-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
}

.troubleshooting-body {
    padding: 24px;
}

.troubleshooting-body h3 {
    color: #1f2937;
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.troubleshooting-body h3:first-child {
    margin-top: 0;
}

.troubleshooting-body ol, .troubleshooting-body ul {
    margin-bottom: 16px;
    padding-left: 20px;
}

.troubleshooting-body li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.troubleshooting-body code {
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.troubleshooting-body a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.troubleshooting-body a:hover {
    text-decoration: underline;
}

/* Enhanced Error Message */
.error-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.error-message ul {
    list-style-type: disc;
    margin: 0 auto;
}

.error-message li {
    margin-bottom: 4px;
}

/* Network Status Indicator */
.network-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    transition: all 0.3s ease;
}

.network-status.online {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.network-status.offline {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
