body { 
    font-family: Arial, sans-serif; 
    background: #f4f4f4; 
    padding: 0; 
    margin: 0; 
}

.container { 
    max-width: 800px; 
    margin: 20px auto; 
    padding: 0 20px;
}

.card, .form-container, .auth-container, .chart-container { 
    background: #fff; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 0 10px rgba(0,0,0,0.1); 
    margin-bottom: 20px; 
}

.form-container, .auth-container {
    max-width: 400px;
    margin: 40px auto;
}

/* =========================================
   MODERN NAVIGATION BAR
========================================= */
.nav-bar { 
    background: #333; 
    color: white; 
    padding: 15px 25px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nav-greeting {
    font-size: 16px;
    color: #f4f4f4;
}

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

.nav-links a { 
    text-decoration: none; 
    color: #ccc;
    font-size: 14px;
    padding-bottom: 3px;
    transition: color 0.2s ease-in-out;
}

.nav-links a:hover {
    color: #4CAF50;
}

.nav-links a.active {
    color: #4CAF50;
    font-weight: bold;
    border-bottom: 2px solid #4CAF50; 
}

.nav-links a.logout {
    color: #ff4d4d;
    border-left: 1px solid #555;
    padding-left: 20px;
}

.nav-links a.logout:hover {
    color: #ff1a1a;
}

/* =========================================
   FORMS, BUTTONS & TABLES
========================================= */
input, select { 
    width: 100%; 
    padding: 10px; 
    margin: 8px 0 15px 0; 
    display: inline-block; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    box-sizing: border-box; 
    font-size: 16px; /* Prevents iOS auto-zoom on focus */
}

button { 
    width: 100%; 
    background-color: #4CAF50; 
    color: white; 
    padding: 14px 20px; 
    margin: 8px 0; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 16px;
    touch-action: manipulation; /* Optimizes tap delay */
}

button:hover { 
    background-color: #45a049; 
}

button.auth-btn {
    background: #007BFF;
}

button.auth-btn:hover {
    background: #0056b3;
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 10px; 
}

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

th { 
    background-color: #f8f9fa; 
}

tr:hover { 
    background-color: #f1f1f1; 
}

/* =========================================
   SUMMARY CARDS (DASHBOARD)
========================================= */
.summary-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    flex: 1;
    text-align: center;
}

.summary-card h3 {
    margin: 0;
    font-size: 16px;
    color: #555;
    text-transform: uppercase;
}

.summary-card p {
    margin: 10px 0 0 0;
    font-size: 24px;
    font-weight: bold;
}

.text-green { color: #28a745; }
.text-red { color: #dc3545; }
.text-blue { color: #007bff; }

#loading-overlay {
    display: none; 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(255, 255, 255, 0.9); z-index: 9999; 
    align-items: center; justify-content: center; flex-direction: column;
}

.spinner {
    border: 6px solid #ccc; border-top: 6px solid #007BFF; 
    border-radius: 50%; width: 50px; height: 50px; 
    animation: spin 1s linear infinite;
}

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

/* --- LANDING PAGE STYLES (index.php) --- */
.landing-page {
    font-family: Arial, sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.landing-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.landing-card {
    background: white;
    padding: 40px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-sizing: border-box;
}

.landing-card h1 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
}

.landing-card p {
    color: #666;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 30px;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    text-decoration: none;
    padding: 12px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-login {
    background-color: #007BFF;
    color: white;
}

.btn-login:hover {
    background-color: #0056b3;
}

.btn-register {
    background-color: #28a745;
    color: white;
}

.btn-register:hover {
    background-color: #218838;
}

/* --- GLOBAL FOOTER --- */
.site-footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 10px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.site-footer a {
    color: #4da3ff;
    text-decoration: none;
    font-weight: bold;
}

.site-footer a:hover {
    text-decoration: underline;
}

.footer-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================================
   MOBILE RESPONSIVE OVERRIDES
========================================= */
@media (max-width: 768px) {
    .nav-bar { flex-direction: column; text-align: center; padding: 15px; }
    .nav-links { justify-content: center; width: 100%; gap: 15px; }
    .nav-links a.logout { border-left: none; padding-left: 0; }
    .summary-container { flex-direction: column; gap: 15px; }
    .summary-card { width: 100%; box-sizing: border-box; }
    table { display: block; white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    th, td { padding: 10px 8px; font-size: 14px; }
    .btn { padding: 14px; }

    /* Forces charts to stack vertically and fit the phone screen */
    .split-layout {
        flex-direction: column !important;
    }
    .split-layout > div {
        min-width: 100% !important; 
        width: 100% !important;
        box-sizing: border-box;
    }
}