/* General Styling */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #212529;
    --error-color: #dc3545;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#app-container {
    width: 100%;
    max-width: 900px;
    margin: 20px;
}

.hidden {
    display: none !important;
}

/* Authentication Section */
#auth-container {
    display: flex;
    justify-content: center;
}

.auth-box {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-box h2 {
    margin-top: 0;
}

.auth-toggle {
    display: flex;
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.auth-toggle button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.auth-toggle button.active {
    background-color: var(--primary-color);
    color: white;
}

form input[type="email"],
form input[type="password"],
form input[type="text"],
form select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
}

form button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
}

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.checkbox-container input {
    margin-right: 0.5rem;
}

.checkbox-container a {
    color: var(--primary-color);
    text-decoration: none;
}

.error-message {
    color: var(--error-color);
    margin-top: 1rem;
    min-height: 1em;
}

/* Main App */
#main-app {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

header h1 {
    margin: 0;
    font-size: 1.75rem;
}

header div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header #logout-btn {
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Admin Panel */
#admin-panel {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

#admin-panel h3 {
    margin-top: 0;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

#add-item-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

#add-item-form #item-name,
#add-item-form #item-category,
#add-item-form button,
#category-specific-fields {
    grid-column: span 2;
}

#add-item-form #cancel-edit-btn {
    background-color: var(--secondary-color);
}

/* Category Navigation */
#category-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

#category-nav span {
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0.5rem;
    border-radius: 50%;
    line-height: 1;
}

#category-nav span:hover {
    transform: scale(1.1);
}

#category-nav span.active-category {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Items List */
.item-card {
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.item-details h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.item-details p {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.rating-section {
    text-align: right;
}

.rating-slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.rating-slider-container input[type="range"] {
    width: 150px;
}

.rating-slider-container span {
    font-weight: 600;
    font-size: 1.1rem;
    width: 25px;
}

.admin-item-controls button {
    margin-left: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Styles for Rated vs. Not-Rated Items */
.item-card.not-rated .user-rating-status em {
    color: var(--secondary-color);
    font-weight: 500;
}

.item-card.not-rated .rating-slider-container {
    opacity: 0.6;
    transition: opacity 0.2s ease-in-out;
}

.item-card.not-rated:hover .rating-slider-container {
    opacity: 1;
}

.user-rating-status {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-top: 4px;
    min-height: 1.2em;
}

.global-rating {
    font-size: 0.9rem;
    color: var(--secondary-color);
}


/* Modals & Banners */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #343a40;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 1001;
}

.cookie-banner button {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}