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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    justify-content: space-between;
    max-width: 100% !important;
}

.navbar {
    background-color: #417054;
    color: white;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    height: 50px;
    width: auto;
    border-radius: 8px;
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.nav-brand {
    margin: 0;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
}

.nav-subtitle {
    margin: 0;
    font-size: 0.75rem;
    color: #d4d4d4;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.profile-menu {
    position: relative;
}

.profile-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #417054;
    font-size: 1rem;
    border: 2px solid white;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
    overflow: hidden;
}

.profile-pic:hover {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-initials {
    display: block;
}

.dropdown-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background-color: white;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #e1e1e1;
}

.dropdown-name {
    margin: 0;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.dropdown-email {
    margin: 0.25rem 0 0 0;
    color: #666;
    font-size: 0.85rem;
}

.dropdown-item {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    color: #333;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.btn-signout {
    color: #d13438;
}

.btn {

    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: #417054;
    color: white;
}

.btn-primary:hover {
    background-color: #2d4f3a;
}

.btn-danger {
    background-color: #d13438;
    color: white;
}

.btn-danger:hover {
    background-color: #a4373a;
}

.main-content {
    flex: 1;
    overflow-y: visible;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.content {
    position: relative;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.home-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.home-page h1 {
    margin-bottom: 1rem;
}

.centered-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 180px);
    padding: 2rem;
    text-align: center;
}

/* Notes container max-height and custom scrollbar */
#notesContainer {
    max-height: 56vh;
    overflow-y: auto;
    padding-right: 0.5rem; /* keep space for scrollbar */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(65,112,84,0.5) transparent;
}

/* Webkit custom scrollbar */
#notesContainer::-webkit-scrollbar {
    width: 8px;
}
#notesContainer::-webkit-scrollbar-track {
    background: transparent;
}
#notesContainer::-webkit-scrollbar-thumb {
    background: rgba(65,112,84,0.5);
    border-radius: 999px;
}
#notesContainer::-webkit-scrollbar-thumb:hover {
    background: rgba(65,112,84,0.7);
}

.content h1 {
    color: #417054;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.content p {
    color: #666;
    line-height: 1.6;
}

.token-info {
    background-color: #f0f7f3;
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 2rem;
    text-align: left;
}

.token-info h2 {
    color: #417054;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.token-info p {
    margin: 0.5rem 0;
    text-align: left;
}

/* Loading overlay styles */
#loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    gap: 12px;
    flex-direction: column;
}

#loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0,0,0,0.08);
    border-top-color: #417054;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#loading .loading-text {
    color: #417054;
    font-size: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background-color: #fed9cc;
    color: #a4373a;
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid #d13438;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - 200px);
}

#error-msg {
    margin: 0;
}

.footer {
    background-color: #417054;
    color: #d4d4d4;
    text-align: center;
    padding: 1rem 2rem;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    margin: 0;
}
