/* Student Item Styles - Updated to match original design */
.student-item {
    background: linear-gradient(90deg, #f0f4f8 0%, #e6eef5 100%);
    border-radius: 12px;
    padding: 2px 6px; /* Further reduce top/bottom space inside the card */
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap; /* Prevent multi-line wrapping that makes cards tall */
    gap: 6px; /* Tighter spacing between elements */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.student-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Avatar styling from original design */
.avatar {
    width: 22px; /* Smaller avatar to reduce card height */
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
    cursor: pointer;
    line-height: 22px; /* Perfect vertical centering for M/R/MR */
    text-align: center; /* Ensure horizontal centering for multi-letter MR */
    letter-spacing: 0; /* Match design tight spacing */
    text-transform: uppercase; /* Enforce M/R/MR uppercase per design */
}
.avatar.math {
    background: linear-gradient(135deg, #007aff, #0a84ff);
}

.avatar.reading {
    background: linear-gradient(135deg, #ff9800, #ff5722);
}

.avatar.both {
    /* Split left/right: blue for M, orange for R */
    background: linear-gradient(90deg, #007aff 0%, #007aff 50%, #ff9800 50%, #ff9800 100%);
}

/* Student Progress Bars - SEPARATE STYLES */
.student-progress-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Initial green background */
    background: linear-gradient(90deg, rgba(100, 200, 150, 0.05), rgba(150, 220, 180, 0.05));
    z-index: 1;
    overflow: hidden;
}

.student-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    /* Initial green color - darker shade */
    background: linear-gradient(90deg, rgba(50, 150, 100, 0.4), rgba(80, 180, 120, 0.4));
    transition: background 0.3s ease, width 1s linear; /* Smooth color transition */
    z-index: 1; /* Ensure it's behind content */
}

/* Color states for student progress */
.student-progress-fill.yellow {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.4), rgba(255, 193, 7, 0.6)); /* Amber */
}

.student-progress-fill.red {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.4), rgba(220, 53, 69, 0.6)); /* Red */
}

.student-progress-fill.blink {
    animation: blink 0.5s infinite alternate;
}

@keyframes blink {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* Student Information - Updated to match original design */
.student-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
    min-width: 0; /* Enable text truncation */
    overflow: hidden;
    justify-content: flex-start; /* Align icons next to name, not right-aligned */
    margin-bottom: 0; /* Override inline style to keep row compact */
}

.student-name {
    font-weight: 500;
    font-size: 14px;
    line-height: 22px;
    display: inline-flex;
    align-items: center;
    height: 22px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    flex-shrink: 0; /* Keep icons on one line */
}

.student-icon {
    font-size: 14px;
    line-height: 1;
    color: #666;
    cursor: pointer;
}

.student-icon.school { color: #007aff; }
.student-icon.laptop { color: #34c759; }
.student-icon.sync { color: #ff9500; }
.student-icon.file { color: #ff2d55; }
.student-icon.tablet { color: #af52de; }

/* Additional student card elements */
.student-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.student-details {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.time-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    text-align: right;
}

.student-progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: 6px;
    overflow: hidden;
    margin-top: 8px;
}

/* Status indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
}
.status-indicator.morning { background: #ffd700; }
.status-indicator.regular { background: #00ff88; }
.status-indicator.vacation { background: #ff6b6b; }
.student-icon.layer { color: #8e8e93; }
.student-icon.school {
    color: #007aff;
}

.student-icon.laptop {
    color: #34c759;
}

.student-icon.sync {
    color: #ff9500;
}

.student-icon.file {
    color: #ff2d55;
}

.student-icon.tablet {
    color: #af52de;
}

/* Action buttons styling */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
    flex-shrink: 0; /* Prevent wrapping that increases card height */
    flex-wrap: nowrap; /* Ensure single-row for actions */
}

/* Student schedule display */
.student-schedule {
    font-size: 10px;
    font-weight: 600;
    color: #6c757d;
    white-space: nowrap;
    padding: 2px 6px;
    background: rgba(108, 117, 125, 0.08);
    border-radius: 4px;
    line-height: 1.2;
}

/* Color-coded day abbreviations in schedule with backgrounds */
.student-schedule .day-monday {
    color: #fff; /* White text */
    background: #dc3545; /* Red background */
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
}

.student-schedule .day-tuesday {
    color: #fff; /* White text */
    background: #6f42c1; /* Purple background */
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
}

.student-schedule .day-wednesday {
    color: #fff; /* White text */
    background: #28a745; /* Green background */
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
}

.student-schedule .day-thursday {
    color: #fff; /* White text */
    background: #6f42c1; /* Purple background */
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
}

.student-schedule .day-friday {
    color: #fff; /* White text */
    background: #007bff; /* Blue background */
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
}

.student-schedule .day-weekend {
    color: #fff; /* White text */
    background: #6c757d; /* Gray background */
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
}

/* Container for navigation arrows */
.student-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

/* Arrow buttons */
.arrow-button {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: inline-flex; /* Keep arrows side-by-side */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
    font-size: 12px;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.arrow-button:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
}
.left-arrow { margin-right: 4px; }
.right-arrow { margin-left: 4px; }

/* Tooltip styling */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip-content {
    position: fixed;
    background: rgba(60, 60, 60, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 2147483647;
    max-width: 240px;
    text-align: left;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 120px;
}

/* Tooltip Styles */
.student-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1001;
    pointer-events: none;
    transform: translateX(-50%) translateY(-100%);
    white-space: nowrap;
    display: none;
}

.student-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

/* Multi-row Layout Support */
.column {
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.column .student-item {
    width: 100%;
    box-sizing: border-box;
}

/* Responsive adjustments - keep card compact and aligned with design */
@media (max-width: 1200px) {
    .student-item {
        padding: 2px 6px;
        min-height: 0;
    }
    .avatar {
        width: 20px;
        height: 20px;
    }
    .student-name { font-size: 13px; line-height: 1.2; }
    .student-icon { line-height: 1; }
}

@media (max-width: 768px) {
    .student-item {
        padding: 2px 6px;
        min-height: 0;
    }
    .avatar {
        width: 18px;
    }
    .student-name { font-size: 12px; line-height: 1.2; }
    .student-icons { gap: 4px; }
    .student-icon { line-height: 1; }
}

/* Column-specific styling */
#student-list .student-item { border-left: 4px solid #6c757d; }
#checked-in .student-item {
    border-left: 4px solid #6f42c1; /* Darker purple accent to match column */
    background: linear-gradient(135deg, #ede7f6 0%, #f8f9fa 100%);
}
#finished .student-item {
    border-left: 4px solid #1e7e34; /* Darker green accent to match design */
    background: linear-gradient(135deg, #e8f5e8 0%, #f8f9fa 100%);
}
#checked-out .student-item {
    border-left: 4px solid #c82333; /* Darker red accent to match design */
    background: linear-gradient(135deg, #ffebee 0%, #f8f9fa 100%);
}

/* Progress animations */
.student-progress-fill.animate { animation: progressFill 2s ease-in-out; }
@keyframes progressFill {
    from { width: 0%; }
    to { width: var(--progress-width, 75%); }
}

/* Enhanced hover effects */
.student-item:hover .avatar { box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25); }
.student-item:hover .student-progress-fill { background: linear-gradient(90deg, #007bff 0%, #0056b3 100%); }

/* White text only in columns with progress bars (not column 1) */
#checked-in .student-item:hover .student-name,
#finished .student-item:hover .student-name,
#checked-out .student-item:hover .student-name { color: #fff; }

#checked-in .student-item:hover .student-icon,
#finished .student-item:hover .student-icon,
#checked-out .student-item:hover .student-icon { color: rgba(255, 255, 255, 0.9); }

/* Loading states */
.student-item.loading { opacity: 0.7; pointer-events: none; }
.student-item.loading .avatar { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.data-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* Global popup container (support id used in index.html) */
#global-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}
#global-popup-container > * { pointer-events: auto; }

/* Popup menu styles moved to css/popupmenu.css to avoid duplication */

.action-buttons {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

/* Design-aligned action button styling */
.action-btn {
  width: 20px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.5);
  color: #333;
  font-size: 10px;
  padding: 0;
  flex: 0 0 auto;
  cursor: pointer;
}
.action-btn i {
  font-size: 10px;
}
.action-btn:hover {
  background: rgba(255, 255, 255, 0.65);
}

/* Deprecated arrow styles kept for compatibility but not used */
.arrow-button { display: none; }
.left-arrow, .right-arrow { margin: 0; }

/* Neutralize old column height/overflow to use .scroll-container per design */
.column {
  min-height: 0;
  max-height: none;
  overflow: hidden;
}
/* Name-hover tooltip enhancements */
.name-tooltip {
    background: rgba(34, 34, 34, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    padding: 10px 12px;
    border-radius: 12px;
}
.name-tooltip-inner { display: flex; flex-direction: column; gap: 8px; }
.name-tooltip-title { font-weight: 600; font-size: 13px; color: #fff; opacity: 0.95; }
.name-tooltip-message { font-size: 12px; color: rgba(255,255,255,0.75); font-style: italic; text-align: center; padding: 4px 0; }
.name-tooltip-grid { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 4px; align-items: baseline; }
.name-tooltip .label { color: rgba(255,255,255,0.7); }
.name-tooltip .value { color: #fff; font-weight: 600; letter-spacing: 0.2px; }
.name-tooltip .hint { margin-top: 6px; font-size: 12px; color: rgba(255,255,255,0.8); }