/* Profile Button Styles */
.profile-button {
    position: absolute;
    right: 20px;
    top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 40px;
    width: 55px;
    height: 55px;
    cursor: pointer;
    transition: transform 0.3s ease;
    background-color: var(--scanner-color);
    padding: 6px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-button:hover {
    transform: scale(1.05);
}

.profile-button img {
    width: 45px;
    height: 45px;
    border-radius: 35px;
    object-fit: cover;
}

.profile-button .profile-icon {
    color: var(--background-color);
    font-size: 2.5rem;
}

/* Auth Button Styles */
.auth-container {
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 100;
}

.auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-button:hover {
    background-color: #f5f5f5;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Profile Section Styles */
.profile-section {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: var(--background-color);
    border-left: 2px solid var(--result-color);
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 1000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
}

.profile-section.active {
    right: 0;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
}

.profile-header h2 {
    color: black;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

.close-profile {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 5px;
    transition: color 0.3s ease;
}

.close-profile:hover {
    color: var(--result-color);
}

.profile-content {
    text-align: center;
    padding: 20px 0;
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 3px solid var(--result-color);
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.profile-picture:hover {
    transform: scale(1.05);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.profile-email {
    font-size: 1rem;
    color: #888;
    margin-bottom: 30px;
    word-break: break-all;
}

/* Animation Keyframes */
@keyframes slideIn {
    from { right: -300px; }
    to { right: 0; }
}

@keyframes slideOut {
    from { right: 0; }
    to { right: -300px; }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .profile-button {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .profile-button img {
        width: 37px;
        height: 37px;
    }
    
    .auth-container {
        top: 15px;
        right: 15px;
    }
    
    .auth-button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .profile-section {
        width: 280px;
    }
    
    .profile-picture {
        width: 100px;
        height: 100px;
    }
    
    .profile-name {
        font-size: 1.3rem;
    }
    
    .profile-email {
        font-size: 0.9rem;
    }
}

/* Hide profile elements when not needed */
.hidden {
    display: none !important;
}

/* Overlay for mobile */
@media (max-width: 480px) {
    .profile-section {
        width: 100%;
        right: -100%;
        border-left: none;
    }
    
    .profile-section.active {
        right: 0;
    }
}

/* Profile Page Specific Styles */
.nav-bar {
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: black;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-button:hover {
    color: var(--scanner-color);
    transform: translateX(-3px);
}

.profile-page {
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.profile-info {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.profile-settings {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.setting-label {
    color: #444;
    font-size: 1.1rem;
}

.profile-actions {
    text-align: center;
    margin-top: 2rem;
}

.sign-out-button {
    background-color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.sign-out-button:hover {
    background-color: var(--scanner-color);
    color: white;
    transform: translateY(-2px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header {
        padding-top: 45px;
    }
    
    .profile-page {
        padding: 1rem;
    }
    
    .nav-bar {
        padding: 1rem;
    }
    
    .profile-info {
        padding: 1.5rem;
    }
    
    .profile-settings {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .profile-page {
        padding: 0.5rem;
    }
    
    .setting-label {
        font-size: 1rem;
    }
}

.auth-button span {
    color: #444 !important;
}

.sidebar-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background-color: white;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: scroll;      /* Add this */
    -webkit-overflow-scrolling: touch;  /* Add this for iOS momentum scrolling */
    overscroll-behavior: contain;       /* Add this to prevent scroll bleed */
}

.sidebar-menu.active {
    right: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

.sidebar-profile-picture {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--scanner-color);
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sidebar-nav {
    padding: 20px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin: 8px 0;
    color: #444;
    text-decoration: none;
    font-size: 1.1rem;
    border-radius: 8px;
    background-color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-link::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-top: 2px solid #666;
    border-right: 2px solid #666;
    transform: translateY(-50%) rotate(45deg);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.sidebar-link:hover {
    background-color: #f5f5f5;
    transform: translateX(5px);
    padding-left: 25px;
    color: var(--scanner-color);
}

.sidebar-link:hover::after {
    opacity: 1;
    right: 15px;
    border-color: var(--scanner-color);
}

.sidebar-link:active {
    transform: translateX(5px) scale(0.98);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .sidebar-menu {
        width: 75%; /* Takes up 3/4 of the screen */
        right: -75%; /* Matches the width for proper hiding */
    }
}

.sidebar-back-btn {
    position: absolute;
    left: 15px;
    top: 15px;
    background: none;
    border: none;
    color: #444;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-back-btn:hover {
    color: var(--scanner-color);
    transform: translateX(-3px);
}

/* Style for the link text */
.link-text {
    font-weight: 500;
    color: #444;
}

/* Add icon styles if you want to add icons to the links */
.sidebar-link i {
    margin-right: 12px;
    font-size: 1.2em;
    min-width: 24px;
    transition: all 0.3s ease;
    color: black;
}

.sidebar-link:hover i {
    color: var(--scanner-color);
}

.sidebar-profile-name {
    color: black;
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 12px;
    text-align: center;
}