/**
 * Profile Widget Styles for Dialmate AI
 */

/* Logout Modal Overlay */
.logout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Logout Modal */
.logout-modal {
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 400px;
    max-width: 90vw;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.logout-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.logout-modal-body {
    padding: 24px;
}

.logout-modal-body p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.logout-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.logout-modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.logout-modal-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.logout-modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.logout-modal-btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.logout-modal-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Profile Widget - Fixed position in top-right corner */
#profile-widget {
    display: none; /* Hidden until user logs in */
    align-items: center;
    gap: 0;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 1005;
    user-select: none;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    /* overflow: hidden; */ /* Removed to allow dropdown to show */
}

#profile-widget:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Expanded state */
#profile-widget.expanded {
    width: auto;
    min-width: 180px;
    border-radius: 22px;
    padding: 6px 12px 6px 6px;
    gap: 10px;
}

/* Profile Avatar */
.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* Profile Name - Hidden by default */
.profile-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none; /* Completely hide when minimized */
}

#profile-widget.expanded .profile-name {
    display: block;
    max-width: 120px;
    opacity: 1;
}

/* Dropdown Arrow - Hidden by default */
.profile-arrow {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    display: none; /* Completely hide when minimized */
}

#profile-widget.expanded .profile-arrow {
    display: block;
    opacity: 1;
    max-width: 20px;
}

#profile-widget:hover .profile-arrow {
    color: rgba(255, 255, 255, 0.9);
}

/* Profile Dropdown Menu */
#profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: #1e1e2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1010; /* Higher than widget to ensure visibility */
    overflow: hidden;
}

/* Dropdown Header */
.profile-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-dropdown-header .profile-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.profile-dropdown-info {
    flex: 1;
    min-width: 0;
}

#profile-dropdown-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#profile-dropdown-email {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown Menu Items */
.profile-dropdown-menu {
    padding: 8px 0;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 14px;
}

.profile-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.profile-dropdown-item .icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Logout Item */
.profile-dropdown-item.logout {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

.profile-dropdown-item.logout:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* Profile Settings Modal */
#profile-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.profile-modal-content {
    background: #1e1e2e;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Modal Header */
.profile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

#profile-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#profile-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Modal Body */
.profile-modal-body {
    padding: 24px;
}

/* Avatar Section */
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#profile-modal-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 48px;
    background-size: cover;
    background-position: center;
}

.profile-picture-buttons {
    display: flex;
    gap: 12px;
}

.profile-picture-buttons button {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#change-picture-btn {
    background: #667eea;
    color: white;
}

#change-picture-btn:hover {
    background: #5568d3;
}

#delete-picture-btn {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

#delete-picture-btn:hover {
    background: rgba(255, 107, 107, 0.2);
}

#profile-picture-input {
    display: none;
}

/* Form Fields */
.profile-form-group {
    margin-bottom: 20px;
}

.profile-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.profile-form-group input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.profile-form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.profile-form-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Footer */
.profile-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-modal-footer button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#profile-modal-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

#profile-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

#profile-modal-save {
    background: #667eea;
    color: white;
}

#profile-modal-save:hover {
    background: #5568d3;
}

#profile-modal-save:disabled,
#change-picture-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    #profile-widget {
        top: 12px;
        right: 12px;
        padding: 6px 10px;
        gap: 8px;
    }

    .profile-name {
        display: none;
    }

    .profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    #profile-dropdown {
        right: 0;
        min-width: 220px;
    }

    .profile-modal-content {
        margin: 0 16px;
        max-width: calc(100% - 32px);
    }

    #profile-modal-avatar {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }
}

