/* base.css */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: #f8f9fa;
    color: #333;
    height: 100%; /* Ensure full height of the viewport */
    display: flex;
    flex-direction: column; /* Flexbox layout for the footer */
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Apply box-sizing globally */
*, *::before, *::after {
    box-sizing: inherit;
}

/* Ensure images and videos are responsive */
img, video {
    max-width: 100%;
    height: auto;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
    font-weight: normal;
    word-wrap: break-word; 
    word-break: break-word;
}

/* Define the navbar height again here to ensure consistency */
:root {
    --navbar-height: 60px; /* Matches default in navbar.css */
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 80px; /* Matches mobile height in navbar.css */
    }
}

/* Apply padding to body so that content starts below the navbar */
body {
    padding-top: var(--navbar-height); /* All content sits below the navbar */
}

/* Container no longer needs to push content down, body handles it */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center; 
    text-align: center;
    width: 100%;
    max-width: 100%;
    padding: 20px;
    min-height: calc(100vh - 80px);
    overflow-x: hidden;
}

/* Specific content areas */
.welcome-container,
.management-content {
    /* Remove margin-top here if it conflicts, body padding already ensures below nav */
    padding: 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Forms and inputs */
input, textarea, select, button {
    max-width: 100%;
    box-sizing: border-box;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

td, th {
    padding: 8px;
    border: 1px solid #ccc;
    word-wrap: break-word;
    word-break: break-word;
    text-align: left;
}

/* Preformatted text */
pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-x: auto;
}

/* Footer styles */
.footer {
    background-color: #000;
    color: #fff;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.footer-section {
    width: 100%;
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin: 5px 0;
}

.footer-section a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    word-wrap: break-word;
    word-break: break-word;
}

.footer-section a:hover {
    text-decoration: underline;
}

.footer-divider {
    border-top: 1px solid #444;
    width: 100%;
    margin: 10px 0;
}

.footer-left {
    font-size: 14px;
    color: #bbb;
    word-wrap: break-word;
    word-break: break-word;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container,
    .welcome-container,
    .form-container,
    .management-content {
        padding: 10px;
    }

    /* Footer adjustments for mobile */
    .footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-section {
        margin-bottom: 20px;
    }
}

body * {
    max-width: 100%;
}

button {
    word-wrap: break-word;
    word-break: break-word;
}

ul, ol {
    word-wrap: break-word;
    word-break: break-word;
}

blockquote, code {
    word-wrap: break-word;
    word-break: break-word;
    overflow-x: auto;
}

/* Canvas-specific styles */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    width: 100%;
    height: 100%;
    background: none !important;
}

/* Loader styles (unchanged) */
.loader {
    border: 16px solid #f3f3f3; 
    border-top: 16px solid #007acc;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1.5s linear infinite;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    pointer-events: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
