/* Global Styles */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #EAF0F6; /* Light, cool blue-gray for background */
    color: #4A4A4A; /* Slightly darker gray for default text for better readability */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex; /* Make container a flex container to manage its children */
    flex-direction: column; /* Stack children vertically */
}
/* Layout Styles */
.header {
    padding: 20px 0;
    text-align: center;
}
.search-bar {
    width: 100%;
    margin-bottom: 20px;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px;
}

.card-grid {
    max-height: 60vh;
    overflow-y: auto;
}

.card {
    background-color: #FFFFFF; /* Pure White for card background for better contrast */
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Slightly more pronounced shadow */
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}
.card:hover {
    transform: translateY(-4px);
}
.card-name {
    font-size: 1em;
    color: #4A4A4A; /* Darker gray for card names */
}
.floating-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #EAF0F6; /* Matches body background */
    padding: 10px 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.footer-button {
    color: #4A4A4A; /* Darker gray for inactive buttons */
    text-decoration: none;
    font-size: 1em;
    padding: 5px 10px; /* Added padding for better tap target */
    border-radius: 4px;
}
.footer-button.active {
    color: #5D8BF4; /* Slightly more vibrant Soft Blue for active state */
    font-weight: bold; /* Make active button stand out */
}
/* Form Styles */
input[type="text"], textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #B0B0B0; /* Medium Gray for input border */
    border-radius: 8px;
    font-size: 1em;
    color: #4A4A4A; /* Darker gray for input text */
    background-color: #FFFFFF; /* White background for input */
    margin-bottom: 10px; /* Spacing between inputs */
    box-sizing: border-box; /* Include padding in element's total width and height */
}
input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: #5D8BF4; /* Soft Blue for focus border */
    box-shadow: 0 0 0 3px rgba(93, 139, 244, 0.25); /* More visible focus shadow */
}
/* Placeholder styles for sub-pages */
.placeholder-screen {
    display: flex; /* Default display for placeholder screens (hidden by JS) */
    flex-direction: column; /* Allow content to stack */
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.2em; /* Slightly smaller font for more content */
    color: #4A4A4A; /* Darker gray for placeholder text */
    text-align: center;
    padding: 20px; /* Add some padding */
    box-sizing: border-box; /* Include padding in element's total width and height */
}

/* Barcode Scanner Styles */
#interactive.viewport {
    position: relative;
    width: 100%;
    max-width: 300px; /* Limit scanner width */
    height: 150px; /* Adjust height as needed */
    overflow: hidden;
    background-color: #ccc;
    border-radius: 8px;
    margin-bottom: 20px;
}
#interactive.viewport canvas, #interactive.viewport video {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure video covers the area */
}
.scanner-controls {
    margin-bottom: 20px;
}
.scanner-controls button, .add-card-buttons button {
    background-color: #5D8BF4; /* Soft Blue */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.2s ease-in-out;
    min-width: 100px; /* Ensure buttons have a minimum width */
}
.scanner-controls button:hover, .add-card-buttons button:hover {
    background-color: #4A7BEA; /* Slightly darker blue on hover */
}
#barcode-result {
    margin-top: 20px;
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}
/* Specific styles for elements that should be hidden/shown */
.hidden {
    display: none !important;
}
