@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #0e1621;
    --bg-secondary: #17212b;
    --bg-tertiary: #1e2c3a;
    --bg-card: #182533;
    --bg-input: #242f3d;
    --bg-hover: #2b3a4a;
    --accent: #2ca5e0;
    --accent-hover: #1e96d1;
    --accent-glow: rgba(44, 165, 224, 0.15);
    --text-primary: #f5f5f5;
    --text-secondary: #8b9bab;
    --text-muted: #5e6e7f;
    --border: #2b3a4a;
    --danger: #e05454;
    --danger-hover: #c94444;
    --success: #4fae4e;
    --gradient-start: #2ca5e0;
    --gradient-end: #6c5ce7;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
.container { max-width: 720px; margin: 0 auto; padding: 20px; }

/* ===== HEADER ===== */
.header { background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 14px 0; position: sticky; top: 0; z-index: 100; backdrop-filter: blur(12px); }
.header .container { display: flex; align-items: center; justify-content: space-between; }
.header-logo { display: flex; align-items: center; gap: 10px; }
.header-logo .logo-icon { width: 38px; height: 38px; background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: white; }
.header-title { font-size: 18px; font-weight: 700; background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.header-nav { display: flex; gap: 8px; }
.header-online { display: flex; align-items: center; gap: 8px; }
.online-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; animation: pulse 2s infinite; }
.online-text { font-size: 13px; color: var(--text-secondary); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ===== BUTTONS ===== */
.btn { padding: 10px 20px; border: none; border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); color: white; box-shadow: 0 4px 15px rgba(44, 165, 224, 0.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(44, 165, 224, 0.4); color: white; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--accent); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ===== LOGIN ===== */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #0a0f18 0%, #0e1621 50%, #111d2e 100%); }
.login-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); text-align: center; }
.login-icon { font-size: 48px; margin-bottom: 16px; }
.login-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-card .subtitle { color: var(--text-secondary); margin-bottom: 28px; font-size: 14px; }
.login-btn { width: 100%; justify-content: center; padding: 14px; font-size: 16px; margin-top: 8px; }
.login-link { display: block; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.login-link:hover { color: var(--accent); }
#loginError { margin-top: 16px; }

/* ===== FORM ===== */
.form-page { padding-top: 24px; padding-bottom: 40px; }
.form-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-lg); }
.form-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.form-card .subtitle { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }
.form-card h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group textarea { width: 100%; padding: 11px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s; outline: none; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-group textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-row { display: flex; gap: 16px; }
.form-actions { display: flex; gap: 12px; margin-top: 20px; }
.form-actions .btn { flex: 1; justify-content: center; padding: 13px; font-size: 15px; }

.success-msg { background: rgba(79, 174, 78, 0.1); border: 1px solid var(--success); color: var(--success); padding: 12px 18px; border-radius: var(--radius-sm); margin-top: 14px; display: none; align-items: center; gap: 10px; font-size: 13px; animation: slideDown 0.3s ease; }
.success-msg.show { display: flex; }
.error-msg { background: rgba(224, 84, 84, 0.1); border: 1px solid var(--danger); color: var(--danger); padding: 12px 18px; border-radius: var(--radius-sm); margin-top: 14px; display: none; align-items: center; gap: 10px; font-size: 13px; }
.error-msg.show { display: flex; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== ADMIN AVISO LIST ===== */
.admin-aviso-item { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: var(--bg-tertiary); border-radius: var(--radius-sm); margin-bottom: 10px; border: 1px solid transparent; transition: border-color 0.2s; }
.admin-aviso-item:hover { border-color: var(--border); }
.admin-aviso-titulo { font-weight: 600; font-size: 14px; color: var(--text-primary); margin-bottom: 2px; }
.admin-aviso-meta { font-size: 12px; color: var(--text-muted); }
.admin-aviso-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: 12px; }

/* ===== CANAL BANNER ===== */
.canal-body { background: linear-gradient(180deg, #0a1020 0%, #0e1621 100%); }
.canal-header { background: rgba(23, 33, 43, 0.8); }
.canal-banner { padding: 40px 0 30px; text-align: center; background: linear-gradient(135deg, rgba(44, 165, 224, 0.08), rgba(108, 92, 231, 0.08)); border-bottom: 1px solid var(--border); }
.banner-content { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.banner-icon { font-size: 48px; margin-bottom: 4px; }
.canal-banner h1 { font-size: 28px; font-weight: 800; background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.canal-banner p { color: var(--text-secondary); font-size: 15px; }

/* ===== CHANNEL PAGE ===== */
.channel-page { padding-top: 24px; padding-bottom: 60px; }
.avisos-list { display: flex; flex-direction: column; gap: 16px; }

/* ===== Aviso Cards ===== */
.aviso-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s; animation: fadeInUp 0.5s ease; }
.aviso-card:hover { border-color: rgba(44, 165, 224, 0.25); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); transform: translateY(-2px); }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.aviso-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.aviso-author-info { display: flex; align-items: center; gap: 10px; }
.aviso-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; color: white; flex-shrink: 0; }
.aviso-avatar-img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.aviso-author-name { font-weight: 600; font-size: 15px; }
.aviso-date { font-size: 12px; color: var(--text-muted); }
.aviso-badge { font-size: 11px; color: var(--accent); background: var(--accent-glow); padding: 4px 10px; border-radius: 12px; font-weight: 600; white-space: nowrap; }
.aviso-titulo { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: var(--text-primary); line-height: 1.4; }
.aviso-texto { color: var(--text-secondary); font-size: 15px; line-height: 1.7; margin-bottom: 16px; white-space: pre-wrap; word-wrap: break-word; }
.aviso-actions { display: flex; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.action-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 20px; background: var(--bg-tertiary); border: 1px solid transparent; color: var(--text-secondary); font-size: 13px; font-family: inherit; cursor: pointer; transition: all 0.2s; user-select: none; }
.action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.action-btn.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
.action-btn .action-icon { font-size: 15px; }
.action-btn .count { font-weight: 600; min-width: 8px; text-align: center; }
.action-btn-wrapper { position: relative; display: inline-block; }

/* ===== Emojis ===== */
.emoji-picker { display: none; position: absolute; bottom: calc(100% + 8px); left: 0; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-lg); z-index: 50; gap: 4px; flex-wrap: wrap; width: 220px; }
.emoji-picker.show { display: flex; }
.emoji-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-size: 20px; transition: all 0.15s; }
.emoji-btn:hover { background: var(--bg-hover); transform: scale(1.2); }
.emoji-reactions { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.emoji-reactions:empty { display: none; margin: 0; }
.emoji-reaction { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 16px; background: var(--bg-tertiary); border: 1px solid var(--border); font-size: 13px; cursor: pointer; transition: all 0.2s; user-select: none; }
.emoji-reaction:hover { border-color: var(--accent); background: var(--accent-glow); }
.emoji-reaction.active { border-color: var(--accent); background: var(--accent-glow); }
.emoji-reaction .emoji { font-size: 16px; }
.emoji-reaction .total { font-weight: 600; color: var(--text-secondary); font-size: 12px; }

/* ===== COMMENTS ===== */
.comentarios-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); display: none; }
.comentarios-section.show { display: block; animation: fadeInUp 0.3s ease; }
.comentarios-header-label { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.comentarios-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; max-height: 400px; overflow-y: auto; }
.comentario { background: var(--bg-tertiary); border-radius: var(--radius-sm); padding: 12px; animation: fadeInUp 0.3s ease; }
.comentario-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.comentario-author-info { display: flex; align-items: center; gap: 8px; }
.comentario-avatar { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; flex-shrink: 0; }
.comentario-author { font-weight: 600; font-size: 13px; color: var(--accent); }
.comentario-date { font-size: 11px; color: var(--text-muted); }
.comentario-texto { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.comentario-form { display: flex; gap: 8px; }
.comentario-form input { flex: 1; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 13px; outline: none; transition: border-color 0.2s; }
.comentario-form input:focus { border-color: var(--accent); }
.comentario-form input::placeholder { color: var(--text-muted); }
.comentario-send { padding: 10px 16px; background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); border: none; border-radius: var(--radius-sm); color: white; font-size: 14px; cursor: pointer; transition: all 0.2s; font-family: inherit; white-space: nowrap; }
.comentario-send:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(44, 165, 224, 0.3); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ===== LOADING ===== */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.loading-spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== IMAGES ===== */
.aviso-imagem { margin-bottom: 16px; border-radius: var(--radius-sm); overflow: hidden; }
.aviso-imagem img { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; transition: opacity 0.2s; display: block; }
.aviso-imagem img:hover { opacity: 0.9; }
.image-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.88); display: flex; align-items: center; justify-content: center; z-index: 1000; cursor: pointer; animation: fadeIn 0.2s ease; }
.image-overlay img { max-width: 90%; max-height: 90%; border-radius: var(--radius); box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== FILE UPLOAD ===== */
.file-upload { position: relative; border: 2px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg-input); cursor: pointer; transition: border-color 0.2s, background 0.2s; overflow: hidden; }
.file-upload:hover { border-color: var(--accent); background: var(--accent-glow); }
.file-upload input[type="file"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.file-upload-content { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 6px; }
.file-upload-icon { font-size: 28px; opacity: 0.6; }
.file-upload-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.file-upload-hint { font-size: 12px; color: var(--text-muted); }
.file-preview { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.file-remove { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--danger); border: none; color: white; font-size: 14px; cursor: pointer; z-index: 3; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.file-remove:hover { background: var(--danger-hover); }

/* ===== FOOTER ===== */
.canal-footer { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--border); margin-top: 20px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .container { padding: 12px; }
    .form-card { padding: 18px; }
    .form-card h1 { font-size: 20px; }
    .form-row { flex-direction: column; gap: 0; }
    .header-title { font-size: 16px; }
    .btn { padding: 8px 14px; font-size: 13px; }
    .aviso-card { padding: 16px; }
    .aviso-titulo { font-size: 16px; }
    .aviso-actions { gap: 4px; }
    .action-btn { padding: 5px 10px; font-size: 12px; }
    .comentario-form { flex-direction: column; }
    .canal-banner h1 { font-size: 22px; }
    .banner-icon { font-size: 36px; }
    .admin-aviso-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .admin-aviso-actions { margin-left: 0; }
    .login-card { padding: 28px 20px; }
}
