:root {
    --primary-color: #007bff;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* Vivid Purple/Blue Gradient */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: 1px solid rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --text-color: #ffffff;
    /* White text for better contrast on dark/vivid bg */
    --text-color-secondary: #e0e0e0;
    --card-text: #333;
    /* Keep dark text for white cards inside glass if needed, or switch */
    --border-radius: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-gradient);
    background-attachment: fixed;
    /* Keep gradient fixed */
    color: var(--text-color);
    min-height: 100vh;
    overscroll-behavior-y: none;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.view {
    height: 100%;
    overflow-y: auto;
    padding-bottom: 90px;
    /* Space for bottom nav */
}

/* Glass Container Base */
.glass {
    background: var(--glass-bg);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    border: var(--glass-border);
}

/* Auth Container */
.auth-container {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80vh;
    /* Centered nicely */
    margin: 20px;
}

/* Inputs & Buttons - Glassy Style */
input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-sizing: border-box;
    font-size: 16px;
    /* iOS Fix */
    background: rgba(255, 255, 255, 0.2);
    /* Semi-transparent input */
    color: #fff;
    outline: none;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

input:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: #fff;
}

button {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    min-height: 44px;
}

button:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.4);
}

button.danger-btn {
    background: rgba(220, 53, 69, 0.6);
    border-color: rgba(220, 53, 69, 0.8);
}

.link {
    color: #fff;
    cursor: pointer;
    text-decoration: underline;
    font-weight: bold;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h2 {
    margin: 0;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tab-pane {
    display: none;
    padding: 1rem;
}

.tab-pane.active {
    display: block;
}

/* Bottom Nav - Glassy */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    /* Floating look */
    left: 20px;
    right: 20px;
    width: auto;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.nav-item {
    background: none;
    color: rgba(255, 255, 255, 0.5);
    /* Dimmer inactive state */
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    /* Small label text */
    padding: 0;
    transition: color 0.3s, transform 0.2s;
    border: none;
    /* Reset button border */
    box-shadow: none;
    /* Remove button shadow inside nav */
    min-height: auto;
    /* Reset min-height constraint for these buttons */
}

.nav-item .icon {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    display: block;
}

.nav-item.active {
    color: #fff;
    transform: translateY(-2px);
    /* Slight lift */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.nav-item:active {
    transform: scale(0.95);
    background: none;
    /* Prevent background change on click */
}

/* Cards (API, Profile, Msgs) - Glassy */
.api-card,
.profile-card,
.msg-card {
    background: rgba(255, 255, 255, 0.15);
    /* Slightly clearer */
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.msg-card {
    padding: 15px;
    margin-top: 0;
    /* List gap handles spacing */
    transition: transform 0.2s;
    background: rgba(255, 255, 255, 0.1);
}

.msg-card:active {
    transform: scale(0.98);
}

.msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.msg-title {
    font-weight: 600;
    font-size: 16px;
    color: #fff;
}

.msg-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.msg-body {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

code {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    display: block;
    word-break: break-all;
    margin: 10px 0;
    font-family: monospace;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Banners (Install/Notify) */
.banner {
    position: fixed;
    bottom: 100px;
    /* Above floating nav */
    left: 20px;
    right: 20px;
    background: rgba(20, 20, 20, 0.8);
    /* Dark glass for contrast */
    color: white;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideUp 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.banner.hidden {
    display: none;
}

.banner button {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
    margin-left: 10px;
    background: rgba(255, 255, 255, 0.2);
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 20px;
}

/* Auth View adjustments */
#login-form h2,
#register-form h2,
#recovery-form h2 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}