/* 1. VARIABLES & RESET */
:root {
    --sidebar-width: 260px;
    --accent: #3b82f6; 
    --bg-body: #0f172a; 
    --bg-card: #1e293b; 
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    background: var(--bg-body);
    color: var(--text-main);
}

/* 2. GLOBAL LAYOUT ENGINE */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

main {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* 3. SITE NAVIGATION (ASIDE) */
aside {
    width: var(--sidebar-width);
    background: #020617;
    border-right: 1px solid var(--border);
    padding: 2rem;
    position: sticky;
    top: 0;
    box-sizing: border-box;
    height: 100vh;
}

nav strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

nav ul {
    list-style: none;
    padding: 0;
    margin-top: 0rem;
    margin-bottom: 1rem;
}

nav li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

nav li a:hover { color: var(--accent); }

.btn-add-model {
    display: block;
    background-color: #28a745; /* Green color */
    color: white;
    padding: 10px;
    margin: 10px 0;
    text-align: center;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
}

.btn-add-model:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.button-row {
        grid-column: 2; /* Align buttons under the input fields */
        display: flex;
        justify-content: space-between; /* Pushes Cancel to the right */
        align-items: center;
}

/* Filter System in Sidebar */
.filter-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 1.0rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
    color: var(--text-main);
}

.filter-group select {
    width: 100%;
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.7rem;
    border: 1px solid var(--border);
    padding: 0.4rem;
    border-radius: 4px;
    outline: none;
}

#applyFilters {
    grid-column: span 2;
    margin-top: 0.0rem;
}

/* 4. HEADER & UI COMPONENTS */
header {
    display: flex;
    align-items: center;
    padding: 1.5rem 2rem;
    background: #0f172a;
    border-bottom: 1px solid var(--border);
    gap: 20px;
}

.search-bar { flex-grow: 1; }
.search-bar input {
    width: 80%;
    padding: 0.8rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: white;
}

.default-btn {
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.default-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

.logo:hover {
    cursor: pointer;
    filter: brightness(1.2);
}

.input-group { margin-bottom: 1.2rem; }
.input-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }

/* Main Container for the Join Form */
.join-container {
    width: 350px;
    margin: 2rem auto;
    padding: 0rem 2rem 2rem 2rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Base Input Styling for the Join Form */
.join-container input {
    width: 100%;
    padding: 0.8rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: white;
    box-sizing: border-box;
}

/* Individual Input Group (Label + Input) */
.join-input-group {
    margin-bottom: 0.5rem; /* Spacing between each field */
    display: flex;
    flex-direction: column; /* Stacks Label on top of Input */
    gap: 0.5rem; /* Space between label and input */
    text-align: left;
}

.join-input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.join-input-group input {
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.join-input-group input:focus {
    outline: none;
    border-color: var(--accent); /* Highlights the field being typed in */
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

/* Password Visibility Wrapper & Toggle */
.password-wrapper { 
    position: relative; 
    display: flex; 
    align-items: center; 
}

.password-wrapper input { 
    padding-right: 3rem; 
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-weight: bold;
}

/* Messages */
.err-msg {
    color: #f87171;
    font-size: 1.0rem;
    font-weight: 500;
    padding-left: 0.5rem;
    margin-top: -0.3rem;
    margin-bottom: 1rem;
    width: 100%;
}

.message-msg {
    color: var(--accent);
    font-size: 1.0rem;
    font-weight: 500;
    padding-left: 0.5rem;
    margin-top: -0.3rem;
    margin-bottom: 1rem;
    width: 100%;
}
