/* profile.css */

.profile-layout {
    display: flex;
    width: 95%;
    max-width: 1400px;
    margin: 100px auto 40px;
    gap: 2rem;
    align-items: flex-start;
}

/* Sidebar (30%) */
.sidebar {
    flex: 0 0 30%;
    background: #1a1a1a;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    position: sticky;
    top: 100px;
}

.avatar-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 1.5rem;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    object-fit: cover;
    box-shadow: 0 0 30px rgba(255, 128, 0, 0.3);
}

.gender-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--primary-color);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 4px solid #1a1a1a;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.sidebar h1 { margin: 0; font-size: 1.8rem; color: #ffffff; font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.sidebar .username { color: var(--primary-color); font-size: 1rem; margin-bottom: 0.5rem; display: block; opacity: 1; font-weight: 600; }

/* Tier Styles */
.founder-stamp {
    display: none;
    background: linear-gradient(135deg, #e5e5e5 0%, #ffffff 50%, #d1d1d1 100%);
    color: #1a1a1a;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,0.8);
    border: 1px solid #999;
    margin: 0 auto 1.5rem;
    width: fit-content;
    position: relative;
}

.founder-stamp::after {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.4), transparent);
    border-radius: 22px;
    z-index: -1;
}

.tier-lifetime .avatar {
    border-color: #e5e5e5;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2), 0 0 10px rgba(255,255,255,0.1);
}

.tier-pro .avatar {
    border-color: #00d4ff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

/* Profile Banner Area */
.profile-banner {
    width: 100%;
    height: 250px;
    background: #111;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
    opacity: 0.5;
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: left;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
}

.stat-row span:first-child { font-size: 0.8rem; color: #aaaaaa; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.stat-row span:last-child { font-weight: 800; color: #ffffff; font-size: 1.1rem; }

/* Main Content (70%) */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.content-section {
    width: 85%;
    background: #1a1a1a;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}

.content-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-color-light));
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
}

.section-header h2 i { color: var(--primary-color); filter: drop-shadow(0 0 5px rgba(255,128,0,0.4)); }

.gifts-container {
    height: 200px; /* Reduced height */
    display: flex;
    flex-direction: row-reverse; /* Newest gifts (left) to oldest (right) */
    justify-content: flex-end;
    gap: 1.2rem;
    overflow-x: auto;
    overflow-y: hidden; /* Prevent vertical scroll */
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(255,255,255,0.05);
}

.gift-card {
    min-width: 150px;
    width: 150px;
    height: 150px; /* Square proportions */
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px dashed rgba(255,255,255,0.15);
    transition: all 0.3s ease;
    flex-shrink: 0; /* Don't squash the square */
    color: #888888;
}
.gift-card:hover { 
    background: rgba(255,255,255,0.06); 
    border-color: var(--primary-color); 
    transform: translateY(-5px);
    color: #ffffff;
}
.gift-card i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; transition: 0.3s; }
.gift-card:hover i { opacity: 1; color: var(--primary-color); transform: scale(1.1); }

.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 1.5rem;
}

.friend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.friend-item:hover { transform: scale(1.15); }
.friend-avatar { 
    width: 64px; 
    height: 64px; 
    border-radius: 50%; 
    border: 2px solid rgba(255,255,255,0.15); 
    object-fit: cover; 
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.friend-item:hover .friend-avatar { border-color: var(--primary-color); box-shadow: 0 0 20px rgba(255,128,0,0.4); }
.friend-name { font-size: 0.8rem; color: #ffffff; opacity: 0.8; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.friend-item:hover .friend-name { opacity: 1; color: var(--primary-color); }

/* Buttons */
.btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.btn-primary { background: var(--primary-color); color: #ffffff; }
.btn-primary:hover { background: var(--primary-color-light); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(255, 128, 0, 0.4); }

.btn-secondary { background: rgba(255,255,255,0.08); color: #ffffff; border: 1px solid rgba(255,255,255,0.1); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); transform: translateY(-2px); border-color: rgba(255,255,255,0.2); }

/* Friends Grid */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  padding: 10px;
}
.friend-item {
  text-align: center;
  color: #fff;
  text-decoration: none;
}
.friend-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}
.friend-name {
  margin-top: 4px;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Global Additions for Profile */
#loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #0a0a0a; display: flex; justify-content: center; align-items: center; z-index: 1000; transition: opacity 0.5s ease;
}

.lang-btn:hover { background: rgba(255,255,255,0.15); border-color: var(--primary-color); }
.lang-btn.active { background: var(--primary-color); border-color: var(--primary-color); box-shadow: 0 0 15px rgba(255,128,0,0.3); }

.actions { display: flex; gap: 1rem; margin-top: 1rem; }

@media (max-width: 900px) {
    .profile-layout { flex-direction: column; align-items: center; width: 90%; }
    .sidebar { width: 100%; position: static; }
    .main-content { width: 100%; }
    .content-section { width: 100%; }
}
/* ----- Department Box ----- */
.department-box {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.45);
}

/* ----- Post Input ----- */
.post-input {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 80%;
    max-width: 800px;
    margin: 0 auto;
}
.post-input textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #fff;
    resize: none;
    font-family: inherit;
    font-size: 0.95rem;
}
.post-input textarea::placeholder { color: #aaa; }
