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

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

:root {
    --orange: #F97316;
    --orange-dark: #EA6C0A;
    --orange-light: #FFF0E5;
    --cream: #FDF6E8;
    --cream-dark: #F0DFC0;
    --black: #000000;
    --white: #FFFFFF;
    --text: #1A1A1A;
    --gray: #6B7280;
    --card-radius: 16px;
}

body {
    font-family: 'Nunito', Arial, sans-serif;
}

/* ========== ADMIN PROJECTOR PAGE ========== */
.admin-body {
    background: var(--black);
    color: var(--white);
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

/* Top bar */
.admin-topbar {
    background: var(--black);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 36px;
    border-bottom: 1px solid #222;
}

.admin-topbar .logo {
    height: 36px;
}

.admin-topbar .event-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--white);
    margin-left: 8px;
}

/* Main layout */
.admin-main {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100%;
    overflow: hidden;
}

/* Left QR panel */
.admin-qr-panel {
    background: var(--cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 28px;
    gap: 20px;
}

.admin-qr-panel .event-label {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--black);
    text-align: center;
}

.admin-qr-box {
    background: var(--white);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.admin-qr-box canvas,
.admin-qr-box svg {
    display: block;
    border-radius: 8px;
}

.admin-qr-panel .scan-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--black);
    letter-spacing: 0.02em;
}

/* Right live chat */
.admin-chat-panel {
    background: var(--orange);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
    gap: 12px;
}

.admin-chat-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
    scroll-behavior: smooth;
}

.admin-chat-feed::-webkit-scrollbar {
    width: 6px;
}

.admin-chat-feed::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.admin-chat-feed::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.admin-card {
    background: var(--white);
    border-radius: var(--card-radius);
    padding: 16px 20px;
    animation: slideUp 0.35s ease;
    flex-shrink: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-card .card-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 4px;
}

.admin-card .card-song {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.4;
}

.admin-card .card-msg {
    font-size: 0.88rem;
    color: var(--gray);
    margin-top: 2px;
    line-height: 1.4;
}

.admin-card .card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.admin-card .like-count {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--orange);
}

.admin-card .heart-icon {
    font-size: 1rem;
}

/* ========== USER MOBILE PAGE ========== */
.user-body {
    background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* User top bar */
.user-topbar {
    background: var(--black);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-topbar .logo {
    height: 32px;
}

/* Live feed box (top of user page) */
.user-feed-wrapper {
    background: var(--orange);
    margin: 16px;
    border-radius: 20px;
    padding: 12px;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-feed-inner {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    max-height: 300px;
    padding-right: 2px;
}

.user-feed-inner::-webkit-scrollbar {
    width: 4px;
}

.user-feed-inner::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.user-feed-inner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.user-card {
    background: var(--white);
    border-radius: 12px;
    padding: 12px 14px;
    animation: slideUp 0.3s ease;
    flex-shrink: 0;
}

.user-card .card-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 3px;
}

.user-card .card-song {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.4;
}

.user-card .card-msg {
    font-size: 0.82rem;
    color: var(--gray);
    margin-top: 2px;
}

.user-card .card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
}

/* Like button */
.btn-like {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 20px;
    transition: background 0.2s;
}

.btn-like:hover {
    background: rgba(249, 115, 22, 0.1);
}

.btn-like .like-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--orange);
}

.btn-like .heart-svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.btn-like.liked .heart-svg {
    transform: scale(1.2);
}

.btn-like .heart-svg path {
    fill: none;
    stroke: var(--orange);
    stroke-width: 2;
    transition: fill 0.2s;
}

.btn-like.liked .heart-svg path {
    fill: var(--orange);
}

/* Form section */
.user-form-section {
    padding: 0 16px 32px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.event-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--black);
    text-align: center;
    margin: 8px 0 20px;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 6px;
    margin-top: 14px;
    display: block;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: 'Nunito', Arial, sans-serif;
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    outline: none;
    transition: box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    box-shadow: 0 0 0 2px var(--orange), 0 2px 8px rgba(0, 0, 0, 0.07);
}

.form-textarea {
    resize: none;
    height: 100px;
}

.btn-submit {
    background: var(--orange);
    color: var(--white);
    font-family: 'Nunito', Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    border: none;
    border-radius: 14px;
    padding: 16px;
    width: 100%;
    cursor: pointer;
    margin-top: 22px;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.btn-submit:hover {
    background: var(--orange-dark);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

.btn-submit:active {
    transform: scale(0.98);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--black);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 999;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== LOGIN PAGE ========== */
.login-body {
    background: #262626;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #000000;
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.login-card .login-logo {
    height: 36px;
    margin-bottom: 4px;
}

.login-card h2 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--white);
    margin-top: -8px;
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #FCA5A5;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-field label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #9CA3AF;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-field input {
    background: #222;
    border: 1px solid #333;
    color: var(--white);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 0.97rem;
    font-family: 'Nunito', Arial, sans-serif;
    outline: none;
    transition: border 0.2s;
}

.login-field input:focus {
    border-color: var(--orange);
}

.btn-login {
    background: var(--orange);
    color: var(--white);
    font-family: 'Nunito', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    border: none;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: var(--orange-dark);
}

/* ========== DASHBOARD PAGE ========== */
.dashboard-body {
    background: #F9FAFB;
    min-height: 100vh;
}

.dashboard-topbar {
    background: var(--black);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-topbar .logo {
    height: 32px;
}

.dashboard-topbar .admin-info {
    color: #9CA3AF;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-topbar .admin-info span {
    color: var(--white);
}

.dashboard-topbar .btn-logout {
    color: var(--orange);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.dashboard-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 24px;
}

.dashboard-content h2 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--black);
    margin-bottom: 24px;
}

.create-form {
    background: var(--white);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.create-form .form-label {
    margin-top: 0;
}

.btn-create {
    background: var(--orange);
    color: var(--white);
    font-family: 'Nunito', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    border: none;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s;
}

.btn-create:hover {
    background: var(--orange-dark);
}

.broadcast-list {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.broadcast-item {
    background: var(--white);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.broadcast-item .b-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--black);
}

.broadcast-item .b-code {
    font-size: 0.82rem;
    color: var(--gray);
    margin-top: 2px;
    font-weight: 600;
}

.broadcast-item .b-links {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.b-links a {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.2s;
}

.b-links .link-admin {
    background: var(--black);
    color: var(--white);
}

.b-links .link-user {
    background: var(--orange-light);
    color: var(--orange-dark);
}

.b-links .link-admin:hover {
    background: #333;
}

.b-links .link-user:hover {
    background: #FFE0CA;
}