/* ====== Base Reset & Typography ====== */
* {
    box-sizing: border-box;
}

.container {
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f5f5f5; /* Light gray background like the app */
    color: #1a1a1a; /* Dark text for better contrast */
    line-height: 1.6;
    font-size: 16px;
    margin: 0;
    padding: 1rem;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: #8b0000; /* Dark red for headers to add color */
    margin-bottom: 0.5em;
}

h1 {
    border-bottom: 2px solid #8b0000; /* Underline for h1 */
    padding-bottom: 0.3em;
}

/* Links */
a {
    color: #8b0000; /* Dark red to match app theme */
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: #6b0000; /* Darker on hover */
    text-decoration: underline;
}

/* Paragraphs */
p {
    margin-bottom: 1em;
}

/* Buttons */
button, .btn {
    background-color: #8b0000; /* Dark red like the app buttons */
    color: white;
    border: none;
    padding: 0.6em 1.2em;
    border-radius: 12px; /* More rounded like the app */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
button:hover, .btn:hover {
    background-color: #6b0000; /* Darker red on hover */
    transform: translateY(-1px); /* Subtle lift effect */
}

/* Forms */
input, select, textarea {
    border: 1px solid #d0d0d0;
    border-radius: 8px; /* Slightly rounded */
    padding: 0.5em;
    width: 100%;
    font-size: 1em;
    background-color: white;
    transition: border-color 0.2s ease;
}
input:focus, select:focus, textarea:focus {
    border-color: #8b0000;
    outline: none;
    box-shadow: 0 0 4px rgba(139, 0, 0, 0.3);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
th, td {
    padding: 0.8em;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}
th {
    background-color: #8b0000; /* Red header for tables */
    color: white;
    font-weight: 600;
}
tr:hover {
    background-color: #fafafa; /* Subtle hover effect on rows */
}

/* ====== Navbar Tabs ====== */
.navbar {
    background-color: #4a4a4a; /* Dark gray like the app's bottom nav */
    display: flex;
    padding: 0;
    list-style: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 12px; /* Round the whole navbar */
    overflow: hidden; /* Clip the children to maintain rounded corners */
    margin: 0 auto 2rem auto;
    flex-wrap: wrap;
    max-width: 600px;
    width: 100%;
}

.navbar li {
    flex: 1;
}

.navbar li:first-child a {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.navbar li:last-child a {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.navbar a {
    display: block;
    padding: 0.8em 0.5em;
    text-align: center;
    color: #b0b0b0; /* Light gray for inactive tabs */
    font-weight: normal;
    border-bottom: 3px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar a:hover {
    background-color: #3a3a3a; /* Slightly darker on hover */
    color: white;
    text-decoration: none; /* No underline for nav items */
}

.navbar a.active {
    color: white; /* White text for active tab */
    background-color: #8b0000; /* Dark red for active tab */
    border-bottom: 3px solid #ff6b6b; /* Lighter red accent border */
}


/* Additional styles to match app appearance */
.header {
    background: linear-gradient(135deg, #8b0000 0%, #6b0000 100%); /* Gradient for visual interest */
    color: white;
    padding: 1.5em;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    color: white; /* Override red color for headers in header section */
    border: none;
    margin: 0;
}

.data-badge {
    background-color: #8b0000; /* Dark red badges like in the app */
    color: white;
    padding: 0.5em 1em;
    border-radius: 20px;
    display: inline-block;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(139, 0, 0, 0.2);
}

/* Card-like containers for content sections */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 1em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card h2, .card h3 {
    margin-top: 0;
}

/* ====== Mobile Responsive Design ====== */

/* Very narrow screens (up to 380px) */
@media (max-width: 380px) {
    .navbar {
        flex-direction: column;
        border-radius: 8px;
        overflow: visible;
    }
    
    .navbar li {
        flex: none;
    }
    
    .navbar li:first-child a {
        border-radius: 8px 8px 0 0;
    }
    
    .navbar li:last-child a {
        border-radius: 0 0 8px 8px;
    }
    
    .navbar a {
        padding: 0.8rem 0.5rem;
        font-size: 0.85rem;
        border-bottom: none;
        border-left: 3px solid transparent;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .navbar a.active {
        border-left: 3px solid #ff6b6b;
        border-bottom: none;
    }
}

/* Small mobile devices (381px to 480px) */
@media (min-width: 381px) and (max-width: 480px) {
    body {
        font-size: 14px;
        padding: 0.5rem;
    }
    
    .navbar a {
        padding: 0.7rem 0.4rem;
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .header {
        padding: 1rem;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* Narrow screens where text might wrap (481px to 600px) */
@media (min-width: 481px) and (max-width: 600px) {
    .navbar a {
        padding: 0.7em 0.3em;
        font-size: 0.85em;
    }
}

/* Medium mobile devices (601px to 768px) */
@media (min-width: 601px) and (max-width: 768px) {
    .navbar a {
        padding: 0.9em 0.7em;
        font-size: 0.95em;
    }
    
    body {
        padding: 0.75rem;
    }
}

/* Tablet and larger (769px and up) */
@media (min-width: 769px) {
    .container {
        padding: 0 2rem;
    }
    
    body {
        padding: 1.5rem;
    }
}
