:root {
    --header-height: 60px;
    --navbar-height: 70px;
    --color-main-bg: #000000; /* Main black background */
    --color-content-bg: #1a1a1a; /* Slightly lighter black for content area */
    --color-text-light: #FFFFFF; /* White text for readability on black */
    --color-accent: #ffd700; /* Gold color for active elements */
    --color-header-bg: #ADD8E6; /* Light blue for header background */
    --color-header-text: #000000; /* Black text for header */
    --color-navbar-bg: #00008B; /* Dark blue for navigation bar background */
    --color-tool-bg: #6495ED; /* Cornflower Blue for general tool item background */
    --color-tool-bg-darker: #4169E1; /* Royal Blue - slightly darker for specific tools */
    --color-tool-text: #FFFFFF; /* White text for tools */
    --color-light-blue-border: #E0FFFF; /* Very light blue for icon borders (Light Cyan) */
}

/* Base styles for mobile-first approach */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* Prevent scrolling on body, content will scroll */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    background-color: var(--color-main-bg); /* Set body background to main black */
}

/* Header */
.app-header {
    background-color: var(--color-header-bg); /* Light blue header */
    color: var(--color-header-text); /* Black text */
    padding: 0 15px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    width: 100%;
    box-sizing: border-box; /* Include padding in width calculation */
    z-index: 1000; /* Ensure header is on top */
}

.app-header h1 {
    margin: 0;
    font-size: 1.5em; /* Responsive font size */
    color: var(--color-header-text); /* Black text for header title */
}

/* Main Content Area */
.app-content {
    flex-grow: 1;
    margin-top: var(--header-height); /* Space for fixed header */
    margin-bottom: var(--navbar-height); /* Space for fixed navbar */
    overflow-y: auto; /* Allow content to scroll */
    padding: 15px;
    background-color: var(--color-content-bg); /* Dark gray background for content */
    color: var(--color-text-light); /* White text for content */
    box-sizing: border-box;
}

.app-content .page {
    display: none; /* Hide pages by default */
}

.app-content .page.active {
    display: block; /* Show active page */
}

/* PDF Tools Grid */
.pdf-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Two columns for larger screens, one for small */
    gap: 15px; /* Space between tool items */
    padding: 10px 0; /* Some padding above/below the grid */
}

.pdf-tool-item {
    background-color: var(--color-tool-bg-darker); /* Darker blue for all tool items */
    color: var(--color-tool-text); /* White text for tools */
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Subtle shadow for depth */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    min-height: 120px; /* Ensure a minimum height for visual consistency */
    border: 2px solid var(--color-light-blue-border); /* Light blue border for the tool box */
}

.pdf-tool-item:hover {
    transform: translateY(-3px); /* Slight lift effect on hover */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.tool-header {
    display: flex;
    justify-content: flex-end; /* Align name and icon to top-right */
    align-items: center;
    margin-bottom: 10px; /* Space between header and description */
    width: 100%; /* Ensure it takes full width to justify content */
}

.tool-name {
    font-size: 1.1em;
    font-weight: bold;
    margin-right: 8px; /* Space between name and icon */
    white-space: normal; /* Allow text to wrap onto a second line if too long */
    text-align: right; /* Align name to the right, next to the icon */
    flex-shrink: 1; /* Allow the text to shrink if necessary */
}

.tool-icon {
    font-size: 1.8em; /* Larger icon size */
    /* Add a very light blue border/outline to the icon */
    border: 2px solid var(--color-light-blue-border); /* Light blue border */
    border-radius: 5px; /* Slightly rounded corners for the border */
    padding: 3px; /* Add some padding inside the border */
    box-sizing: content-box; /* Ensure padding and border don't affect icon size calculation */
}

.tool-description {
    font-size: 0.9em;
    line-height: 1.4;
    text-align: left; /* Ensure description text is left-aligned */
    margin: 0; /* Remove default paragraph margin */
    flex-grow: 1; /* Allow description to take up remaining space in the box */
}

/* Navigation Bar */
.app-navbar {
    background-color: var(--color-navbar-bg); /* Dark blue navigation bar */
    height: var(--navbar-height);
    display: flex;
    justify-content: space-around; /* Distribute items evenly */
    align-items: center;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000; /* Ensure navbar is on top */
    box-shadow: 0 -2px 5px rgba(0,0,0,0.5); /* Subtle shadow above navbar */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-text-light); /* White color for inactive tabs (contrasts with dark blue) */
    text-decoration: none;
    font-size: 0.8em;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
    min-width: 80px; /* Ensure tap target is large enough */
}

.nav-item i {
    font-size: 1.5em; /* Icon size */
    margin-bottom: 5px;
}

.nav-item span {
    font-size: 0.9em; /* Text size below icon */
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.15); /* Slightly visible background for active tab */
    color: var(--color-accent); /* Gold color for active icon/text */
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.08); /* Lighter hover background */
}