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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffc107 0%, #1a1a1a 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.navbar {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 0;
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    font-size: 24px;
    margin: 0;
}

.session-title-nav {
    font-size: 18px;
    font-weight: 600;
    color: #ffc107;
    flex: 1;
    text-align: center;
    padding: 0 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-topic-nav {
    font-size: 18px;
    font-weight: 600;
    color: #ffc107;
    flex: 1;
    text-align: center;
    padding: 5px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.2s;
}

.session-topic-nav:hover {
    background: rgba(255, 255, 255, 0.1);
}

.session-topic-nav.placeholder {
    color: #888;
    font-style: italic;
    font-weight: 400;
}

.session-topic-nav input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #ffc107;
    color: #ffc107;
    font-size: 18px;
    font-weight: 600;
    outline: none;
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.session-topic-nav input::placeholder {
    color: #888;
    font-style: italic;
    font-weight: 400;
}

.session-title-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.session-title-input:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Authentication Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-box, .join-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 450px;
    width: 100%;
}

.auth-box h1, .join-box h1 {
    color: #ffc107;
    margin-bottom: 10px;
    text-align: center;
}

.auth-box h2, .join-box h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ffc107;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Settings counter groups */
.settings-counters {
    grid-template-columns: repeat(4, 1fr);
}

.counter-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.counter-group .counter-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.counter-group input[type="number"] {
    width: 70px !important;
    text-align: center;
    font-size: 18px;
    padding: 8px;
    margin-bottom: 4px;
}

.counter-group .counter-sublabel {
    font-size: 12px;
    color: #666;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #ffc107;
    color: #1a1a1a;
}

.btn-primary:hover {
    background: #ffb300;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,193,7,0.4);
}

.btn-secondary {
    background: #1a1a1a;
    color: white;
}

.btn-secondary:hover {
    background: #000000;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #8B0000;
    color: white;
}

.btn-danger:hover {
    background: #6B0000;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-vote {
    background: #ffc107;
    color: #333;
    font-weight: bold;
}

.btn-vote:hover {
    background: #ffb300;
}

.btn-unvote {
    background: #6c757d;
    color: white;
    font-size: 12px;
    padding: 6px 12px;
    margin-left: 8px;
}

.btn-unvote:hover {
    background: #5a6268;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    color: #212529;
}

/* Determining Finalists Message */
.determining-finalists {
    text-align: center;
    padding: 60px 20px;
}

.determining-finalists h2 {
    color: #333;
    margin-bottom: 15px;
}

.determining-finalists p {
    color: #666;
    font-size: 18px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #ffc107;
    text-decoration: none;
    font-weight: 500;
}

/* Dashboard */
.dashboard-header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-header h2 {
    margin: 0;
    color: #333;
}

.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.session-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.session-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.session-card-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-card-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pending {
    background: #ffc107;
    color: #333;
}

.status-registration {
    background: #17a2b8;
    color: white;
}

.status-noting {
    background: #007bff;
    color: white;
}

.status-voting {
    background: #28a745;
    color: white;
}

.status-finalist_selection {
    background: #fd7e14;
    color: white;
}

.status-finalists_selected {
    background: #9c27b0;
    color: white;
}

.status-closed {
    background: #6c757d;
    color: white;
}

.status-results, .status-completed {
    background: #6c757d;
    color: white;
}

.session-card-body {
    padding: 20px;
}

.session-card-body p {
    margin: 10px 0;
    color: #666;
}

.session-card-footer {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.empty-state {
    background: white;
    padding: 60px 20px;
    text-align: center;
    border-radius: 10px;
    color: #999;
}

/* Session Management */
.session-header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.session-header h2 {
    margin-bottom: 15px;
    color: #333;
}

.session-code {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    display: inline-block;
}

.code-display {
    font-size: 24px;
    font-weight: bold;
    color: #ffc107;
    letter-spacing: 2px;
}

.session-topic-display {
    margin-top: 10px;
}

.topic-text {
    font-size: 20px;
    font-weight: 600;
    color: #28a745;
    line-height: 1.4;
    display: block;
}

.topic-text em {
    color: #999;
    font-style: italic;
}

/* Tabs */
.tabs {
    display: flex;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-button {
    flex: 1;
    padding: 15px;
    background: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.tab-button:hover {
    background: #f8f9fa;
    color: #666;
}

.tab-button.active {
    background: #ffc107;
    color: #1a1a1a;
}

.tab-content {
    display: block;
}

/* Cards */
.card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
}

/* Collapsible Cards */
.card.collapsible {
    padding: 15px 20px;
}

.card.collapsible .collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    transition: margin-bottom 0.3s;
}

.card.collapsible .collapsible-header:hover {
    color: #ffc107;
}

.card.collapsible .collapse-arrow {
    font-size: 10px;
    transition: transform 0.3s;
    display: inline-block;
}

.card.collapsible.collapsed .collapse-arrow {
    transform: rotate(-90deg);
}

.card.collapsible .collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 1000px;
    opacity: 1;
}

.card.collapsible.collapsed .collapsible-content {
    max-height: 0;
    opacity: 0;
}

.card.collapsible.collapsed .collapsible-header {
    margin-bottom: 0;
}

.collapsible-header .header-timer {
    margin-left: auto;
    background: #1a1a2e;
    color: #ffc107;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
}

.card.collapsible.collapsed {
    padding-bottom: 15px;
}

/* Invite Section */
.invite-section {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.url-input {
    flex: 1;
    min-width: 300px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* Control Buttons */
.control-buttons, .display-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    font-weight: 600;
    color: #333;
}

.banned-participant {
    background-color: #ffe6e6 !important;
    opacity: 0.7;
}

.banned-participant td {
    text-decoration: line-through;
    color: #999;
}

/* Notes Grid */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.note-card {
    background: #ffd700;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
    transform: rotate(-1deg);
    transition: all 0.3s;
    position: relative;
}

.note-card:nth-child(even) {
    transform: rotate(1deg);
}

.note-card:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 5px 5px 20px rgba(0,0,0,0.3);
}

.note-card.favorited {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 5px solid #28a745;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.5);
}

.note-card.finalist {
    background: #4caf50;
    color: white;
}

.note-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 32px;
    padding: 0;
}

.star {
    color: #ccc;
    transition: all 0.3s;
}

.star.filled {
    color: #28a745;
    text-shadow: 0 0 10px rgba(40, 167, 69, 0.7);
    transform: scale(1.2);
    display: inline-block;
}

/* Centered logo */
.logo-centered {
    display: block;
    text-align: center;
    margin: 0 auto;
}

.logo-centered img {
    display: inline-block;
}

.note-content {
    color: #333;
    line-height: 1.6;
    margin-bottom: 10px;
}

.note-image img {
    width: 100%;
    border-radius: 5px;
    margin-top: 10px;
}

.note-link {
    margin-top: 10px;
    font-size: 12px;
}

.note-link a {
    color: #0066cc;
    word-break: break-all;
}

/* Voting Notes */
.voting-note {
    position: relative;
}

.vote-count-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #8B0000;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 40px;
    border-radius: 10px;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.qr-code-container {
    text-align: center;
    padding: 20px;
}

.qr-code-container img {
    max-width: 100%;
    height: auto;
}

/* Participant Styles */
.participant-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.participant-timer {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    z-index: 100;
}

.participant-timer.warning {
    background: rgba(255,152,0,0.9);
    animation: pulse 1s infinite;
}

.participant-timer.expired {
    background: rgba(220,53,69,0.9);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Compact Participant Header Bar */
.participant-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    gap: 15px;
}

.participant-header-bar .header-logo img {
    height: 75px;
    display: block;
}

.participant-header-bar .header-center {
    flex: 1;
    text-align: center;
}

.participant-header-bar .header-center h1 {
    color: #ffc107;
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.2;
}

.participant-header-bar .session-info {
    color: #28a745;
    font-size: 0.85rem;
    margin-top: 2px;
}

.participant-header-bar .participant-timer {
    position: static;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

.participant-header-bar .header-spacer {
    min-width: 80px;
}

.topic-bar {
    background: #fff8e1;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #333;
    text-align: center;
    line-height: 1.4;
    border-left: 4px solid #ffc107;
}

/* Legacy participant header (keep for join.php etc) */
.participant-header {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.participant-header h1 {
    color: #ffc107;
    margin-bottom: 8px;
    font-size: 24px;
    line-height: 1.2;
}

.topic-display, .topic-preview {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 5px;
    margin-top: 8px;
}

.topic-display h2, .topic-preview h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 0;
    line-height: 1.3;
}

.topic-preview p {
    color: #666;
    font-size: 18px;
}

/* Success Message */
.success-message {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.success-message h1 {
    color: #28a745;
    margin-bottom: 20px;
}

.waiting-message {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 10px;
    margin-top: 30px;
    text-align: center;
}

.waiting-screen {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.waiting-content {
    text-align: center;
}

.waiting-content h2 {
    color: #ffc107;
    margin-bottom: 30px;
    font-size: 28px;
}

.session-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.session-info p {
    margin: 10px 0;
    font-size: 16px;
}

.session-info .code-display {
    font-size: 24px;
    font-weight: bold;
    color: #ffc107;
    letter-spacing: 2px;
}

.waiting-message p.subtext {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ffc107;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Note Form */
.note-form-container {
    margin-bottom: 30px;
}

.sticky-note {
    background: #ffd700;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    transform: rotate(-1deg);
}

.sticky-note textarea {
    width: 100%;
    min-height: 80px;
    max-height: 150px;
    border: none;
    background: transparent;
    font-size: 16px;
    resize: vertical;
    font-family: 'Comic Sans MS', cursive;
}

.sticky-note textarea:focus {
    outline: none;
}

.note-attachments {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(0,0,0,0.2);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.note-attachments .form-group {
    margin-bottom: 0;
    flex: 1;
}

.note-attachments label {
    font-size: 14px;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

/* Submitted Notes */
.submitted-notes {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.submitted-notes h3 {
    margin-bottom: 15px;
    color: #333;
}

.notes-list {
    display: grid;
    gap: 10px;
}

.mini-note {
    background: #fff9c4;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #ffd700;
}

.mini-note p {
    margin: 0 0 5px 0;
    color: #333;
}

.mini-note small {
    color: #666;
    font-size: 12px;
}

/* Voting Interface */
.votes-bank {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.votes-bank h3 {
    color: #333;
    margin-bottom: 15px;
}

.vote-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.vote-checkmark {
    font-size: 36px;
    color: #28a745;
}

.view-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.view-toggle button {
    padding: 10px 20px;
    border: 2px solid white;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.view-toggle button.active {
    background: white;
    color: #1a1a1a;
}

.voting-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Voting List View (Table-style) */
.voting-list {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.voting-table {
    width: 100%;
    border-collapse: collapse;
}

.voting-row {
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.voting-row:last-child {
    border-bottom: none;
}

.voting-row:hover {
    background: #fff8e1;
}

.voting-row.can-vote {
    cursor: pointer;
}

.voting-row.can-vote:hover {
    background: #fff3cd;
}

.voting-row.voted {
    background: #e8f5e9;
}

.voting-row.voted:hover {
    background: #c8e6c9;
}

.voting-row td {
    padding: 15px;
    vertical-align: middle;
}

.voting-row-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.voting-row-text {
    flex: 1;
    font-size: 1rem;
    line-height: 1.4;
}

.voting-row-media {
    font-size: 0.9rem;
    opacity: 0.7;
}

.voting-row-status {
    width: 120px;
    text-align: center;
}

.voting-row-actions {
    width: 100px;
    text-align: right;
    white-space: nowrap;
}

.voting-row-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.no-votes-sm {
    font-size: 0.8rem;
    color: #999;
}

.file-preview-btn {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.file-preview-btn:hover {
    background: rgba(0,0,0,0.1);
}

.file-preview-modal {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    padding: 20px;
}

.file-preview-modal .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
}

#filePreviewContent {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

#filePreviewContent img {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Awaiting Finalist Selection */
.awaiting-finalists-banner {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
}

.awaiting-finalists-banner .banner-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.awaiting-finalists-banner h2 {
    color: #f57c00;
    margin: 0 0 8px 0;
    font-size: 1.5rem;
}

.awaiting-finalists-banner p {
    color: #666;
    margin: 0;
}

.readonly-notes-section {
    margin-top: 10px;
}

.readonly-notes-section h3 {
    color: #666;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: normal;
}

.voting-row.readonly {
    cursor: default;
    opacity: 0.85;
}

.voting-row.readonly:hover {
    background: #f8f9fa;
}

.voting-closed-badge {
    background: #6c757d;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.voting-disabled {
    opacity: 0.7;
}

.voting-disabled .note-card,
.voting-disabled .voting-row {
    pointer-events: none;
}

.voting-disabled .note-card .file-preview-btn,
.voting-disabled .voting-row .file-preview-btn,
.voting-disabled .voting-row-media {
    pointer-events: auto;
}

.voting-note-card {
    background: #ffd700;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
    transform: rotate(-1deg);
    transition: all 0.3s;
}

.voting-note-card:nth-child(even) {
    transform: rotate(1deg);
}

.voting-note-card:hover {
    transform: rotate(0deg);
}

.voting-note-card.voted {
    background: #e0e0e0;
    opacity: 0.7;
}

.vote-button-container {
    margin-top: 15px;
    text-align: center;
}

.voted-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: bold;
}

.no-votes {
    color: #999;
    font-style: italic;
}

/* Results */
.results-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.results-container h2 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.finalists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.finalist-card {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    position: relative;
}

.finalist-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #ffd700;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.finalist-card .vote-count {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
}

.finalist-card .note-content {
    color: white;
    line-height: 1.6;
}

.finalists-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
    text-align: center;
}

/* Time Extension Notification */
.notification-card {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 2px solid #ffc107;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: #ffc107; }
    50% { border-color: #ff9800; }
}

.extension-requests-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.extension-requests-list li {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
}

.notification-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Phase Control Buttons on Tab Pages */
.phase-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

/* Finalist Selection on Voting Page */
.note-card.finalist-selected {
    border: 3px solid #28a745;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.finalist-indicator {
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}

.note-card.voting-note {
    cursor: pointer;
    transition: all 0.2s ease;
}

.note-card.voting-note:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Session Timer Display */
.session-timer-display {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.timer-countdown {
    font-size: 24px;
    font-weight: bold;
    color: #1976d2;
    font-family: monospace;
}

.timer-countdown.warning {
    color: #ff9800;
}

.timer-countdown.expired {
    color: #f44336;
}

.registration-timer {
    position: relative;
    margin-bottom: 20px;
    text-align: center;
}

/* Sessions Table */
.sessions-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sessions-table thead {
    background: #f8f9fa;
}

.sessions-table th,
.sessions-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.sessions-table th {
    font-weight: 600;
    color: #333;
}

.sessions-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.sessions-table tbody tr:hover {
    background: #fff8e1;
}

.sessions-table tbody tr:last-child td {
    border-bottom: none;
}

/* Warning text for finalists */
.finalist-warning {
    color: #dc3545;
    font-weight: 600;
    padding: 15px;
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Status badges for ended phase */
.status-ended, .status-finalist_selection {
    background: #9c27b0;
    color: white;
}

/* Kick modal */
.kick-reason-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 10px;
}

/* Header controls inline */
.header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.header-controls h3 {
    margin: 0;
}

/* Topic input compact */
.topic-input-compact {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* Alert info */
.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* Presentation Pages */
.presentation-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    padding: 2rem;
    color: white;
}

.presentation-header {
    text-align: center;
    margin-bottom: 2rem;
}

.presentation-header img {
    height: 100px;
    margin-bottom: 1rem;
}

.presentation-phase {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffc107;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
}

.presentation-topic {
    font-size: 1.5rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem;
    border-radius: 10px;
    margin: 2rem auto;
    max-width: 800px;
    text-align: center;
}

.presentation-timer {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffc107;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 2rem;
    font-weight: bold;
    font-family: monospace;
    z-index: 100;
}

.presentation-timer.warning {
    background: rgba(255, 152, 0, 0.9);
    color: white;
    animation: timer-pulse 1s infinite;
}

.presentation-timer.expired {
    background: rgba(128, 128, 128, 0.9);
    color: #ccc;
    animation: none;
}

@keyframes timer-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.presentation-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    max-width: 1100px;
    margin: 2rem auto;
    flex-wrap: wrap;
}

.presentation-row .presentation-qr {
    margin: 0;
    flex-shrink: 0;
}

.presentation-row .presentation-instructions {
    margin: 0;
    flex: 1;
    min-width: 300px;
}

.presentation-qr {
    text-align: center;
    margin: 2rem auto;
}

.presentation-qr img {
    background: white;
    padding: 15px;
    border-radius: 10px;
    max-width: 250px;
}

.presentation-code {
    font-size: 3rem;
    font-weight: bold;
    color: #ffc107;
    letter-spacing: 5px;
    text-align: center;
    margin: 1rem 0;
}

.presentation-url {
    font-size: 1.2rem;
    color: #aaa;
    text-align: center;
    word-break: break-all;
}

.presentation-instructions {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem 3rem;
    border-radius: 10px;
    max-width: 800px;
    margin: 2rem auto;
}

.presentation-instructions h3 {
    color: #ffc107;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.presentation-instructions ol,
.presentation-instructions ul {
    padding-left: 2rem;
    line-height: 2;
    font-size: 1.2rem;
}

.presentation-results {
    max-width: 1000px;
    margin: 2rem auto;
}

.presentation-result-card {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.presentation-result-rank {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    min-width: 50px;
}

.presentation-result-votes {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

.presentation-result-content {
    flex: 1;
    font-size: 1.2rem;
    line-height: 1.4;
}

/* Presentation Thumbnails */
.presentation-thumbnails {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.presentation-thumb {
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.presentation-thumb:hover {
    transform: translateY(-3px);
}

.presentation-thumb:hover .thumb-preview {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: #ffc107;
}

.thumb-preview {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    border: 2px solid #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: all 0.2s;
    overflow: hidden;
}

.thumb-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.thumb-text {
    font-size: 10px;
    color: #ccc;
    padding: 0 5px;
    text-align: center;
}

.thumb-qr {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.thumb-qr .thumb-qr-code {
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 3px;
}

.thumb-registration {
    background: linear-gradient(135deg, #ffc107 0%, #1a1a1a 100%);
}

.thumb-noting {
    background: linear-gradient(135deg, #4caf50 0%, #1a1a1a 100%);
}

.thumb-voting {
    background: linear-gradient(135deg, #2196f3 0%, #1a1a1a 100%);
}

.thumb-results {
    background: linear-gradient(135deg, #9c27b0 0%, #1a1a1a 100%);
}

.presentation-thumb span {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

/* Presentation Light Mode */
body.light-mode .presentation-container {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 50%, #ffffff 100%);
    color: #1a1a1a;
}

body.light-mode .presentation-phase {
    color: #2e7d32;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

body.light-mode .presentation-topic {
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.05);
    border: 2px solid #ffc107;
}

body.light-mode .presentation-timer {
    background: rgba(255, 255, 255, 0.95);
    color: #2e7d32;
    border: 3px solid #ffc107;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

body.light-mode .presentation-timer.warning {
    background: #ffc107;
    color: #1a1a1a;
    border-color: #ff9800;
}

body.light-mode .presentation-timer.expired {
    background: #e0e0e0;
    color: #666;
    border-color: #999;
}

body.light-mode .presentation-code {
    color: #2e7d32;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

body.light-mode .presentation-url {
    color: #555;
}

body.light-mode .presentation-instructions {
    background: rgba(0, 0, 0, 0.03);
    border: 2px solid #4caf50;
}

body.light-mode .presentation-instructions h3 {
    color: #2e7d32;
}

body.light-mode .presentation-instructions ol,
body.light-mode .presentation-instructions ul {
    color: #1a1a1a;
}

body.light-mode .presentation-qr img {
    border: 3px solid #ffc107;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

body.light-mode .presentation-result-card {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

body.light-mode .presentation-result-rank {
    color: #ffc107;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

body.light-mode .presentation-result-votes {
    background: rgba(0, 0, 0, 0.2);
}

body.light-mode .presentation-header img {
    filter: none;
}

body.light-mode p {
    color: #333;
}

body.light-mode .spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: #4caf50;
}

/* Clickable note card */
.note-card.clickable {
    cursor: pointer;
}

.note-card.clickable:hover {
    transform: rotate(0deg) scale(1.03);
}

/* Editable title */
.editable-title {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.2s;
}

.editable-title:hover {
    background: rgba(255, 255, 255, 0.1);
}

.editable-title input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #ffc107;
    color: #ffc107;
    font-size: inherit;
    font-weight: inherit;
    outline: none;
    width: 300px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    /* Keep navbar horizontal but compact */
    .nav-content {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 0 10px;
    }

    .nav-content .nav-logo img {
        height: 30px;
    }

    .session-topic-nav {
        font-size: 14px;
        padding: 0 10px;
        min-width: 0;
    }

    .nav-right .btn {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .sessions-grid {
        grid-template-columns: 1fr;
    }

    .notes-grid,
    .voting-container,
    .finalists-grid {
        grid-template-columns: 1fr;
    }

    /* Keep tabs horizontal with scroll */
    .tabs {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .tabs .tab-button {
        flex: 0 0 auto;
        padding: 12px 15px;
        font-size: 13px;
        white-space: nowrap;
    }

    .form-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .form-row.settings-counters {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .counter-group .counter-label {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .counter-group input[type="number"] {
        width: 50px !important;
        font-size: 14px;
        padding: 6px;
    }

    .counter-group .counter-sublabel {
        font-size: 9px;
    }

    /* Dashboard navbar - keep horizontal */
    .navbar {
        padding: 10px 0;
    }

    .navbar .nav-content {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 0 10px;
    }

    .navbar .nav-logo img {
        height: 30px;
    }

    .navbar .nav-right {
        gap: 6px;
        flex-wrap: nowrap;
    }

    .navbar .nav-right span {
        display: none;
    }

    .navbar .nav-right .btn {
        padding: 6px 10px;
        font-size: 11px;
        white-space: nowrap;
    }

    /* Dashboard header */
    .dashboard-header {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 15px;
    }

    .dashboard-header h2 {
        font-size: 1.1rem;
        white-space: nowrap;
    }

    .dashboard-header .btn {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Sessions table - horizontal scroll */
    .sessions-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sessions-table th,
    .sessions-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .sessions-table th:nth-child(1),
    .sessions-table td:nth-child(1) {
        width: 30px;
    }

    .status-badge {
        padding: 3px 8px;
        font-size: 10px;
    }

    /* Modal adjustments */
    .modal-content {
        margin: 5% auto;
        padding: 20px;
        max-width: 95%;
    }

    /* Invite section - stack vertically on mobile */
    .invite-section {
        flex-direction: column;
    }

    .invite-section .url-input {
        min-width: 100%;
        font-size: 12px;
    }

    .invite-section .btn {
        width: 100%;
        padding: 10px;
        font-size: 13px;
    }

    /* Cards */
    .card {
        padding: 15px;
    }

    .card h3 {
        font-size: 1rem;
    }

    /* Data tables */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    /* Auth pages */
    .auth-box, .join-box {
        padding: 25px 20px;
        margin: 10px;
    }

    .auth-box h2, .join-box h2 {
        font-size: 1.2rem;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input {
        padding: 10px;
        font-size: 14px;
    }

    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .participant-timer {
        top: 10px;
        right: 10px;
        font-size: 18px;
        padding: 10px 15px;
    }

    .participant-header-bar {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 8px 10px;
    }

    .participant-header-bar .header-logo img {
        height: 45px;
    }

    .participant-header-bar .header-center {
        flex: 1;
        min-width: 0;
    }

    .participant-header-bar .header-center h1 {
        font-size: 1rem;
    }

    .participant-header-bar .session-info {
        font-size: 0.75rem;
    }

    .participant-header-bar .participant-timer {
        font-size: 1rem;
        padding: 6px 10px;
        min-width: 60px;
    }

    .participant-header-bar .header-spacer {
        display: none;
    }

    .topic-bar {
        font-size: 1rem;
        padding: 10px 15px;
    }

    /* Collapsible header adjustments */
    .collapsible-header {
        font-size: 14px;
        flex-wrap: nowrap;
    }

    .collapsible-header .header-timer {
        font-size: 0.85rem;
        padding: 3px 8px;
    }

    /* Presentation thumbnails - shrink to fit */
    .presentation-thumbnails {
        gap: 8px;
        justify-content: space-between;
    }

    .presentation-thumb {
        flex: 1 1 0;
        min-width: 0;
    }

    .thumb-preview {
        width: 100%;
        height: 55px;
    }

    .thumb-icon {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .thumb-text {
        font-size: 8px;
    }

    .presentation-thumb span {
        font-size: 10px;
    }

    /* Session Control buttons - keep on one line */
    .control-buttons {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .control-buttons .btn-lg {
        padding: 10px 14px;
        font-size: 12px;
        white-space: nowrap;
    }

    .restart-options {
        flex-wrap: nowrap;
    }

    .restart-options .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
    }

    .restart-options > span {
        font-size: 11px;
        white-space: nowrap;
    }

    /* Dashboard mobile styles */
    .nav-right .welcome-text {
        display: none;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .dashboard-header h2 {
        text-align: center;
    }

    .dashboard-header .btn {
        width: 100%;
    }

    /* Sessions table mobile - hide Created column, tighten spacing */
    .sessions-table th.hide-portrait,
    .sessions-table td.hide-portrait {
        display: none;
    }

    .sessions-table {
        font-size: 14px;
    }

    .sessions-table th:nth-child(1),
    .sessions-table td:nth-child(1) {
        width: 30px;
        padding: 8px 4px;
    }

    .sessions-table th,
    .sessions-table td {
        padding: 8px 6px;
    }

    .sessions-table td code {
        font-size: 12px;
    }

    .bulk-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Data table mobile - hide specified columns */
    .data-table th.hide-portrait,
    .data-table td.hide-portrait {
        display: none;
    }

    .data-table {
        font-size: 14px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }

    .data-table .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }

    /* Header controls on participants page */
    .header-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .header-controls h3 {
        text-align: center;
    }

    .header-controls .btn {
        width: 100%;
    }
}
