:root {
    --app-bg: #F0F4F8; /* Light grayish-blue app background */
    --surface: #FFFFFF; /* Pure white for cards */
    --primary: #1A73E8; /* Android/Google Blue */
    --primary-hover: #1557B0;
    --text-main: #202124;
    --text-muted: #5F6368;
    --border-color: #E8EAED;
    
    /* FIX: Mapping the missing calculator colors to your theme variables */
    --accent-blue: var(--primary);       /* Maps your blue tint */
    --btn-bg: var(--app-bg);             /* Uses the light gray-blue for normal buttons */
    --btn-hover: #E2E8F0;                /* Soft gray for button hover states */
    --bg-color: var(--app-bg);           /* Maps old background name to new one */
    
    /* Android Geometry */
    --radius-card: 24px;
    --radius-btn: 50px; /* Pill shape */
    
    /* Layered Shadows */
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-hover: 0 12px 32px rgba(26, 115, 232, 0.15);
}

body {
    margin: 0;
    background-color: var(--app-bg);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* THIS RESTORES THE FONT */
    line-height: 1.6;
    overflow-x: hidden;
}

/* The "App Open" Cascade Animation */
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Header Styling (Matched to Homepage) */
header {
    background: white; /* Changed to solid white for a cleaner look */
    position: relative; /* THIS FIXES IT: Stops the header from following you */
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 15px 0;
}

.header-content {
    max-width: 1400px;
    color: var(--accent-blue);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 20px;
}

.logo-container img {
    height: 50px;
    margin-right: 15px;
}

.title-container h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--primary);
}

.tagline {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}


/* --- Top Icon Row Styling --- */
.top-icon-row {
    max-width: 1400px;
    margin: 20px auto 10px auto; 
    padding: 0 20px;
    display: flex;
    gap: 30px; 
    justify-content: center; 
}

.img-icon-link {
    display: inline-block;
    transition: transform 0.2s ease;
    text-decoration: none;
}

.img-icon-link img {
    width: 45px; 
    height: auto;
    display: block;
    opacity: 0.85; 
    transition: opacity 0.2s ease;
}

.img-icon-link:hover {
    transform: translateY(-3px); 
}

.img-icon-link:hover img {
    opacity: 1; 
}

/* The Main Calculator Box */
.content {
    width: 95%; /* Takes up most of the screen on mobile */
    max-width: 1000px; /* Stops growing at 1000px on desktop */
    margin: 20px auto 40px auto; /* Centers the box */
    padding: 30px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

/* Table Styling */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 20px 0;
    font-family: 'Times New Roman', serif;
    table-layout: auto;
}

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

th {
    background-color: #333;
    color: white;
    white-space: nowrap;
    padding: 10px 5px;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

#input-section {
    margin-top: 20px;
}

input[type="text"] {
    padding: 8px;
    width: 200px;
}

#result-display {
    margin-top: 30px;
    padding: 15px;
    background: #eef;
    border-left: 5px solid #007bff;
}

#dynamic-inputs {
    display: flex;
    flex-wrap: nowrap; 
    gap: 10px;
    margin: 20px 0;
    overflow-x: auto; 
    padding-bottom: 10px;
}

.char-case {
    flex: 0 0 auto; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

.char-case input {
    width: 60px; 
    text-align: center;
}

.char-case label {
    font-size: 0.9rem;
    color: #555;
}

#output {
    font-size: 1.4rem;
    font-family: 'Times New Roman', serif;
}

#table-container {
    width: 100%;
    overflow-x: auto; 
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

button, .calc-btn {
    background-color: #007bff;
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
}

button:hover, .calc-btn:hover {
    background-color: #0056b3;
}

.reset-btn {
    background-color: #6c757d; 
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.reset-btn:hover {
    background-color: #5a6268;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 30px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid #ddd;
    background-color: white;
    width: 100%; /* Fixed the overflow here */
    box-sizing: border-box;
}

footer a {
    color: var(--border-color);
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    color: var(--accent-blue);
}
