/**
 * Markt Navbar Menu Styles
 * 
 * User menu for navbar with profile, wishlist, and sign out buttons
 */

.markt-navbar-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Navigation Buttons */
.markt-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--secondary-color);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    box-shadow: none;
    position: relative;
    overflow: visible;
}

.markt-nav-btn:hover {
    background: #E1E1E1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Profile Button & Avatar */
.markt-profile-btn {
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    border: 1px solid transparent;
}

.markt-profile-btn:hover {
    border: 1px solid var(--accent-color);
    box-shadow: none;
    transform: none;
}

.markt-profile-avatar {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    border-radius: 50%;
}

.markt-profile-btn:hover .markt-profile-avatar {
    opacity: 0.9;
}

/* Icons - Image based */
.markt-nav-icon {
    width: 24px;
    height: 24px;
    transition: opacity 0.3s ease;
}

.markt-icon-hover {
    position: absolute;
    opacity: 0;
}

.markt-icon-default {
    opacity: 1;
}

.markt-nav-btn:hover .markt-icon-default {
    opacity: 0;
}

.markt-nav-btn:hover .markt-icon-hover {
    opacity: 1;
}

/* Wishlist Button */
.markt-wishlist-btn .markt-nav-icon {
    width: 20px;
    height: 20px;
}

/* Sign Out Button */
.markt-signout-btn .markt-nav-icon {
    width: 20px;
    height: 20px;
}

/* Active state for wishlist (when items exist) */
.markt-wishlist-btn.has-items {
    position: relative;
}

.markt-wishlist-btn.has-items::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #e83340;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .markt-navbar-menu {
        gap: 8px;
    }
    
    .markt-nav-btn {
        width: 35px;
        height: 35px;
    }
    
    .markt-nav-icon {
        width: 20px;
        height: 20px;
    }
}

/* Loading state */
.markt-nav-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Tooltip on hover */
.markt-nav-btn {
    position: relative;
}

/* Custom Tooltips */
.markt-nav-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1000;
}

.markt-nav-btn::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border: 5px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1000;
}

.markt-nav-btn:hover::after,
.markt-nav-btn:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(10px);
}

/* Profile Popup Modal */
.markt-profile-popup {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.markt-profile-popup.active {
    visibility: visible;
    opacity: 1;
}

.profile-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.profile-popup-content {
    position: relative;
    background: white;
    max-width: 500px;
    width: 90%;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    will-change: opacity;
    transform: scale(0.98);
    transition: transform 0.3s ease;
}

.markt-profile-popup.active .profile-popup-content {
    transform: scale(1);
}

.profile-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: all 0.2s ease;
}

.profile-popup-close:hover {
    color: var(--terracotta-light);
}

.profile-popup-content h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: var(--canopy-dark);
    font-weight: 700;
}

.profile-popup-body {
    margin-top: 20px;
    min-height: 300px;
}

/* Loading State */
.profile-loading {
    text-align: center;
    padding: 40px 20px;
}

.profile-loading .spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--terracotta-light);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.profile-loading p {
    color: #666;
    margin: 0;
}

/* Profile Details */
.profile-picture-section {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E1E1E1;
}

@media (max-width: 768px) {
    .profile-picture-section {
        margin-bottom: 12px;
    }
}

.profile-picture-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 15px;
}

.profile-picture-img {
    width: 100%;
    height: 100% !important;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--harvest-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-picture-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--terracotta-light);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.profile-picture-upload:hover {
    background: var(--terracotta-dark);
    transform: scale(1.1);
}

.profile-picture-upload input[type="file"] {
    display: none;
}

.profile-picture-upload svg {
    width: 18px;
    height: 18px;
}

.profile-details-section {
    margin-bottom: 20px;
}

.profile-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--harvest-light);
}

.profile-detail-row:last-child {
    border-bottom: none;
}

.profile-detail-label {
    color: #666;
    font-weight: 500;
    font-size: 14px;
}

.profile-detail-value {
    color: var(--canopy-dark);
    font-size: 14px;
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    max-width: 60%;
}

.profile-member-since {
    background: var(--harvest-light);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
}

.profile-member-since .label {
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.profile-member-since .value {
    color: var(--terracotta-light);
    font-size: 16px;
    font-weight: 600;
}

/* Upload Progress */
.profile-upload-progress {
    margin-top: 10px;
    text-align: center;
}

.profile-upload-progress .progress-bar {
    width: 100%;
    height: 4px;
    background: #E1E1E1;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.profile-upload-progress .progress-fill {
    height: 100%;
    background: var(--terracotta-light);
    width: 0;
    transition: width 0.3s ease;
}

.profile-upload-progress .progress-text {
    font-size: 12px;
    color: #666;
}

/* Toast Notifications */
.profile-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000000;
    max-width: 300px;
}

.profile-toast.success {
    background: #28a745;
}

.profile-toast.error {
    background: var(--terracotta-light);
}

/* Profile Sign Out Section */
.profile-signout-section {
    margin-top: 25px;
    text-align: center;
    background-color: var(--primary-color);
    border-radius: 8px;
}

.profile-signout-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    transition: color 0.2s ease;
}

.profile-signout-link:hover {
    color: var(--terracotta-light);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Profile Popup */
@media (max-width: 768px) {
    .profile-popup-content {
        width: 95%;
        padding: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .profile-picture-container {
        width: 120px;
        height: 120px;
    }
    
    .profile-detail-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .profile-detail-value {
        text-align: left;
        max-width: 100%;
    }
    
    .profile-toast {
        bottom: 15px;
        right: 15px;
        left: 15px;
        max-width: none;
    }
}
