/* style.css */

/* Globale Variablen für Farben */
:root {
    --bg-color: #1a1a2e; /* Wird meist durch Video/Overlay überdeckt */
    --card-bg-color: #16213e;
    --text-color: #e0e0e0;
    --primary-color: #bb86fc; /* Lila Akzent */
    --secondary-color: #03dac6; /* Türkis Akzent (optional) */
    --offline-color: #777;
    --online-color: #4caf50; /* Grün */
    --askme-color: #ff9800;  /* Orange */
    --busy-color: #f44336;   /* Rot */

    /* Badge Farben */
    --vrcplus-color: #a74cf4;
    --moderator-color: #f44336;
    --group-badge-color: #03a9f4;
    --legend-color: #ffeb3b;
    --early-adopter-color: #ff9800;

    /* Tag Farben */
    --quest-tag-bg: #4caf50;
    --pc-tag-bg: #2196F3;
    --tag-text-color: white;
    --default-tag-bg: rgba(255, 255, 255, 0.1);
    --default-tag-text: #bbb;
}

/* --- HINTERGRUNDVIDEO & OVERLAY --- */
.background-video {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    background-size: cover;
    /* filter: brightness(0.6); */ /* Optional: Helligkeit anpassen */
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 20, 0.7); /* Dunkles Overlay, Transparenz anpassen */
    z-index: -1;
}

body {
    background-color: transparent; /* Wichtig für Video */
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

/* --- PROFILKARTE --- */
.profile-card {
    background-color: rgba(22, 33, 62, 0.9); /* Leicht transparent */
    border-radius: 15px;
    padding: 25px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 0 25px rgba(187, 134, 252, 0.4); /* Stärkeres Leuchten */
    border: 1px solid var(--primary-color);
    position: relative;
    z-index: 1;
    overflow: hidden; /* Verhindert interne Überläufe */
}

.loading {
    text-align: center;
    font-size: 1.2em;
    color: var(--primary-color);
    padding: 40px 0;
}

/* --- HEADER --- */
.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(187, 134, 252, 0.2);
    padding-bottom: 15px;
    flex-wrap: wrap; /* Falls Name zu lang */
}

.profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    margin-right: 20px;
    object-fit: cover;
    flex-shrink: 0; /* Verhindert Schrumpfen */
}

.name-status {
    flex-grow: 1;
}

.name-status h1 {
    margin: 0 0 5px 0;
    color: var(--primary-color);
    font-size: 1.8em;
    word-break: break-all; /* Namen umbrechen */
}

.status-indicator {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    margin-right: 10px;
    color: #fff;
    vertical-align: center;
}

.status-offline { background-color: var(--offline-color); }
.status-active, .status-online, .status-joinme { background-color: var(--online-color); }
.status-askme { background-color: var(--askme-color); }
.status-busy { background-color: var(--busy-color); }

/* --- BADGES --- */
.badges {
    margin-top: 5px;
    display: flex; /* Badges nebeneinander */
    align-items: center;
    flex-wrap: wrap; /* Falls viele Badges */
    gap: 6px;
}

.badge { /* Rang Badge */
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    white-space: nowrap;
}

.extra-badges { /* Container für Icons */
    display: inline-flex; /* Icons nebeneinander */
    align-items: center;
    gap: 4px;
    /* margin-left: 8px; -> Entfernt, da jetzt im .badges Container */
    vertical-align: middle;
}

.extra-badge { /* Einzelnes Icon-Badge */
    font-size: 0.9em;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    cursor: help; /* Zeigt, dass es einen Tooltip gibt */
}
.extra-badge:hover {
    opacity: 1;
}

/* Farben für Icon-Badges */
.badge-vrcplus { color: var(--vrcplus-color); }
.badge-moderator { color: var(--moderator-color); }
.badge-group { color: var(--group-badge-color); }
.badge-legend { color: var(--legend-color); }
.badge-early-adopter { color: var(--early-adopter-color); }

/* --- PROFILDETAILS (Alter, Pronomen, Bio) --- */
.profile-details {
    margin-bottom: 20px;
}

.profile-details p {
    margin: 8px 0;
    line-height: 1.6;
}

.profile-details strong {
    color: var(--primary-color);
}

#bio {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
    white-space: pre-wrap; /* Behält Zeilenumbrüche bei */
    word-wrap: break-word; /* Verhindert Überlaufen */
    font-size: 0.95em;
    margin-top: 5px;
    overflow-y: auto; /* Scrollbar bei Bedarf */
    font-size: 0.95em;
    margin-top: 5px;
}

.btn-profile {
    display: block; /* Geändert von inline-block */
    background-color: var(--primary-color);
    color: var(--bg-color);
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 15px auto 0; /* Zentriert den Button horizontal */
}

.btn-profile:hover {
    background-color: lighten(var(--primary-color), 10%);
    transform: scale(1.05);
}

/* --- FREUNDE --- */
h2 { /* Gilt für Freunde & Favoriten */
    color: var(--primary-color);
    border-bottom: 1px solid rgba(187, 134, 252, 0.3);
    padding-bottom: 5px;
    margin-bottom: 15px;
    margin-top: 30px; /* Mehr Abstand nach oben */
}
.profile-friends h2 { margin-top: 0; } /* Erster Titel ohne extra Abstand oben */


.friends-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    justify-content: center; /* Zentriert die Karten im Grid horizontal */
}

.friend-card {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 15px 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(187, 134, 252, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.friend-pic {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    margin-bottom: 8px;
    object-fit: cover;
}

.friend-card span {
    display: block;
    margin-top: 4px;
    font-size: 0.9em;
    word-break: break-all;
}
#friend-1-name, #friend-2-name, #friend-3-name { /* Namen hervorheben */
    font-weight: bold;
    color: var(--text-color);
    font-size: 1.5em;
}

.friend-card .badge { /* Rang in Freundeskarte */
    margin-top: 5px;
}

.friend-card .extra-badges { /* Icon Badges in Freundeskarte */
    display: block; /* Eigene Zeile */
    margin-left: 0;
    margin-top: 6px;
    text-align: center;
}
.friend-card .extra-badge {
    font-size: 1em; /* Etwas größer für Lesbarkeit */
}


/* --- FAVORITEN --- */
.favorite-item {
    background-color: rgba(0, 0, 0, 0.3); /* Etwas dunklerer Hintergrund */
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid rgba(187, 134, 252, 0.2);
}

.favorite-item h3 {
    background-color: rgba(187, 134, 252, 0.1);
    margin: 0;
    padding: 8px 15px;
    font-size: 1.1em;
    color: var(--primary-color);
}

.fav-banner {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    background-color: #222; /* Fallback-Hintergrund für Banner */
}

.fav-details {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 10px;
}

.fav-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
    flex-shrink: 0;
    background-color: #222; /* Fallback für Icon */
}

.fav-details div { /* Container für Text neben Icon */
    flex-grow: 1;
    min-width: 0; /* Verhindert Überlaufen in Flexbox */
}

.fav-details strong { /* Name */
    display: block;
    color: var(--text-color);
    font-size: 1.1em;
    word-break: break-word;
}

.fav-details small { /* Zusatzinfos */
    display: block;
    margin-top: 3px;
    font-size: 0.8em;
    color: #aaa;
    white-space: nowrap; /* Verhindert Umbruch bei z.B. "Visits: 1,234 | Favs: 567" */
    overflow: hidden;
    text-overflow: ellipsis; /* ... bei Überlauf */
}
#fav-group-shortcode {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.9em;
    background-color: var(--default-tag-bg);
    color: var(--default-tag-text);
    padding: 1px 4px;
    border-radius: 3px;
    vertical-align: middle;
}

.fav-description {
    font-size: 0.9em;
    color: #ccc;
    padding: 0 15px 10px 15px;
    margin: 5px 0 0 0;
    max-height: 4.5em; /* Ca. 3 Zeilen */
    overflow: hidden;
    line-height: 1.5;
}

.fav-tags-container {
    padding: 5px 15px 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fav-tag {
    display: inline-block;
    background-color: var(--default-tag-bg);
    color: var(--default-tag-text);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.75em;
    white-space: nowrap;
}

.fav-tag i {
    margin-right: 4px;
    font-size: 0.9em; /* Icon etwas kleiner */
}

.fav-tag.tag-quest { background-color: var(--quest-tag-bg); color: var(--tag-text-color); }
.fav-tag.tag-pc { background-color: var(--pc-tag-bg); color: var(--tag-text-color); }
/* Weitere Tag-Farben hier definieren */

.fav-link {
    display: block;
    margin: 5px 15px 15px 15px;
    text-align: right;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
}

.fav-link:hover {
    text-decoration: underline;
}

/* --- Platzhalter --- */
img[src$="placeholder.png"],
img[src$="placeholder_banner.png"] {
    opacity: 0.6;
    background-color: #333;
}

/* --- Glitch Effekt (Beispiel, muss evtl. angepasst/erweitert werden) --- */
/* Aktivieren durch Hinzufügen der Klasse 'glitch' zu einem Element */
.glitch {
  position: relative;
  animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
  content: attr(data-text); /* Dupliziert den Textinhalt */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit; /* Nimmt Hintergrund der Karte an */
  overflow: hidden;
}

.glitch::before {
  left: 2px;
  text-shadow: -1px 0 var(--secondary-color); /* Türkis Schatten */
  animation: glitch-anim-before 2.5s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%); /* Nur oberen Teil glitchen */
}

.glitch::after {
  left: -2px;
  text-shadow: -1px 0 var(--primary-color); /* Lila Schatten */
  animation: glitch-anim-after 2.5s infinite linear alternate-reverse;
   clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%); /* Nur unteren Teil glitchen */
}

@keyframes glitch-anim {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}
@keyframes glitch-anim-before {
  0% { clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%); }
  5% { clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);}
  /* ... weitere Schritte für zufälligeres Aussehen ... */
  100% { clip-path: polygon(0 20%, 100% 20%, 100% 55%, 0 55%);}
}
@keyframes glitch-anim-after {
   0% { clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%); }
   5% { clip-path: polygon(0 0, 100% 0, 100% 30%, 0 30%);}
   /* ... weitere Schritte ... */
   100% { clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%);}
}

/* Beispiel: Titel glitchen lassen */
/* .name-status h1 {
    data-text: attr(id); // Braucht JS um data-text zu setzen
    // oder Klasse .glitch hinzufügen und data-text per JS setzen
} */