/* ==========================================================================
   SBS PROFILE SYSTEM - Dark Theme
   Profil-Button, Dropdowns, Profile Management Modal
   ========================================================================== */

/* ==================== PROFILE BUTTON (Header) ==================== */

.sbs-profile-container {
    position: relative;
    display: flex;
    align-items: center;
}

.sbs-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

.sbs-profile-btn:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

.sbs-profile-btn:active {
    transform: translateY(0);
}

.sbs-profile-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 255, 255, 0.3);
    flex-shrink: 0;
}

.sbs-profile-avatar[src=""],
.sbs-profile-avatar:not([src]) {
    display: none;
}

.sbs-profile-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sbs-profile-chevron {
    width: 12px;
    height: 12px;
    opacity: 0.6;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sbs-profile-container.open .sbs-profile-chevron {
    transform: rotate(180deg);
}

/* ==================== PROFILE DROPDOWN ==================== */

.sbs-profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 10050;
    min-width: 300px;
    max-width: 360px;
    background: linear-gradient(180deg, rgba(3, 7, 18, 0.98) 0%, rgba(10, 15, 30, 0.98) 100%);
    border: 2px solid rgba(0, 255, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(15px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 255, 255, 0.06);
    overflow: hidden;
    animation: sbsProfileDropdownIn 0.2s ease;
}

.sbs-profile-container.open .sbs-profile-dropdown {
    display: block;
}

@keyframes sbsProfileDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown Header */
.sbs-profile-dropdown-header {
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sbs-profile-dropdown-header h4 {
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.sbs-profile-dropdown-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.sbs-profile-dropdown-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Dropdown Body */
.sbs-profile-dropdown-body {
    padding: 20px;
}

/* ==================== GUEST DROPDOWN CONTENT ==================== */

.sbs-profile-guest-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sbs-profile-guest-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sbs-profile-guest-info h4 {
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 600;
}

#sbs-google-signin-container {
    display: flex;
    justify-content: center;
    margin: 16px 0;
    min-height: 44px;
}

.sbs-profile-benefits {
    margin-top: 16px;
    padding: 14px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.12);
    border-radius: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.sbs-profile-benefits strong {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 6px;
    font-size: 13px;
}

.sbs-profile-guest-alt {
    margin-top: 14px;
    text-align: center;
}

.sbs-profile-guest-alt-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-bottom: 8px;
}

.sbs-profile-btn-secondary {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sbs-profile-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.95);
}

/* ==================== LOGGED-IN DROPDOWN CONTENT ==================== */

.sbs-profile-user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sbs-profile-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 255, 255, 0.3);
    flex-shrink: 0;
}

.sbs-profile-user-name {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    font-size: 15px;
    margin: 0 0 2px 0;
}

.sbs-profile-user-email {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin: 0;
    word-break: break-all;
}

/* Dropdown Action Buttons */
.sbs-profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sbs-profile-action-btn {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sbs-profile-action-btn.primary {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.15), rgba(139, 92, 246, 0.12));
    color: var(--primary-cyan, #00ffff);
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.sbs-profile-action-btn.primary:hover {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.25), rgba(139, 92, 246, 0.18));
    border-color: rgba(0, 255, 255, 0.4);
    transform: translateY(-1px);
}

.sbs-profile-action-btn.danger {
    background: rgba(255, 68, 68, 0.08);
    color: #ff6b6b;
    border: 1px solid rgba(255, 68, 68, 0.2);
}

.sbs-profile-action-btn.danger:hover {
    background: rgba(255, 68, 68, 0.15);
    border-color: rgba(255, 68, 68, 0.4);
}

/* ==================== PROFILE MANAGEMENT MODAL ==================== */

.sbs-profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10100;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: sbsModalFadeIn 0.25s ease;
}

@keyframes sbsModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sbs-profile-modal {
    background: linear-gradient(180deg, rgba(3, 7, 18, 0.99) 0%, rgba(10, 15, 30, 0.99) 100%);
    border: 2px solid rgba(0, 255, 255, 0.2);
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 255, 255, 0.08);
    animation: sbsModalSlideIn 0.3s ease;
}

@keyframes sbsModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sbs-profile-modal-header {
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 18px 18px 0 0;
}

.sbs-profile-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.sbs-profile-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.sbs-profile-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Modal User Card */
.sbs-profile-modal-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sbs-profile-modal-user img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 255, 255, 0.3);
}

.sbs-profile-modal-user-name {
    font-weight: 600;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.95);
}

.sbs-profile-modal-user-email {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

/* Modal Form */
.sbs-profile-modal-form {
    padding: 20px 24px;
}

.sbs-profile-field {
    margin-bottom: 16px;
}

.sbs-profile-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.sbs-profile-field input,
.sbs-profile-field textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.sbs-profile-field input:focus,
.sbs-profile-field textarea:focus {
    outline: none;
    border-color: rgba(0, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.sbs-profile-field input::placeholder,
.sbs-profile-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.sbs-profile-field textarea {
    min-height: 70px;
    resize: vertical;
}

.sbs-profile-save-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.sbs-profile-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
}

/* DSGVO Delete Section */
.sbs-profile-delete-section {
    margin: 20px 24px 24px;
    padding: 16px;
    background: rgba(255, 68, 68, 0.06);
    border: 1px solid rgba(255, 68, 68, 0.15);
    border-radius: 12px;
}

.sbs-profile-delete-section h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #ff6b6b;
}

.sbs-profile-delete-section p {
    margin: 0 0 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

.sbs-profile-delete-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    color: #ff6b6b;
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sbs-profile-delete-btn:hover {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.5);
}

/* ==================== MOBILE RESPONSIVE ==================== */

@media (max-width: 900px) {
    /* Profil-Button im Header auf Mobile ausblenden (Toolbar übernimmt) */
    .sbs-profile-container {
        display: none !important;
    }
}

/* ==================== SCROLLBAR STYLING (Modal) ==================== */

.sbs-profile-modal::-webkit-scrollbar {
    width: 6px;
}

.sbs-profile-modal::-webkit-scrollbar-track {
    background: transparent;
}

.sbs-profile-modal::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.2);
    border-radius: 3px;
}

.sbs-profile-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.35);
}
