/* ==========================================
   PROFIL/LOGIN PANEL - STYLES
   ========================================== */

/* Overlay (Hintergrund-Dimming) */
.profile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.profile-overlay.active {
    display: block;
}

/* Hauptpanel */
.profile-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 450px;
    max-width: 95%;
    max-height: 90vh;
    background: #1a1a1a;
    border-radius: 12px;
    border: 3px solid #000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    z-index: 9999;
    overflow: hidden;
    animation: scaleIn 0.3s ease forwards;
}

.profile-panel.active {
    display: flex;
    flex-direction: column;
}

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

@keyframes scaleIn {
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Header */
.profile-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 20px 24px;
    border-bottom: 2px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.profile-header h2 {
    color: #ffffff;
    margin: 0;
    font-family: 'Russo One', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    flex: 1;
    text-align: center;
}

/* Tabs */
.profile-tabs {
    display: flex;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-bottom: 2px solid #000;
    position: relative;
}

.profile-tab {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.close-btn-tabs {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    flex: 0;
}

.profile-tab:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.profile-tab.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #28a745;
    box-shadow: 0 0 10px #28a745;
}

/* Content Bereich */
.profile-content {
    padding: 32px 28px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.profile-content::-webkit-scrollbar {
    width: 8px;
}

.profile-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.profile-content::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 4px;
}

.profile-content::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Form */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
    background: #1a1a1a;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.toggle-password:hover {
    opacity: 1;
}

.eye-icon {
    font-size: 1.2rem;
    filter: grayscale(1);
}

/* Input with Feedback (Username Check) */
.input-with-feedback {
    position: relative;
}

.input-feedback {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.input-feedback.available {
    color: #28a745;
}

.input-feedback.unavailable {
    color: #dc3545;
}

.input-feedback.checking {
    color: #ffc107;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.strength-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.strength-bar.weak::after {
    width: 33%;
    background: #dc3545;
}

.strength-bar.medium::after {
    width: 66%;
    background: #ffc107;
}

.strength-bar.strong::after {
    width: 100%;
    background: #28a745;
}

.strength-text {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.strength-text.weak {
    color: #dc3545;
}

.strength-text.medium {
    color: #ffc107;
}

.strength-text.strong {
    color: #28a745;
}

/* Password Match Feedback */
.password-match-feedback {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.password-match-feedback.match {
    color: #28a745;
}

.password-match-feedback.no-match {
    color: #dc3545;
}

/* Checkboxen */
.form-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    position: relative;
    padding-left: 32px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 2px;
    height: 20px;
    width: 20px;
    background-color: #0f0f0f;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-label:hover .checkmark {
    border-color: #28a745;
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #28a745;
    border-color: #28a745;
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark::after {
    display: block;
}

.checkbox-label a {
    color: #28a745;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.checkbox-label a:hover {
    color: #34d058;
}

.checkbox-hint {
    display: block;
    margin-top: 4px;
    margin-left: 32px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-style: italic;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn-primary {
    background: #28a745;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-primary:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: #dc3545;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: -8px;
    margin-bottom: 8px;
}

.forgot-password-link {
    color: #28a745;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password-link:hover {
    color: #34d058;
    text-decoration: underline;
}

/* Form Messages */
.form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.form-message.error {
    display: block;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.form-message.info {
    display: block;
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    color: #007bff;
}

.form-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    text-align: center;
    margin: 0;
}

.form-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* ===== PROFIL VIEW ===== */
.profile-view {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Avatar Section */
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #28a745;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    object-fit: cover;
}

/* Info Section */
.profile-info-section h3 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 16px 0;
}

.profile-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-stats p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-stats .icon {
    font-size: 1.1rem;
}

/* Warning Box */
.profile-warning {
    padding: 16px;
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    text-align: center;
}

.profile-warning p {
    color: #ffc107;
    margin: 8px 0;
}

.profile-warning strong {
    font-size: 1.1rem;
}

.warning-hint {
    font-size: 0.85rem !important;
    color: rgba(255, 193, 7, 0.8) !important;
}

/* Profile Actions */
.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== AVATAR SELECTOR MODAL ===== */
.avatar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.avatar-modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    border: 3px solid #000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.avatar-modal-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 20px 24px;
    border-bottom: 2px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.avatar-modal-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.avatar-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    overflow-y: auto;
    max-height: 60vh;
}

.avatar-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    background: #0f0f0f;
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-option:hover {
    border-color: #28a745;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.avatar-option.selected {
    border-color: #28a745;
    border-width: 3px;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.5);
}

.avatar-modal-actions {
    padding: 20px 24px;
    border-top: 2px solid #000;
    display: flex;
    gap: 12px;
}

.avatar-modal-actions button {
    flex: 1;
}

/* ===== PASSWORD CHANGE MODAL ===== */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.password-modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    border: 3px solid #000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    max-width: 450px;
    width: 100%;
}

.password-modal-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 20px 24px;
    border-bottom: 2px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.password-modal-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.password-modal-content .profile-form {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.modal-actions button {
    flex: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .profile-panel {
        width: 95%;
        max-width: 400px;
    }
    
    .profile-header h2 {
        font-size: 1.3rem;
    }
    
    .profile-content,
    .profile-view {
        padding: 24px 20px;
    }
    
    .avatar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    
    .profile-tab {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input {
        font-size: 0.95rem;
        padding: 10px 14px;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .avatar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
