/* =========================================
   1. GLOBAL & LAYOUT
   ========================================= */
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0d0d0d;
    background: url('images/background.webp') center/cover no-repeat;
    color: #fff;
    overflow-y: auto; 

    -webkit-user-select: none; /* Safari */
    user-select: none;         /* Standard */
}

.popup {
    background-color: rgba(13, 13, 13, 0.8);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 90%; 
    max-width: 750px; 
    margin: 20px 0; 
    position: relative;
    overflow: hidden;
}

/* =========================================
   2. PROFILE HEADER & INFO
   ========================================= */
.profile-header {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    margin-bottom: 25px;
}

.main-pfp {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
}

.meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 10px 0;
}

.country-flag {
    width: 36px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
}

/* =========================================
   3. PERSONAL STATS & TITLES
   ========================================= */
.stats-raw {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333; /* Gives a nice separator line */
}

.stats-top-row {
    display: flex;
    justify-content: flex-start; /* Aligns items next to each other on the left */
    gap: 15px; /* Adds a clean space between age and height */
    align-items: center;
    margin-bottom: 15px;
}

.stat-large {
    font-size: 1.3em;
    font-weight: bold;
    color: #ddd;
}

.stats-bottom-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fav-colors-label {
    font-size: 1em;
    color: #aaa;
    font-weight: bold;
}

/* Styles the read-only color boxes */
.color-swatch {
    width: 25px;
    height: 25px;
    border: 2px solid #333;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

/* Static height styling */
.stat-subtext {
    font-size: 0.9em; 
    color: #aaa;
}

.section-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================================
   4. BUTTONS & SOCIAL LINKS
   ========================================= */
.icon-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 16px;
    transition: background-color 0.2s;
    background-color: black;
    color: #fff;
    border: 1px solid #333;
    box-sizing: border-box; 
}

.icon-button:hover {
    background-color: #1a1a1a;
}

.link-btn {
    display: flex;
    align-items: center;
    justify-content: space-between; 
}

.links-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
}

.links-wrapper .icon-button {
    margin-bottom: 0; 
    flex: 1; 
    text-decoration: none; 
}

.platform-left {
    display: flex;
    align-items: center;
    gap: 10px; 
}

.btn-icon {
    width: 32px;
    height: 32px;
}

.platform-pfp {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: -5px; 
}

.action-btn {
    background-color: #111;
    color: #fff;
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #222;
}

img.btn-copy-action {
    height: 25px;
    width: 18px;
    cursor: pointer; 
}

img.btn-clipboard {
    height: 16px;
    width: 16px;
    vertical-align: middle;
    margin-right: 5px;
}

/* =========================================
   5. DROPDOWNS & CRYPTO (Monero/Steam)
   ========================================= */
.crypto-dropdown {
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}

.crypto-dropdown summary {
    margin-bottom: 0;
}

.crypto-dropdown summary::-webkit-details-marker {
    display: none;
}

.crypto-dropdown[open] summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.dropdown-content {
    background-color: #111;
    padding: 12px;
    border-radius: 0 0 8px 8px;
    border: 1px solid #333;
    border-top: none;
    font-size: 13px;
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: normal;
    width: 100%;
    box-sizing: border-box; 
}

.dropdown-content code {
    color: #f2a900; 
    display: block; 
    word-break: break-all; 
    white-space: normal;
}

.monero-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.monero-actions a {
    color: #4da6ff;
    text-decoration: none;
}

.monero-actions .action-btn {
    padding: 5px 10px;
}

/* =========================================
   6. MODAL OVERLAY (Copy Options)
   ========================================= */
.modal-overlay {
    display: none; 
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #1a1a1a;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #333;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    text-align: center;
}

.modal-content h3 { margin-top: 0; color: #fff; }
.modal-content p { color: #aaa; margin-bottom: 20px; }

.modal-option-btn {
    background-color: #111;
    color: #fff;
    border: 1px solid #333;
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    transition: 0.2s;
}

.modal-option-btn:hover { background-color: #222; }

.preview-text {
    font-family: monospace;
    color: #4da6ff;
    word-break: break-all;
    text-align: left;
}

.modal-close-btn {
    background-color: #000000;
    color: white;
    border: none;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    cursor: pointer;
    font-weight: bold;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.close-icon {
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.close-icon:hover {
    opacity: 0.7;
}

.modal-close-btn:hover { background-color: #131313; }

/* --- STATIC COLOR PICKER UI --- */
.picker-top-area {
    display: flex;
    width: 100%;
    height: 150px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* The left side pure color block */
.solid-color-block {
    width: 30%;
    height: 100%;
}

/* The right side gradient block */
.picker-square {
    width: 70%;
    height: 100%;
    position: relative;
    background-image: 
        linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0)),
        linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
}

.picker-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
    position: absolute;
    transform: translate(-50%, -50%);
}

.hue-slider-container {
    margin-bottom: 25px;
    padding: 0 7px; 
}

.hue-slider {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    position: relative;
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}

.hue-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    background-color: transparent;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* --- VALUE BOXES LAYOUT --- */
.values-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hex-box {
    position: relative;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: text;
    -webkit-user-select: text;
}

.hex-label {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a1a1a;
    padding: 0 10px;
    font-size: 0.7em;
    color: #aaa;
}

.color-values-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.small-value-box {
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    user-select: text;
    -webkit-user-select: text;
}

.value-label {
    font-size: 0.7em;
    color: #aaa;
    margin-bottom: 2px;
}

.value-text {
    font-family: monospace;
    font-size: 0.85em;
    color: #fff;
}

/* =========================================
   7. MEDIA QUERIES (Mobile Phones)
   ========================================= */
@media (max-width: 600px) {
    .popup {
        padding: 25px 20px; 
    }

    .friends-layer {
        padding: 20px; 
    }
    
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .meta {
        justify-content: center;
    }
}

/* --- MORE SOCIALS BUTTON --- */
.more-socials-btn {
    background-color: #000;
    color: #fff;
    border: none;
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
    margin-top: 5px;
}

.more-socials-btn:hover {
    background-color: #111;
}

/* --- SOCIALS GRID LOGIC --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 20px;
    justify-items: center;
    padding: 15px 0;
}

.grid-social-icon {
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: transform 0.2s;
}

.grid-social-icon:hover {
    transform: scale(1.1);
}

/* =========================================
   8. TEXT SELECTION WHITELIST
   ========================================= */

/* Re-enable text selection for Name, Bio, Stats, and Monero */
.profile-info h1, 
.profile-info p, 
.meta, 
.stats-raw, 
#monero-text {
    -webkit-user-select: text;
    user-select: text;
}


/* =========================================
   9. ANIMATIONS
   ========================================= */

/* --- POPUP (MODAL) ANIMATIONS --- */
@keyframes modalPop {
    from { 
        opacity: 0; 
        transform: scale(0.95) translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* Triggers the animation whenever the modal is displayed */
.modal-overlay[style*="display: flex;"] .modal-content {
    animation: modalPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* --- DROPDOWN ANIMATION --- */
@keyframes dropdownReveal {
    from { 
        opacity: 0; 
        transform: translateY(-5px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

details[open] .dropdown-content {
    animation: dropdownReveal 0.2s ease-out forwards;
    transform-origin: top;
}

/* Trigger this class with JS before removing the 'open' attribute */
details.closing .dropdown-content {
    animation: dropdownHide 0.2s ease-out forwards;
    transform-origin: top;
}

/* --- MODAL CLOSE ANIMATION --- */
@keyframes modalHide {
    from { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
    to { 
        opacity: 0; 
        transform: scale(0.95) translateY(-10px); 
    }
}

/* This class will be temporarily added by JS when closing */
.modal-overlay.closing .modal-content {
    animation: modalHide 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* =========================================
   10. FRIENDS OVERLAY
   ========================================= */

.friends-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    z-index: 5;
    transition: background-color 0.2s;
    
    /* Alignment Fixes */
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

/* Nudge the icon specifically */
.friends-toggle-btn img {
    transform: translateY(-1px);
}

.friends-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.friends-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 13, 13, 0.98);
    backdrop-filter: blur(10px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 30px 40px;
    box-sizing: border-box;
    
    /* Hidden by default, using opacity for a smooth fade */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.friends-layer.active {
    opacity: 1;
    pointer-events: all;
}

.friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.close-friends-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5em;
    cursor: pointer;
    transition: color 0.2s;
}

.close-friends-btn:hover {
    color: #fff;
}

/* Friends Grid & Cards */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    overflow-y: auto; 
    padding-bottom: 20px;
    flex: 1;
    min-height: 0;
    align-content: start;
}

.friend-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  aspect-ratio: 260 / 340;
}

.friend-card {
  position: relative;
  overflow: hidden;
}

.card-video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Forces text, pfp, and socials to sit cleanly on top of the video and dark tint */
.friend-card > *:not(.card-video-bg) {
  position: relative;
  z-index: 2;
}

/* --- Reusable Black Overlay --- */
.friend-card.has-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.6);
  z-index: 1;
  pointer-events: none;
}

.friend-pfp {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.friend-name {
    font-weight: bold;
    font-size: 0.95em;
    color: #ddd;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.friend-socials {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.friend-socials img {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.friend-socials img:hover {
    transform: scale(1.2);
}