/* AltGovPH Shared CSS - Consistent Design System */

/* Base Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Ensure navbar is flush to top */
body > nav:first-child,
.altgovph-navbar {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove any space before navbar */
body > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure body has no top margin/padding */
html, body {
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove any space before the navbar specifically */
nav.altgovph-navbar {
    position: relative;
    top: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Force remove any space before navbar - most aggressive approach */
* {
    box-sizing: border-box;
}

html {
    margin: 0 !important;
    padding: 0 !important;
}

body {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure first element in body has no top spacing */
body > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
}

/* Remove spacing from any content blocks */
.block-content,
main,
article,
section {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure navbar is the first element with no spacing */
body > nav:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
    position: relative;
    top: 0 !important;
}

/* Hide KenchLightyear navigation and branding */
.navbar, .header, .navigation, .nav, .menu, .navbar-brand {
    display: none !important;
}

/* Hide KenchLightyear footer */
.footer {
    display: none !important;
}

/* AltGovPH Navigation Bar */
.altgovph-navbar {
    background: linear-gradient(135deg, #0038A8 0%, #CE1126 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.altgovph-navbar h1 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.altgovph-navbar .nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.altgovph-navbar .nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-weight: 500;
}

.altgovph-navbar .nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.altgovph-navbar .nav-links a.active {
    background-color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
}

/* Page Section Structure */
.page-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Correlation Page Structure */
.correlation-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.correlation-header {
    text-align: center;
    margin-bottom: 3rem;
}

.correlation-title {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.correlation-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title,
.budget-title,
.flood-title,
.correlation-title {
    font-size: 2.5rem;
    color: #0038A8 !important;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.3);
    font-weight: bold;
}

.page-subtitle,
.budget-subtitle,
.flood-subtitle,
.correlation-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
}

.page-disclaimer {
    background: #fff3cd;
    color: #856404;
    padding: 0.75em 1em;
    border-radius: 6px;
    margin: 1em auto 0.5em auto;
    font-size: 1em;
    font-weight: 500;
    max-width: 600px;
    text-align: center;
}

.page-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Section Titles */
.section-title {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.section-description {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Button Styling */
.btn {
    background: linear-gradient(135deg, #0038A8 0%, #CE1126 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: background 0.3s ease;
    cursor: pointer;
}

.btn:hover {
    background: linear-gradient(135deg, #002a7a 0%, #a00e1f 100%);
    color: white;
}

/* Card Styling */
.card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.feature-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.feature-card h3 {
    color: #0038A8;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Grid Layouts */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.stat-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-card .description {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Chart Containers */
.chart-container {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.chart-title {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    margin: 20px 0;
}

/* Table Styling */
.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Loading States */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading-spinner::before {
    content: "⏳";
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .altgovph-navbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .altgovph-navbar .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-content {
        padding: 1rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .chart-wrapper {
        height: 300px;
    }
}

/* Creator Credit */
.creator-credit {
    background: linear-gradient(135deg, #0038A8 0%, #CE1126 100%);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.creator-content h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.creator-content p {
    margin-bottom: 1rem;
    opacity: 0.95;
    line-height: 1.6;
}

.creator-content strong {
    font-weight: 700;
    color: #FFD700;
}

.creator-content em {
    font-style: italic;
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Donation Footer */
.donation-footer {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 15px;
    padding: 2.5rem;
    margin: 2rem 0;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.donation-content h3 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.donation-content p {
    margin-bottom: 1rem;
    opacity: 0.95;
    line-height: 1.6;
    font-size: 1.1rem;
}

.paypal-donation-button {
    display: inline-block;
    background: #0070ba;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 112, 186, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.paypal-donation-button:hover {
    background: #005ea6;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 112, 186, 0.6);
    text-decoration: none;
    color: white;
}

.paypal-icon {
    font-size: 1.3rem;
    margin-right: 0.5rem;
}

.paypal-text {
    font-weight: 700;
}

.paypal-subtext {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.3rem;
}

/* Hide KenchLightyear navigation and branding */
.navbar, .header, .navigation, .nav, .menu, .navbar-brand {
    display: none !important;
}

/* Hide KenchLightyear footer */
.footer {
    display: none !important;
}

/* Override body styling for government theme */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Style the main content area */
.container, .main-content {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 10px !important;
    padding: 20px !important;
    margin-top: 20px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

/* Style buttons with Philippine flag colors */
.btn, button {
    background: linear-gradient(135deg, #0038A8 0%, #CE1126 100%) !important;
    color: white !important;
    border: none !important;
}

.btn:hover, button:hover {
    background: linear-gradient(135deg, #002a7a 0%, #a00e1f 100%) !important;
}

/* Page Section Styles */
.page-section, .budget-section, .flood-section, .correlation-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.page-container, .budget-container, .flood-container, .correlation-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-header, .budget-header, .flood-header, .correlation-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title, .budget-title, .flood-title, .correlation-title {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-subtitle, .budget-subtitle, .flood-subtitle, .correlation-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
}

.page-content, .budget-content, .flood-content, .correlation-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Page Disclaimer Styles */
.page-disclaimer, .budget-disclaimer, .flood-disclaimer, .correlation-disclaimer {
    background: #fff3cd;
    color: #856404;
    padding: 0.75em 1em;
    border-radius: 6px;
    margin: 1em 0 0.5em 0;
    font-size: 1em;
    font-weight: 500;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Override any KenchLightyear colors */
h1, h2, h3, h4, h5, h6 {
    color: #0038A8;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-white {
    color: white;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Tab Navigation Styles */
.budget-tab-nav {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.budget-tab-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    color: #666;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.budget-tab-btn:hover:not(.disabled) {
    background: #e9ecef;
    color: #333;
}

.budget-tab-btn.active {
    background: white;
    color: #667eea;
    border-color: #667eea;
    border-bottom: 2px solid white;
    position: relative;
    bottom: -2px;
}

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

.budget-tab-content {
    position: relative;
}

.budget-tab-panel {
    display: none;
}

.budget-tab-panel.active {
    display: block;
}
