:root {
    --primary: #6C63FF;
    --primary-hover: #574FD6;
    --primary-light: rgba(108, 99, 255, 0.1);
    --accent: #FF6B6B;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --bg-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --text-main: #2d2d2d;
    --text-light: #6b7280;
    --text-white: #f9fafb;
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.6) inset;
    --card-bg: rgba(255, 255, 255, 0.95);
    --border: rgba(0, 0, 0, 0.08);
    --sidebar-width: 280px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px;
    transition: background 0.6s ease;
    background-attachment: fixed;
}

body.teacher-mode {
    background: var(--bg-dark);
    align-items: stretch;
    padding: 0;
}

/* ===== VIEWS ===== */
.view { width: 100%; display: none; animation: fadeUp 0.5s ease; }
.view.active { display: block; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== GLASS CARD ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 44px 48px;
    box-shadow: var(--glass-shadow);
    max-width: 600px;
    margin: 0 auto;
}

.login-card { max-width: 420px; }

/* ===== HEADER ===== */
.logo-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

header { text-align: center; margin-bottom: 32px; }

h1 {
    font-size: 2.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

h2 { font-size: 1.8rem; font-weight: 700; color: var(--text-main); }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-main); }

.subtitle {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 24px;
}

/* ===== WELCOME MESSAGE ===== */
.welcome-message {
    background: linear-gradient(135deg, rgba(108,99,255,0.06), rgba(240,147,251,0.06));
    border: 1px solid rgba(108,99,255,0.15);
    border-left: 4px solid var(--primary);
    border-radius: 16px;
    padding: 20px 22px;
    text-align: left;
    font-size: 0.92rem;
    line-height: 1.7;
    color: #444;
}

.welcome-message p { margin-bottom: 10px; }
.welcome-message p:last-child { margin-bottom: 0; }

/* ===== FORM ELEMENTS ===== */
form { display: flex; flex-direction: column; gap: 20px; margin-top: 8px; }

.input-group { display: flex; flex-direction: column; gap: 8px; }

label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-main);
    letter-spacing: 0.3px;
}

input[type="text"],
input[type="password"],
textarea,
select {
    font-family: 'Outfit', sans-serif;
    padding: 14px 18px;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: rgba(255,255,255,0.95);
    font-size: 0.97rem;
    color: var(--text-main);
    transition: all 0.25s ease;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108,99,255,0.12);
    background: #fff;
}

textarea { resize: vertical; min-height: 120px; }

/* ===== STAR RATING ===== */
.star-rating {
    display: flex;
    gap: 8px;
    font-size: 2.2rem;
    cursor: pointer;
}

.star {
    color: #d1d5db;
    transition: all 0.2s ease;
    user-select: none;
}

.star.active, .star:hover { color: #f59e0b; transform: scale(1.1); }

/* ===== BUTTONS ===== */
button { font-family: 'Outfit', sans-serif; cursor: pointer; border: none; font-weight: 600; transition: all 0.25s ease; }

.primary-btn {
    background: linear-gradient(135deg, var(--primary), #9b59b6);
    color: white;
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(108,99,255,0.35);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108,99,255,0.45);
}

.primary-btn:active { transform: translateY(0); }

.secondary-btn {
    background: rgba(0,0,0,0.05);
    color: var(--text-main);
    padding: 12px 28px;
    border-radius: 12px;
    margin-top: 12px;
}
.secondary-btn:hover { background: rgba(0,0,0,0.1); }

.text-btn {
    background: transparent;
    color: var(--primary);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
}
.text-btn:hover { background: var(--primary-light); }

.add-btn {
    width: 100%;
    background: rgba(108,99,255,0.1);
    color: var(--primary);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-top: 6px;
    border: 1px dashed rgba(108,99,255,0.3);
}
.add-btn:hover { background: rgba(108,99,255,0.2); border-style: solid; }

.danger-btn-sm {
    width: 100%;
    background: rgba(239,68,68,0.1);
    color: var(--danger);
    padding: 10px;
    border-radius: 10px;
    font-size: 0.88rem;
}
.danger-btn-sm:hover { background: rgba(239,68,68,0.2); }

/* ===== MESSAGES ===== */
.hidden { display: none !important; }

.error-msg {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 10px;
    color: var(--danger);
    padding: 10px 14px;
    font-size: 0.88rem;
}

.info-msg {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 10px;
    color: #92400e;
    padding: 12px 14px;
    font-size: 0.9rem;
}

/* ===== SUCCESS MESSAGE ===== */
#success-message { text-align: center; padding: 40px 0; }

.success-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    display: block;
    animation: successBounce 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes successBounce {
    0%   { transform: scale(0) rotate(-10deg); opacity: 0; }
    60%  { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

#success-message h3 {
    font-size: 1.6rem;
    color: var(--success);
    margin-bottom: 10px;
}

#success-message p { color: var(--text-light); line-height: 1.6; max-width: 320px; margin: 0 auto; }

/* ===== SECRET BUTTON ===== */
#secret-dashboard-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 999;
}

#secret-dashboard-btn:hover {
    opacity: 1;
    transform: scale(1.1) rotate(30deg);
    background: var(--primary);
}

/* ===== DASHBOARD LAYOUT ===== */
#teacher-view.active {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.dashboard-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.dash-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    gap: 20px;
    overflow-y: auto;
    color: var(--text-white);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
}

.sidebar-logo { font-size: 1.6rem; }
.sidebar-header h3 { color: white; font-size: 1.2rem; margin: 0; }

.sidebar-section { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 16px; }

.sidebar-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.sidebar-section input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.88rem;
}

.sidebar-section input::placeholder { color: rgba(255,255,255,0.4); }
.sidebar-section input:focus { border-color: var(--primary); outline: none; background: rgba(255,255,255,0.15); box-shadow: none; }

.sidebar-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }

.sidebar-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    transition: background 0.2s;
}

.sidebar-list-item:hover { background: rgba(255,255,255,0.12); }

.delete-item-btn {
    background: transparent;
    border: none;
    color: rgba(255,100,100,0.6);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 4px;
    transition: color 0.2s;
}

.delete-item-btn:hover { color: var(--accent); }

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; gap: 8px; }

/* ===== MAIN PANEL ===== */
.dash-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
}

.dash-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    flex-wrap: wrap;
    gap: 12px;
}

.dash-top-bar h2 { color: white; font-size: 1.5rem; margin: 0; }
.dash-subtitle { color: rgba(255,255,255,0.5); font-size: 0.88rem; margin-top: 2px; }

.filter-row { display: flex; gap: 10px; }

.filter-row select {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    border-radius: 10px;
    padding: 9px 36px 9px 14px;
    font-size: 0.88rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-row select option { background: #1a1a2e; color: white; }
.filter-row select:focus { outline: none; border-color: var(--primary); box-shadow: none; }

/* ===== STATS ===== */
.stats-row {
    display: flex;
    gap: 16px;
    padding: 20px 28px 0;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 16px 22px;
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.stat-number { font-size: 2rem; font-weight: 700; color: white; }
.stat-label  { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-top: 4px; }

/* ===== FEEDBACK CARDS ===== */
#feedback-list-dash {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feedback-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px 22px;
    transition: transform 0.2s ease, background 0.2s ease;
    animation: fadeUp 0.3s ease;
}

.feedback-card:hover { transform: translateX(4px); background: rgba(255,255,255,0.12); }

.feedback-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.feedback-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(108,99,255,0.25);
    color: #c4b5fd;
}

.feedback-date { font-size: 0.78rem; color: rgba(255,255,255,0.4); }

.feedback-text-content {
    color: rgba(255,255,255,0.85);
    line-height: 1.7;
    font-size: 0.95rem;
}

.feedback-rating { margin-top: 10px; font-size: 1rem; letter-spacing: 2px; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 12px;
    opacity: 0.5;
    margin: auto;
    padding: 60px 0;
}

.empty-state span { font-size: 3.5rem; }
.empty-state p { color: rgba(255,255,255,0.6); font-size: 1rem; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 99px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .glass-card { padding: 28px 20px; }
    h1 { font-size: 1.8rem; }
    .dashboard-wrapper { flex-direction: column; }
    .dash-sidebar { width: 100%; min-width: unset; max-height: 240px; }
    .filter-row { flex-wrap: wrap; }
    body.teacher-mode { padding: 0; }
    .stats-row { padding: 12px 16px 0; }
    #feedback-list-dash { padding: 12px 16px; }
}

/* ===== TAB BAR ===== */
.tab-bar {
    display: flex;
    gap: 6px;
    padding: 12px 28px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.tab-btn {
    background: transparent;
    color: rgba(255,255,255,0.5);
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;
    font-size: 0.92rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.05); }

.tab-btn.active {
    color: white;
    background: rgba(108,99,255,0.15);
    border-bottom: 3px solid var(--primary);
}

/* ===== TAB PANELS ===== */
.tab-panel { display: none; flex: 1; overflow: hidden; }
.tab-panel.active { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

/* ===== SENTIMENT BADGE (feedback card) ===== */
.sent-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

/* ===== SENTIMENT WRAPPER ===== */
.sentiment-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== SENTIMENT CARD ===== */
.sentiment-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 24px 28px;
    transition: background 0.2s ease;
    animation: fadeUp 0.4s ease;
}

.sentiment-card:hover { background: rgba(255,255,255,0.1); }

.sent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 10px;
}

.sent-card-header h3 {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.sent-overall-badge {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 999px;
}

.sent-resp-count {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 20px;
}

/* ===== SENTIMENT BAR GROUP ===== */
.sent-bar-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sent-bar-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sent-label {
    width: 110px;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.sent-label.pos { color: #34d399; }
.sent-label.neg { color: #f87171; }
.sent-label.neu { color: #fbbf24; }

.sent-track {
    flex: 1;
    height: 14px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
}

.sent-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.pos-fill { background: linear-gradient(90deg, #059669, #34d399); }
.neg-fill { background: linear-gradient(90deg, #dc2626, #f87171); }
.neu-fill { background: linear-gradient(90deg, #d97706, #fbbf24); }

.sent-pct {
    width: 40px;
    text-align: right;
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    flex-shrink: 0;
}

