/* css/profile.css */
.profile-layout { display: grid; grid-template-columns: 1fr 350px; height: calc(100vh - 80px); overflow: hidden; }
.main-content { overflow-y: auto; padding: 0; background: var(--bg-deep); }
.video-container { width: 100%; aspect-ratio: 16/9; background: black; position: relative; }
.video-placeholder.live-mode { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); gap: 1rem; }
.offline-cover { width: 100%; height: 100%; background-size: cover; background-position: center; position: relative; display: flex; align-items: center; justify-content: center; }
.offline-overlay { background: rgba(0, 0, 0, 0.7); padding: 2rem; border-radius: 12px; text-align: center; backdrop-filter: blur(5px); border: 1px solid var(--glass-border); max-width: 80%; }
.offline-badge { background: #334155; color: #94a3b8; padding: 5px 12px; border-radius: 4px; font-weight: 800; font-size: 0.8rem; letter-spacing: 1px; display: inline-block; margin-bottom: 1rem; }
.offline-overlay h2 { color: white; font-size: 1.5rem; margin-bottom: 0.5rem; }
.offline-overlay p { color: var(--text-muted); }
.stream-info-bar { padding: 1.5rem; display: flex; gap: 1.5rem; background: var(--bg-surface); border-bottom: 1px solid var(--glass-border); align-items: center; position: relative; }
.avatar-wrapper { position: relative; width: 60px; height: 60px; flex-shrink: 0; }
.stream-avatar { width: 100%; height: 100%; border-radius: 50%; background: var(--gradient); display: grid; place-items: center; font-size: 1.5rem; font-weight: bold; color: white; overflow: hidden; }
.stream-avatar img { width: 100%; height: 100%; object-fit: cover; }
.stream-text { flex: 1; }
.stream-text h1 { font-size: 1.2rem; margin-bottom: 0.2rem; color: var(--text-main); }
.streamer-name { color: var(--primary); font-weight: 600; }
.stream-tags { display: flex; gap: 8px; margin-top: 5px; }
.tag { font-size: 0.75rem; background: var(--input-bg); padding: 2px 8px; border-radius: 4px; color: var(--text-muted); }
.tag.live-tag { background: #ef4444; color: white; font-weight: bold; }
.stream-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.subscribe-btn { border-color: #ffd700; color: #ffd700; }
.subscribe-btn:hover { background: rgba(255, 215, 0, 0.1); }
.icon-only { padding: 0.6rem 1rem; }

.edit-overlay { display: none; position: absolute; background: rgba(0, 0, 0, 0.6); justify-content: center; align-items: center; cursor: pointer; backdrop-filter: blur(2px); z-index: 10; transition: 0.2s; pointer-events: auto; }
.edit-overlay:hover { background: rgba(0, 0, 0, 0.8); }
.edit-overlay input[type="file"] { display: none; }
.edit-overlay label { cursor: pointer; color: white; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; height: 100%; }
.avatar-edit { top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%; }
.cover-edit { top: 1rem; right: 1rem; width: auto; height: auto; padding: 0; border-radius: 50px; border: 1px solid var(--glass-border); }
.cover-edit label { padding: 8px 15px; }
.bio-edit-input { width: 100%; min-height: 150px; padding: 10px; font-size: 1rem; line-height: 1.6; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--primary); color: var(--text-main); border-radius: 8px; font-family: inherit; resize: vertical; }

.profile-tabs-container { padding: 1.5rem; }
.profile-tabs { display: flex; gap: 2rem; border-bottom: 1px solid var(--glass-border); margin-bottom: 1.5rem; }
.tab-btn { background: none; border: none; padding: 0.8rem 0; color: var(--text-muted); font-family: 'Orbitron', sans-serif; cursor: pointer; border-bottom: 2px solid transparent; transition: 0.3s; }
.tab-btn.active { color: var(--primary); border-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
.glass-panel { background: var(--bg-surface); border: 1px solid var(--glass-border); border-radius: 16px; padding: 2rem; }
.bio-text { color: var(--text-main); line-height: 1.6; white-space: pre-wrap; }

.videos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.video-card { background: var(--input-bg); border-radius: 8px; overflow: hidden; transition: 0.2s; border: 1px solid var(--glass-border); }
.video-card:hover { border-color: var(--primary); transform: translateY(-5px); }
.vid-thumb { height: 120px; background: #000; display: flex; align-items: center; justify-content: center; color: var(--text-muted); position: relative; }
.vid-thumb i { font-size: 2rem; opacity: 0.5; }
.vid-info { padding: 10px; }
.vid-info h4 { font-size: 0.9rem; color: var(--text-main); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vid-info span { font-size: 0.75rem; color: var(--text-muted); }

.schedule-list { display: flex; flex-direction: column; gap: 10px; }
.schedule-item { display: flex; align-items: center; background: var(--input-bg); padding: 1rem; border-radius: 8px; border-left: 3px solid var(--primary); gap: 15px; }
.sch-day { width: 100px; font-weight: bold; color: var(--text-main); }
.sch-time { width: 100px; color: var(--primary); font-family: 'Orbitron', sans-serif; font-size: 0.9rem; }
.sch-title { flex: 1; color: var(--text-muted); font-style: italic; }
.delete-sch { color: #ff4757; cursor: pointer; opacity: 0.7; }
.delete-sch:hover { opacity: 1; }

.chat-sidebar { background: var(--bg-surface); border-left: 1px solid var(--glass-border); display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.chat-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--glass-border); font-family: 'Orbitron', sans-serif; font-size: 0.9rem; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--primary) transparent; }
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background-color: var(--primary); border-radius: 10px; }
.chat-msg { font-size: 0.9rem; line-height: 1.4; word-wrap: break-word; color: var(--text-main); }
.chat-msg .user { font-weight: 700; color: var(--text-main); margin-right: 5px; cursor: pointer; }
.chat-msg .user:hover { text-decoration: underline; color: var(--primary); }
.chat-msg .text { color: var(--text-muted); }
.chat-msg.gift-msg { background: rgba(0, 242, 255, 0.1); padding: 8px; border-radius: 8px; border: 1px solid var(--primary); animation: fadeIn 0.3s ease; }
.chat-msg.gift-msg .gift-text { color: var(--primary); font-weight: bold; }
.chat-msg.whisper { background: rgba(189, 0, 255, 0.1); border: 1px solid var(--secondary); padding: 8px; border-radius: 8px; font-style: italic; }
.chat-msg.system { color: var(--text-muted); font-style: italic; text-align: center; border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); padding: 10px 0; margin: 10px 0; }
.mod-tool { color: #ff4757; cursor: pointer; margin-right: 5px; font-size: 0.8rem; }
.sub-badge { color: #ffd700; font-size: 0.8rem; margin-right: 3px; filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5)); }

.chat-input-area { padding: 1rem; border-top: 1px solid var(--glass-border); background: var(--bg-deep); position: relative; flex-shrink: 0; }
.token-link { text-decoration: none; display: inline-block; margin-bottom: 8px; transition: transform 0.2s; }
.token-link:hover { transform: scale(1.05); }
.token-balance { font-size: 0.8rem; color: var(--text-main); margin-bottom: 0; display: flex; align-items: center; gap: 5px; background: rgba(255, 215, 0, 0.1); padding: 5px 10px; border-radius: 20px; border: 1px solid rgba(255, 215, 0, 0.3); }
.token-balance i { filter: drop-shadow(0 0 5px gold); }
.chat-controls { display: flex; gap: 10px; }
#chat-msg { flex: 1; background: var(--input-bg); border: 1px solid var(--input-border); color: var(--input-text); padding: 10px; border-radius: 4px; font-family: inherit; }
#chat-msg:focus { outline: none; border-color: var(--primary); }
.btn-icon { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; padding: 0 5px; transition: 0.2s; }
.btn-icon:hover { color: var(--secondary); transform: scale(1.1); }
.btn-send { background: var(--primary); border: none; color: black; border-radius: 4px; width: 40px; cursor: pointer; transition: 0.2s; }
.btn-send:hover { opacity: 0.9; }

.context-menu { display: none; position: fixed; background: rgba(15, 23, 42, 0.95); border: 1px solid var(--primary); box-shadow: 0 0 20px rgba(0,0,0,0.8); z-index: 9999; border-radius: 8px; width: 160px; backdrop-filter: blur(10px); overflow: hidden; animation: fadeIn 0.1s ease; }
.ctx-item { padding: 12px 15px; cursor: pointer; color: #ffffff; font-size: 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.05); transition: 0.2s; display: flex; align-items: center; gap: 10px; }
.ctx-item:last-child { border-bottom: none; }
.ctx-item:hover { background: var(--primary); color: #000; }
.ctx-item i { width: 20px; text-align: center; }
.ctx-item.danger:hover { background: #ff4757; color: white; }

.gift-menu { display: none; position: absolute; bottom: 100%; left: 0; width: 100%; background: var(--bg-surface); border-top: 1px solid var(--primary); padding: 1rem; flex-wrap: wrap; gap: 10px; box-shadow: 0 -5px 20px rgba(0,0,0,0.5); z-index: 50; justify-content: center; }
.gift-item { background: var(--input-bg); border: 1px solid var(--glass-border); padding: 10px; border-radius: 8px; cursor: pointer; text-align: center; width: 70px; transition: 0.2s; }
.gift-item:hover { border-color: var(--secondary); transform: translateY(-5px); background: var(--bg-deep); }
.gift-icon { display: block; font-size: 1.8rem; margin-bottom: 5px; }
.gift-cost { font-size: 0.7rem; color: var(--text-muted); display: block; font-weight: bold; }
.emoji-menu { display: none; position: absolute; bottom: 100%; left: 0; width: 100%; background: var(--bg-surface); border-top: 1px solid var(--primary); padding: 10px; grid-template-columns: repeat(auto-fill, minmax(35px, 1fr)); gap: 5px; max-height: 200px; overflow-y: auto; z-index: 51; box-shadow: 0 -5px 20px rgba(0,0,0,0.5); }
.emoji-item { font-size: 1.5rem; cursor: pointer; text-align: center; padding: 5px; border-radius: 4px; transition: 0.2s; }
.emoji-item:hover { background: rgba(255, 255, 255, 0.1); transform: scale(1.2); }
.emoji-menu::-webkit-scrollbar { width: 5px; }
.emoji-menu::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.form-group { margin-bottom: 1.5rem; }
.profile-input { width: 100%; padding: 12px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 8px; color: var(--input-text); font-family: 'Outfit', sans-serif; transition: 0.3s; }
.profile-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 10px var(--primary-dim); }
.file-drop-area { position: relative; display: flex; align-items: center; width: 100%; max-width: 100%; padding: 25px; border: 2px dashed var(--input-border); border-radius: 8px; transition: 0.2s; background: var(--input-bg); cursor: pointer; }
.file-drop-area:hover { border-color: var(--primary); background: var(--primary-dim); }
.choose-file-button { flex-shrink: 0; background-color: rgba(255, 255, 255, 0.04); border: 1px solid var(--glass-border); border-radius: 4px; padding: 8px 15px; margin-right: 10px; font-size: 0.85rem; text-transform: uppercase; color: var(--text-main); }
.file-message { font-size: 0.9rem; color: var(--text-muted); font-weight: 300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-input { position: absolute; left: 0; top: 0; height: 100%; width: 100%; cursor: pointer; opacity: 0; }
.selected-file-text { margin-top: 5px; font-size: 0.85rem; font-weight: bold; }
.status-feedback { min-height: 20px; margin-top: 10px; font-size: 0.9rem; font-weight: 600; text-align: center; opacity: 0; transition: opacity 0.5s ease; }
.status-feedback.success { color: #00ff88; opacity: 1; }
.status-feedback.error { color: #ff4757; opacity: 1; }
body.light-mode .status-feedback.success { color: #00c853; }
.inline-edit-section { background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: 12px; padding: 1.5rem; margin-bottom: 2rem; animation: fadeIn 0.3s ease; }
.inline-edit-section h4 { margin-bottom: 1rem; color: var(--primary); font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.progress-container { width: 100%; background: rgba(255,255,255,0.1); height: 20px; border-radius: 10px; overflow: hidden; margin-top: 10px; position: relative; }
.progress-bar { height: 100%; background: var(--gradient); width: 0%; transition: width 0.3s; }
#upload-progress-text { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: 0.75rem; color: white; line-height: 20px; text-shadow: 0 0 5px black; }
.chat-login-prompt { padding: 2rem; text-align: center; color: var(--text-muted); display: flex; align-items: center; justify-content: center; height: 100px; }
.chat-login-prompt a { color: var(--primary); text-decoration: none; font-weight: bold; margin-left: 5px; }

@media (max-width: 900px) { 
    .profile-layout { grid-template-columns: 1fr; height: auto; overflow: visible; } 
    .video-container { position: sticky; top: 60px; z-index: 100; } 
    .chat-sidebar { height: 500px; border-left: none; border-top: 1px solid var(--glass-border); } 
    .stream-info-bar { flex-direction: column; text-align: center; } 
    .stream-actions { margin-left: 0; margin-top: 1rem; flex-wrap: wrap; justify-content: center; } 
    .offline-overlay { width: 90%; padding: 1rem; } 
}