:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #10b981;
    --accent: #00e5ff;
    --danger: #ef4444;
    --chat-color: #6366f1;
    --bg-main: #0f172a;
    --bg-sidebar: rgba(15, 23, 42, 0.8);
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-light: #cbd5e1;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-blur: blur(12px);
    --input-bg: rgba(255, 255, 255, 0.03);

    /* Dark Theme Chat Defaults */
    --bg-msg-received: rgba(255, 255, 255, 0.1);
    --text-msg-received: #f8fafc;
}

.light-theme {
    --bg-main: #f8fafc;
    --bg-sidebar: rgba(255, 255, 255, 0.9);
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 8px 32px 0 rgba(148, 163, 184, 0.2);
    --glass-bg: rgba(0, 0, 0, 0.02);
    --glass-blur: blur(16px);
    --input-bg: #ffffff;

    /* Light Theme Chat Defaults */
    --bg-msg-received: #f1f5f9;
    --text-msg-received: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    background: linear-gradient(135deg, var(--bg-main) 0%, var(--bg-card) 100%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    letter-spacing: -0.01em;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    flex-shrink: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 0 24px 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--accent);
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-icon {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.content-section {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
}

.content-section.active {
    display: block;
}

.content-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Main Grid for Kelebek */
.main-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 25px;
    align-items: start;
}

.panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.panel h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.panel h3 {
    font-size: 1rem;
    margin-bottom: 15px;
}

/* Forms */
.add-student-form select,
.add-student-form input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: white;
    font-size: 0.95rem;
}

.add-student-form select:focus,
.add-student-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-success {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    transform: scale(1.02);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    transform: scale(1.02);
}

.btn-secondary {
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.bulk-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.action-buttons button {
    flex: 1;
}

/* Student List */
.student-list {
    margin-top: 25px;
}

.filter-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 12px;
}

.filter-btn {
    flex: 1;
    padding: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

#studentListContainer {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
}

.student-item {
    background: var(--bg-main);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* Classroom View */
.view-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    background: var(--bg-main);
    padding: 12px;
    border-radius: 10px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.control-group select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.class-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 15px;
}

.tab-btn {
    padding: 6px 10px;
    min-width: 35px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.classroom-view {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    min-height: 500px;
}

/* Desk Layout Logic Inherited & Cleaned */
.classroom-grid-v2 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 10px;
}

.desk-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.desk-rectangle-v2 {
    display: flex;
    width: 260px;
    height: 90px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.seat-v2 {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    text-align: center;
}

.seat-num-v2 {
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.student-name-v2 {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.1;
    word-break: break-word;
}

/* Onboarding Modal Styles (Fixes) */
#onboardingModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.onboarding-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    position: relative;
    /* Ensure containment */
}

.onboarding-header h2 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-color), #4338ca);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.onboarding-step {
    margin: 1.5rem 0;
    text-align: left;
}

.onboarding-step label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Avatar Selection */
.avatar-selection {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 15px;
}

.avatar-option {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.avatar-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.1);
}

.avatar-preview-container {
    text-align: center;
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

.avatar-preview-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#finishOnboardingBtn {
    margin-top: 1rem;
    padding: 15px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(58, 123, 213, 0.4);
    width: 100%;
    border-radius: 12px;
    color: white;
    cursor: pointer;
}

#finishOnboardingBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(58, 123, 213, 0.6);
}

.seat-divider-v2 {
    width: 1px;
    background: #eee;
    height: 100%;
}

.teacher-desk {
    background: #fdf2f2;
    border: 2px solid #fee2e2;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 25px;
}

.desk-label {
    font-weight: 700;
    color: #b91c1c;
    font-size: 0.9rem;
}

.duty-teacher-box {
    background: #ef4444;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 5px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Pomodoro Styles */
.pomodoro-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 25px;
}

.pomodoro-timer {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
}

.timer-display {
    font-family: 'Outfit', sans-serif;
    font-size: 7rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 15px;
}

.timer-modes {
    display: flex;
    background: var(--bg-main);
    padding: 5px;
    border-radius: 10px;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

.mode-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.mode-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pomodoro-tasks {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.task-input-group {
    display: flex;
    gap: 8px;
    margin: 15px 0;
}

.task-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.task-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

#addTaskBtn {
    background: var(--primary);
    border: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

#addTaskBtn:hover {
    transform: scale(1.05);
    background: var(--primary-hover);
}

.task-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border);
    transform: translateX(4px);
}

.task-content {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}

.task-check {
    font-size: 1.1rem;
    opacity: 0.6;
}

.task-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
}

.task-item.completed .task-text {
    text-decoration: line-through;
    opacity: 0.5;
}

.task-item.completed .task-check {
    opacity: 1;
}

.task-delete {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    opacity: 0;
    transition: all 0.2s;
}

.task-item:hover .task-delete {
    opacity: 0.6;
}

.task-delete:hover {
    opacity: 1 !important;
    background: rgba(239, 68, 68, 0.1);
}

/* Chat Styles */
.ai-chat-container {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 0.9rem;
}

.message.ai {
    background: var(--primary-light);
    color: var(--primary-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

.ai-chat-input-area input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 25px;
    outline: none;
}

#sendAiBtn {
    background: var(--primary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

/* Clock Styles */
.clock-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.main-clock-card {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 50px rgba(79, 70, 229, 0.3);
}

.clock-label {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.digital-clock {
    font-family: 'Outfit', sans-serif;
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 10px;
}

.current-date {
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0.9;
}

.world-cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
}

.city-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.city-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.city-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.city-time {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

/* Social Hub Styles */
.social-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    height: 700px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* Friends List */
.friends-sidebar {
    background: var(--bg-main);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.friends-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.friends-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.friend-item:hover,
.friend-item.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.friend-avatar {
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.friend-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.friend-status {
    font-size: 0.75rem;
    color: var(--text-light);
}

.friend-status.online {
    color: var(--secondary);
    font-weight: 600;
}

/* Chat Area */
.chat-area {
    display: flex;
    flex-direction: column;
}

.chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.chat-placeholder .chat-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.active-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.friend-name-status {
    display: flex;
    flex-direction: column;
}

.friend-name-status small {
    font-size: 0.7rem;
    color: var(--secondary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg {
    max-width: 70%;
    padding: 10px 14px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.msg.received {
    background: var(--bg-msg-received);
    color: var(--text-msg-received);
    border-radius: 14px 14px 14px 4px;
    align-self: flex-start;
    border: 1px solid var(--border);
}

.msg.sent {
    background: var(--chat-color);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.05) 100%);
    color: white;
    border-radius: 14px 14px 4px 14px;
    align-self: flex-end;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    outline: none;
}

.chat-actions button {
    background: var(--bg-main);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.chat-actions button:hover {
    background: var(--border);
}

/* Video Call Overlay */
.call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 80%;
    display: flex;
    flex-direction: column;
}

.remote-video-container {
    flex: 1;
    background: #111;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.mock-remote-video {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
}

.local-video-container {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 200px;
    height: 150px;
    background: #222;
    border-radius: 12px;
    border: 2px solid white;
    overflow: hidden;
}

.local-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-label {
    position: absolute;
    bottom: 5px;
    left: 10px;
    color: white;
    font-size: 0.7rem;
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 30px;
}

.ctrl-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background 0.2s;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.end-btn {
    background: var(--danger);
    width: auto;
    padding: 0 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
}

.end-btn:hover {
    background: #dc2626;
}

@media print {
    .sidebar {
        display: none;
    }

    .main-content {
        padding: 0;
    }

    .content-header,
    .view-controls,
    .class-tabs,
    .export-buttons,
    .student-panel {
        display: none !important;
    }
}

/* --- Authentication & Design Match --- */

.auth-page .auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(234, 179, 8, 0.25) 0%, rgba(0, 0, 0, 1) 75%) !important;
    background-color: #000000 !important;
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-page .auth-overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 80% auto;
    opacity: 0.25;
    z-index: -1;
    pointer-events: none;
    filter: brightness(1.2) contrast(1.1);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    text-align: center;
}

.auth-header .user-icon {
    color: white;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.auth-header .user-icon svg {
    width: 80px;
    height: 80px;
}

.auth-header h2 {
    color: white !important;
    font-size: 2.5rem !important;
    font-weight: 400 !important;
    margin-bottom: 40px !important;
    font-family: 'Outfit', sans-serif !important;
}

.auth-form label {
    display: block;
    color: white !important;
    font-size: 0.9rem !important;
    margin-bottom: 10px !important;
    font-weight: 500 !important;
    text-align: left;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
    width: 100%;
    background: #e0e0e0 !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 15px !important;
    color: #333 !important;
    font-size: 1rem !important;
    margin-bottom: 20px;
    outline: none;
}

.auth-form input::placeholder {
    color: #888 !important;
}

.form-extras {
    text-align: left;
    margin-bottom: 30px;
}

.remember-me {
    color: white !important;
    font-size: 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer;
}

.login-submit-btn {
    background: #00e5ff !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    padding: 15px !important;
    border-radius: 4px !important;
    letter-spacing: 1px !important;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3) !important;
    width: 100%;
    border: none;
    cursor: pointer;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    width: 100%;
}

.form-footer a {
    color: white !important;
    text-decoration: none !important;
    font-size: 0.85rem !important;
    opacity: 0.8;
}

.form-footer a:hover {
    opacity: 1;
}

.auth-page {
    background: linear-gradient(to bottom right, #3498db, #8e44ad) !important;
    background: var(--bg-main) !important;
    overflow: auto;
    height: auto;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Settings Modern Layout */
.settings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
    height: 600px;
}

.settings-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-card);
    padding: 15px;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.s-tab-btn {
    padding: 12px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 12px;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.s-tab-btn:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.s-tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.settings-main-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow-y: auto;
}

.s-tab-content {
    display: none;
    animation: settingsFadeIn 0.3s ease;
}

.s-tab-content.active {
    display: block;
}

@keyframes settingsFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-info h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    border: none !important;
}

.setting-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Color Picker & Switches */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

#accentColorPicker,
#chatColorPicker {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
}

#accentColorPicker::-webkit-color-swatch-wrapper,
#chatColorPicker::-webkit-color-swatch-wrapper {
    padding: 0;
}

#accentColorPicker::-webkit-color-swatch,
#chatColorPicker::-webkit-color-swatch {
    border: 2px solid white;
    border-radius: 50%;
}

.form-select {
    padding: 10px 15px;
    border-radius: 10px;
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
    min-width: 200px;
    cursor: pointer;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-light);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

/* Modal Specifics */
.modal-input {
    width: 100%;
    padding: 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    margin-top: 10px;
}

.modal-input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Social Login Utils */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span {
    padding: 0 10px;
}

.social-login-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.social-btn.google {
    background: white;
    color: #1f1f1f;
    border-color: #ddd;
}

.social-btn.google:hover {
    background: #f8f9fa;
    border-color: #c6c6c6;
}


/* --- Music Player Styles --- */
#music-section .music-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    padding: 20px;
}

#music-section .player-card {
    background: rgba(17, 17, 17, 0.95);
    border: 1px solid var(--accent-color, #eab308);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    color: white;
}

#music-section .album-art-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 30px;
}

#music-section .album-art {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #333 0%, #111 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    box-shadow: 0 0 30px rgba(234, 179, 8, 0.3);
    border: 4px solid var(--accent-color, #eab308);
    transition: transform 0.5s ease;
}

#music-section.playing .album-art {
    animation: rotateAlbum 20s linear infinite;
}

@keyframes rotateAlbum {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#music-section .music-waves {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 30px;
}

#music-section .music-waves span {
    width: 3px;
    height: 10px;
    background: var(--accent-color, #eab308);
    border-radius: 2px;
}

#music-section.playing .music-waves span {
    animation: waveAnim 1s ease-in-out infinite;
}

@keyframes waveAnim {

    0%,
    100% {
        height: 10px;
    }

    50% {
        height: 30px;
    }
}

#music-section .music-waves span:nth-child(2) {
    animation-delay: 0.2s;
}

#music-section .music-waves span:nth-child(3) {
    animation-delay: 0.4s;
}

#music-section .music-waves span:nth-child(4) {
    animation-delay: 0.1s;
}

#music-section .music-waves span:nth-child(5) {
    animation-delay: 0.3s;
}

#music-section .track-info h2 {
    color: white;
    margin: 10px 0 5px;
    font-size: 1.8rem;
    font-weight: 700;
}

#music-section .track-info p {
    color: var(--accent-color, #eab308);
    font-weight: 600;
    margin-bottom: 30px;
}

#music-section .player-controls {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}

#music-section .p-ctrl-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

#music-section .p-ctrl-btn:hover {
    transform: scale(1.2);
}

#music-section .play-btn {
    font-size: 3rem;
    background: var(--accent-color, #eab308);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
}

#music-section .progress-area {
    width: 100%;
    margin-bottom: 20px;
}

#music-section .time-display {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

#music-section #progressBar {
    width: 100%;
    accent-color: var(--accent-color, #eab308);
    height: 6px;
    border-radius: 3px;
    cursor: pointer;
}

#music-section .volume-area {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

#music-section #volumeSlider {
    width: 150px;
    accent-color: var(--accent-color, #eab308);
    height: 4px;
}

#music-section .playlist-card {
    background: rgba(30, 30, 30, 0.6);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#music-section .playlist-card h3 {
    margin-bottom: 20px;
    color: white;
    font-size: 1.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

#music-section .playlist-items {
    max-height: 450px;
    overflow-y: auto;
}

#music-section .playlist-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
}

#music-section .playlist-item:hover {
    background: rgba(234, 179, 8, 0.1);
}

#music-section .playlist-item.active {
    background: var(--accent-color, #eab308);
    color: black !important;
}

#music-section .playlist-item.active .track-tag,
#music-section .playlist-item.active p {
    color: black !important;
}

#music-section .track-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

/* --- Responsive Design (Mobile & Tablet) --- */

@media screen and (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .pomodoro-container {
        grid-template-columns: 1fr;
    }

    #music-section .music-container {
        grid-template-columns: 1fr;
    }

    .social-container {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 600px;
    }

    .friends-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 300px;
    }
}

@media screen and (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
    }

    .app-container {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        transition: left 0.3s ease;
        z-index: 1000;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        padding: 15px;
        padding-top: 70px;
        width: 100%;
    }

    .mobile-nav-toggle {
        display: flex;
        position: fixed;
        top: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
        background: var(--primary);
        color: white;
        border-radius: 10px;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 900;
        box-shadow: 0 4px 15px var(--primary-glow);
    }

    .content-header h1 {
        font-size: 1.6rem;
    }

    .panel {
        padding: 15px;
    }

    /* Kelebek Grid Mobile Fix */
    .classroom-view {
        overflow-x: auto;
        padding: 10px;
    }

    .classroom-grid-v2 {
        min-width: 800px;
        /* Allow horizontal scroll for the grid on small screens */
    }

    .desk-rectangle-v2 {
        width: 240px;
    }

    /* Pomodoro Mobile */
    .timer-display {
        font-size: 4rem;
    }

    /* Music Mobile */
    #music-section .player-card {
        padding: 20px;
    }

    #music-section .album-art-container {
        width: 150px;
        height: 150px;
    }

    /* Settings Mobile */
    .settings-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .settings-sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .s-tab-btn {
        white-space: nowrap;
    }

    /* Digital Clock Mobile */
    .digital-clock {
        font-size: 3.5rem;
    }
}

/* Ensure mobile toggle is hidden by default on desktop */
.mobile-nav-toggle {
    display: none;
}