/* General Styles */
:root {
    /* New Color Palette inspired by references */
    --primary-color: #FFFFFF; /* White */
    --secondary-color: #C0C0C0; /* Silver */
    --accent-color: #A0A0A0; /* Darker Silver */
    --danger-color: #E57373; /* Muted Red */
    --text-color: #F0F0F0; /* Light gray for main text */
    --text-color-dark: #B0B0B0; /* Darker gray for secondary text */
    --bg-color-start: #1C1C2C; /* Dark Blue-Gray */
    --bg-color-end: #0F0F1A; /* Even Darker Blue-Purple */
    --card-bg: rgba(255, 255, 255, 0.08); /* Slightly transparent white for glassmorphism */
    --card-bg-light: rgba(255, 255, 255, 0.05); /* Even lighter transparent white */
    --border-color: rgba(255, 255, 255, 0.15); /* Subtle border for glass effect */
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.6);
    --gradient-card-start: rgba(255, 255, 255, 0.1); /* Very subtle transparent gradient */
    --gradient-card-end: rgba(255, 255, 255, 0.05); /* Very subtle transparent gradient */
    --gradient-glass-start: rgba(255, 255, 255, 0.1);
    --gradient-glass-end: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%; /* Ensure html and body take full viewport height */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--bg-color-start), var(--bg-color-end));
    display: flex;
    justify-content: center;
    align-items: center; /* Center the app vertically */
    min-height: 100vh;
    padding: 20px; /* Increase overall padding for body */
    overflow: auto; /* Allow scrolling if content overflows */
}

#app {
    background: var(--card-bg); /* Use transparent background for glassmorphism */
    border-radius: 30px; /* More rounded corners */
    box-shadow: 0 15px 40px var(--shadow-medium);
    width: 100%;
    max-width: 450px; /* Slightly wider for better spacing */
    height: 90vh; /* Fixed height for the app container */
    overflow: hidden; /* Hide scrollbars for the main app container */
    display: flex;
    flex-direction: column;
    position: relative; /* For absolute positioning of elements if needed */
    padding-bottom: 100px; /* Increased space for bottom nav to prevent cutoff */
    border: 1px solid var(--border-color); /* Subtle border */
    backdrop-filter: blur(10px); /* Glassmorphism effect */
    -webkit-backdrop-filter: blur(10px); /* Safari support */
}

/* Page Transitions */
.page {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
    padding: 25px; /* Increase padding for pages */
    flex-grow: 1; /* Allow pages to take available space */
    overflow-y: auto; /* Enable scrolling for page content */
}

.page.active {
    display: flex; /* Use flex for active pages to manage content layout */
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header Styles */
.dashboard-header { /* Specific class for dashboard header */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align items to the start */
    margin-bottom: 25px; /* More space below header */
    padding-bottom: 20px; /* More padding below header */
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.dashboard-header .user-info {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between; /* Space between welcome and profile pic */
    margin-bottom: 20px; /* More space below user info */
}

.dashboard-header h2 {
    color: var(--text-color);
    font-size: 2em; /* Slightly larger font for welcome */
    margin-bottom: 0; /* Remove bottom margin */
}

.profile-picture {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent-color), var(--secondary-color)); /* Gradient for profile pic */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.header-actions {
    display: flex;
    gap: 15px; /* More gap between dropdowns */
    flex-wrap: wrap;
    justify-content: center; /* Center dropdowns */
    width: 100%; /* Take full width */
}

/* Forms */
.auth-form, #equipment-form {
    display: flex;
    flex-direction: column;
    gap: 20px; /* More gap between form elements */
    margin-top: 25px; /* More margin top */
    padding: 25px; /* More padding */
    background: var(--card-bg-light); /* Use transparent background */
    border-radius: 20px; /* More rounded */
    box-shadow: 0 8px 20px var(--shadow-light);
    border: 1px solid var(--border-color); /* Subtle border */
    backdrop-filter: blur(5px); /* Glassmorphism effect */
    -webkit-backdrop-filter: blur(5px); /* Safari support */
}

.auth-form h3 {
    color: var(--text-color);
    margin-bottom: 10px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 16px; /* More padding */
    border: 1px solid var(--border-color);
    border-radius: 15px; /* Even more rounded corners */
    font-size: 1.05em; /* Slightly larger font */
    background: rgba(255, 255, 255, 0.05); /* Very subtle transparent background */
    color: var(--text-color); /* Light text color */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none; /* Remove default outline */
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.3); /* Glow effect */
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

button {
    background: var(--card-bg-light); /* Use transparent background for buttons */
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 14px 25px; /* More padding */
    border-radius: 15px; /* More rounded corners */
    cursor: pointer;
    font-size: 1.05em; /* Slightly larger font */
    font-weight: 600; /* Semi-bold */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 15px var(--shadow-light);
    text-shadow: none; /* Remove text shadow */
    backdrop-filter: blur(5px); /* Glassmorphism effect */
    -webkit-backdrop-filter: blur(5px); /* Safari support */
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--shadow-medium);
    filter: brightness(1.1); /* Slightly brighter on hover */
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px var(--shadow-light);
}

.action-btn {
    background: var(--card-bg-light); /* Transparent background for action buttons */
    border: 1px solid var(--border-color);
    color: var(--text-color);
    box-shadow: none; /* Remove default shadow */
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15); /* Slightly more opaque on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow-light);
}

.delete-btn {
    background: rgba(255, 107, 107, 0.2); /* Muted red with transparency */
    border-color: rgba(255, 107, 107, 0.3);
    color: var(--danger-color);
}

.delete-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    filter: none;
}

/* Messages */
.message {
    text-align: center;
    margin-top: 15px;
    padding: 12px;
    border-radius: 15px;
    font-weight: bold;
    color: var(--text-color);
    background: var(--card-bg-light); /* Transparent background */
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.message.success {
    background: rgba(255, 255, 255, 0.2); /* White with transparency */
    color: var(--primary-color); /* White text */
    border-color: rgba(255, 255, 255, 0.3);
}

.message.error {
    background: rgba(229, 115, 115, 0.2); /* Muted red with transparency */
    color: var(--danger-color); /* Muted red text */
    border-color: rgba(229, 115, 115, 0.3);
}

/* Links */
a {
    color: var(--primary-color); /* Use primary color (white) for links */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color); /* Change link hover to secondary color */
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Dashboard Specific Styles */
#equipment-list {
    display: grid;
    gap: 15px;
    margin-top: 25px; /* Slightly more margin top for equipment list */
}

/* Hero Section Styles */
.hero-section {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    margin-top: 25px; /* More margin top */
    margin-bottom: 25px; /* More margin bottom */
}

.hero-card {
    flex: 1;
    background: linear-gradient(45deg, var(--gradient-glass-start), var(--gradient-glass-end)); /* Subtle transparent gradient */
    border-radius: 20px;
    padding: 30px; /* More padding */
    text-align: center;
    box-shadow: 0 10px 25px var(--shadow-medium);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 130px; /* Taller cards */
    color: var(--text-color); /* Use text color for subtle background */
    text-shadow: none; /* Remove text shadow */
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color); /* Subtle border */
    backdrop-filter: blur(8px); /* Stronger glassmorphism effect */
    -webkit-backdrop-filter: blur(8px); /* Safari support */
}

.hero-card::before { /* Abstract pattern for hero card */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="15" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="10" fill="rgba(255,255,255,0.05)"/><rect x="10" y="60" width="20" height="20" fill="rgba(255,255,255,0.05)"/><path d="M50 0 L100 50 L50 100 L0 50 Z" fill="rgba(255,255,255,0.02)"/></svg>') no-repeat center center; /* More subtle pattern */
    background-size: cover;
    opacity: 0.7; /* Slightly more visible */
    z-index: 0;
}

.hero-card h3 {
    color: var(--text-color); /* Use text color */
    font-size: 1.2em;
    margin-bottom: 10px;
    z-index: 1;
}

.hero-card .hero-value {
    font-size: 3em; /* Larger font */
    font-weight: bold;
    color: var(--primary-color); /* Use primary color for value */
    z-index: 1;
}

.equipment-card {
    background: var(--card-bg-light); /* Transparent background */
    border: 1px solid var(--border-color);
    border-radius: 20px; /* More rounded */
    padding: 25px; /* More padding */
    box-shadow: 0 8px 20px var(--shadow-light);
    display: flex;
    flex-direction: column;
    gap: 15px; /* More gap */
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px); /* Glassmorphism effect */
    -webkit-backdrop-filter: blur(5px); /* Safari support */
}

.equipment-card h3 {
    color: var(--text-color); /* Use general text color */
    font-size: 1.4em;
    margin-bottom: 5px;
}

.equipment-card p {
    font-size: 0.95em;
    color: var(--text-color-dark); /* Use darker text color for secondary info */
}

.equipment-card .status {
    font-weight: bold;
    padding: 6px 12px; /* More padding */
    border-radius: 10px; /* More rounded status pills */
    display: inline-block;
    font-size: 0.9em; /* Slightly larger font */
}

.status.available {
    background: rgba(255, 255, 255, 0.2); /* White with transparency */
    color: var(--primary-color); /* White text */
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.status.unavailable {
    background: rgba(229, 115, 115, 0.2); /* Muted red with transparency */
    color: var(--danger-color); /* Muted red text */
    border: 1px solid rgba(229, 115, 115, 0.3);
}

.equipment-card .actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.equipment-card .actions button {
    padding: 10px 15px; /* More padding */
    font-size: 0.95em; /* Slightly larger font */
    flex-grow: 1; /* Allow buttons to grow and fill space */
}

/* Equipment Details Specific Styles */
.equipment-detail-card {
    background: var(--card-bg-light); /* Transparent background */
    border: 1px solid var(--border-color);
    border-radius: 20px; /* More rounded */
    padding: 25px; /* More padding */
    box-shadow: 0 8px 20px var(--shadow-light);
    backdrop-filter: blur(5px); /* Glassmorphism effect */
    -webkit-backdrop-filter: blur(5px); /* Safari support */
    margin-bottom: 20px;
    color: var(--text-color);
    position: relative; /* For absolute positioning of elements if needed */
    overflow: hidden; /* Hide overflow for inner elements */
}

.equipment-detail-card p {
    margin-bottom: 10px;
    font-size: 1.1em;
    color: var(--text-color-dark); /* Use darker text color for secondary info */
}

.equipment-detail-card strong {
    color: var(--text-color); /* Use general text color */
}

.equipment-detail-card .detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.equipment-detail-card .detail-actions button {
    flex-grow: 1;
}

#transaction-history {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.transaction-item {
    background: var(--card-bg-light); /* Transparent background */
    border: 1px solid var(--border-color);
    border-radius: 15px; /* More rounded */
    padding: 15px; /* More padding */
    margin-bottom: 10px;
    font-size: 0.95em; /* Slightly larger font */
    color: var(--text-color-dark);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(3px); /* Subtle glassmorphism */
    -webkit-backdrop-filter: blur(3px);
}

.transaction-item strong {
    color: var(--text-color); /* Light text for names */
}

/* Logs Specific Styles */
#activity-logs {
    margin-top: 20px;
}

.log-item {
    background: var(--card-bg-light); /* Transparent background */
    border: 1px solid var(--border-color);
    border-radius: 15px; /* More rounded */
    padding: 15px; /* More padding */
    margin-bottom: 10px;
    font-size: 0.95em; /* Slightly larger font */
    color: var(--text-color-dark);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(3px); /* Subtle glassmorphism */
    -webkit-backdrop-filter: blur(3px);
}

.log-item strong {
    color: var(--text-color); /* Light text for names */
}

/* Responsive Adjustments (for slightly larger mobile devices or tablets) */
@media (min-width: 600px) {
    #app {
        padding: 30px;
        padding-bottom: 70px; /* Space for bottom nav */
    }

    .header-actions {
        flex-wrap: nowrap;
    }

    .equipment-card .actions button {
        flex-grow: 0; /* Prevent buttons from growing too much on wider screens */
    }
}

/* Bottom Navigation Panel */
#bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--card-bg); /* Transparent background for nav */
    border-top-left-radius: 30px; /* More rounded */
    border-top-right-radius: 30px; /* More rounded */
    box-shadow: 0 -8px 25px var(--shadow-medium);
    display: flex;
    justify-content: space-evenly; /* Distribute space more evenly */
    align-items: center;
    padding: 15px 10px; /* Add horizontal padding */
    height: 80px; /* Slightly taller nav bar */
    border-top: 1px solid var(--border-color); /* Subtle border */
    backdrop-filter: blur(10px); /* Glassmorphism effect */
    -webkit-backdrop-filter: blur(10px); /* Safari support */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color-dark);
    font-size: 0.9em; /* Slightly larger font */
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 5px; /* Adjust horizontal padding for items */
    flex: 1;
    min-width: 60px; /* Ensure a minimum width for each item */
}

.nav-item i {
    font-size: 1.6em; /* Slightly larger icons */
    margin-bottom: 5px;
    color: var(--text-color-dark); /* Icons are darker for subtle look */
}

.nav-item:hover {
    color: var(--primary-color); /* White on hover */
    transform: translateY(-3px); /* Lift effect on hover */
}

.nav-item:hover i {
    color: var(--primary-color); /* White on hover */
}