/* --- Global Styles & Variables --- */
:root {
    --bg-color: #f8f9fc;
    --card-color: #ffffff; 
    --text-color: #212529; 
    --border-color: #e8eaf2;
    --shadow-color: rgba(91, 105, 228, 0.1);
    --primary-color: #5B69E4; 
    --primary-hover-color: #4a56c2;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 2rem;
}
.hidden { display: none !important; }

/* --- Auth Screen --- */
#auth-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 4rem);
}
.logo-container { margin-bottom: 2rem; }
.logo-image {
    /* Bigger logo on login page */
    width: 200px; 
    transition: transform 0.3s ease;
}
.logo-image:hover { transform: scale(1.03); }

.auth-container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px var(--shadow-color);
    width: 100%;
    max-width: 400px;
}
.auth-form h2 { text-align: center; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-color);
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 105, 228, 0.2);
}
.auth-form button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px 0 rgba(91, 105, 228, 0.39);
}
.auth-form button:hover { 
    background-color: var(--primary-hover-color);
    box-shadow: 0 6px 20px 0 rgba(91, 105, 228, 0.45);
    transform: translateY(-1px);
}
.form-toggle { text-align: center; margin-top: 1rem; font-size: 0.9rem; }
.form-toggle a { color: var(--primary-color); text-decoration: none; font-weight: 600; }

/* --- App Screen --- */
.app-header {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 3rem auto;
    gap: 1.5rem;
}
.logo-container-small { margin-right: auto; }
.logo-image-small { 
    /* Slightly bigger logo on main page */
    height: 150px; 
}
.logout-button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.logout-button:hover { background-color: #f8f9fc; border-color: var(--primary-color); }

/* Breadcrumbs */
#breadcrumbs { flex-grow: 1; text-align: left; font-weight: 600; }
#breadcrumbs button {
    background: none; border: none; color: var(--text-color);
    font-family: 'Nunito', sans-serif; font-size: 1rem;
    font-weight: 600; cursor: pointer; padding: 5px;
}
#breadcrumbs button:hover { color: var(--primary-color); }
#breadcrumbs span { margin: 0 5px; color: #aaa; }

/* --- Items Grid --- */
#bookmarks-container {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 25px; width: 100%; max-width: 1200px; margin: auto;
}
.item-card {
    position: relative; width: 150px; height: 150px;
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow-color);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 15px; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.item-card:not(.add-card):hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-color);
    border-color: var(--primary-color);
}
.item-card a, .folder-link {
    text-decoration: none; color: var(--text-color);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; height: 100%; cursor: pointer;
}
.item-icon {
    width: 48px; height: 48px; margin-bottom: 10px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.bookmark-icon { background-color: #f8f9fa; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); }
.folder-icon { color: var(--primary-color); font-size: 40px; } 
.item-name { font-weight: 600; font-size: 0.9rem; text-align: center; word-break: break-all; }

/* Delete Button */
.delete-item {
    position: absolute; top: 8px; right: 8px; width: 24px; height: 24px;
    background-color: rgba(0, 0, 0, 0.05); color: #999;
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; cursor: pointer; font-size: 0.8rem;
    opacity: 0; transform: scale(0.8); transition: all 0.2s ease;
}
.item-card:hover .delete-item { opacity: 1; transform: scale(1); }
.delete-item:hover { background-color: #ff5252; color: white; }

/* "Add New" Card */
.add-card {
    background-color: transparent;
    border: 2px dashed var(--border-color);
    cursor: pointer; box-shadow: none;
}
.add-card:hover { background-color: var(--card-color); border-color: var(--primary-color); }
.add-card-content {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #cdd1da; transition: color 0.2s ease;
}
.add-card:hover .add-card-content { color: var(--primary-color); }
.add-card i { font-size: 2rem; margin-bottom: 10px; }
.add-card span { font-weight: 600; }

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center; z-index: 1000;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.show-modal { opacity: 1; visibility: visible; }
.modal {
    background: white; padding: 30px; border-radius: 16px; width: 90%; max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); position: relative;
    transform: scale(0.95); transition: transform 0.3s ease;
}
.modal-overlay.show-modal .modal { transform: scale(1); }
.modal-close-btn { position: absolute; top: 15px; right: 15px; cursor: pointer; color: #aaa; font-size: 1.2rem; }
.item-type-selector { display: flex; justify-content: center; gap: 20px; margin-bottom: 1.5rem; }
.item-type-selector label { font-weight: 600; cursor: pointer; }
.item-type-selector input { margin-right: 5px; accent-color: var(--primary-color); }

#item-form button {
    width: 100%; padding: 12px; border: none; border-radius: 8px;
    background-color: var(--primary-color); color: white; font-size: 1rem;
    font-weight: 700; cursor: pointer; margin-top: 1rem; transition: all 0.2s;
    box-shadow: 0 4px 14px 0 rgba(91, 105, 228, 0.39);
}
#item-form button:hover {
    background-color: var(--primary-hover-color);
    box-shadow: 0 6px 20px 0 rgba(91, 105, 228, 0.45);
    transform: translateY(-1px);
}