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

:root {
    /* Color Palette - Modern Slate & Indigo Theme */
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --surface-hover: #f1f5f9;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #6366f1;
    
    --success-color: #10b981;
    --success-bg: #ecfdf5;
    --success-text: #065f46;
    
    --warning-color: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-text: #92400e;
    
    --danger-color: #ef4444;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;

    --info-color: #3b82f6;
    --info-bg: #eff6ff;
    --info-text: #1e40af;

    /* Spacing & Layout */
    --container-max-width: 1200px;
    --header-height: 80px;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition-base: all 0.2s ease-in-out;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Layout & Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
}

header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

#welcomeText {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Buttons */
button, .btn {
    font-family: var(--font-family);
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-base);
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-btn {
    background-color: var(--surface-hover);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.logout-btn:hover {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    border-color: var(--danger-color);
}

.back-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius-md);
}

.back-btn:hover {
    background-color: var(--surface-hover);
    color: var(--primary-color);
}

.add-btn, .save-btn, .select-student-btn, .add-student-quick-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.add-btn:hover, .save-btn:hover:not(:disabled), .select-student-btn:hover, .add-student-quick-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.refresh-btn, .cancel-btn, .clear-filters-btn, .draft-btn {
    background-color: var(--surface-color);
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.refresh-btn:hover, .cancel-btn:hover, .clear-filters-btn:hover, .draft-btn:hover {
    background-color: var(--surface-hover);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.delete-btn, .action-btn.delete {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

.delete-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
}

.delete-btn:hover {
    background-color: var(--danger-color);
    color: white;
}

/* Dashboard Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.card {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    background: var(--primary-light);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--primary-color);
}

.card h3 {
    color: var(--text-main);
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.card-arrow {
    position: absolute;
    bottom: 24px;
    right: 24px;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition-base);
    color: var(--primary-color);
    font-weight: bold;
}

.card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Sections & Panels */
.section-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-badge {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Tables */
.projects-table-container, .students-table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
}

th {
    background: var(--background-color);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    background-color: var(--surface-hover);
    color: var(--text-main);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.95rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--surface-hover);
}

/* Cursor pointer for all clickable elements */
tbody tr {
    cursor: pointer;
}

tbody tr:hover {
    background-color: var(--surface-hover);
}

/* Action buttons in tables */
.action-btn {
    cursor: pointer;
    transition: var(--transition-base);
}

.action-btn:hover {
    transform: scale(1.1);
}

/* Status Badges */
.status-badge, .finalized-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.ungraded, .finalized-status.pending {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-color); /* Optional subtle border */
}

.status-badge.graded, .finalized-status.finalized {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-color);
}

/* Grade Displays */
.grade-display {
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.grade-display.grade-excellent { color: var(--success-color); background: var(--success-bg); }
.grade-display.grade-good { color: var(--info-text); background: var(--info-bg); }
.grade-display.grade-satisfactory { color: var(--warning-text); background: var(--warning-bg); }
.grade-display.grade-insufficient { color: var(--danger-text); background: var(--danger-bg); }

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: var(--transition-base);
    background: var(--surface-color);
    color: var(--text-main);
}

select {
    cursor: pointer;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.large-modal {
    max-width: 800px;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer, .form-actions {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--background-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
}

/* Close Button */
.close-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: var(--surface-hover);
    color: var(--text-main);
}

/* Detail Page Specifics */
.project-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.info-item label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Evaluation Categories */
.category-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    transition: var(--transition-base);
}

.category-section:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.category-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.category-factor {
    background: var(--background-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
}

/* Recording UI */
.recording-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.record-btn {
    padding: 12px 24px;
    border-radius: 50px; /* Pill shape */
}

.record-btn.start {
    background-color: var(--danger-color);
    color: white;
}

.record-btn.start:hover {
    background-color: #d93030;
}

.record-btn.stop {
    background-color: var(--text-main);
    color: white;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--danger-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 32px;
    color: var(--primary-color);
}

.login-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 16px;
    }
    
    .header-left {
        flex-direction: column;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        border-radius: var(--radius-lg);
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Links */
a {
    cursor: pointer;
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition-base);
}

a:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Clickable labels */
label[for] {
    cursor: pointer;
}

/* Checkbox and Radio buttons */
input[type="checkbox"],
input[type="radio"] {
    cursor: pointer;
}

/* Student Selector Inline */
.student-selector {
    width: 100%;
}

.student-selector-inline {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-top: 12px;
    overflow: hidden;
}

.student-selector-controls {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}

.student-selector-controls .search-box {
    flex: 1;
}

.student-selector-controls .filter-box {
    min-width: 200px;
}

.student-selector-controls input,
.student-selector-controls select {
    width: 100%;
}

.student-selector-list-wrapper {
    max-height: 400px;
    overflow-y: auto;
    background: white;
}

.student-selector-list {
    padding: 8px;
}

.student-selector-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition-base);
    background: white;
    user-select: none;
}

.student-selector-item:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
}

.student-selector-info {
    flex: 1;
}

.student-selector-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.student-selector-meta {
    display: flex;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.student-selector-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
}

.student-selector-footer .footer-left {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.loading-state,
.no-students {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.selected-student-display {
    background: var(--info-bg);
    border-color: var(--info-color);
    color: var(--info-text);
}

/* Multiple Students Display */
.selected-students-display {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 12px;
}

.selected-students-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selected-student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    transition: var(--transition-base);
}

.selected-student-item:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
}

.selected-student-item .student-info {
    flex: 1;
}

.selected-student-item .student-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.selected-student-item .student-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.remove-student-btn {
    background: none;
    border: none;
    color: var(--error-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: var(--transition-base);
    border-radius: var(--radius-sm);
}

.remove-student-btn:hover {
    background: var(--error-bg);
    color: var(--error-text);
}

/* Student selector item selected state */
.student-selector-item.selected {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.student-selector-item.selected .student-selector-name {
    color: var(--primary-color);
    font-weight: 600;
}

/* Action Buttons Specifics */
.action-btn.pdf {
    color: var(--primary-color);
}
.action-btn.pdf:hover {
    background-color: var(--primary-light);
}

.action-btn.email {
    color: var(--success-text);
}
.action-btn.email:hover {
    background-color: var(--success-bg);
}

/* Accordion Styles for Detail Page */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    overflow: hidden;
    background: var(--surface-color);
}

.accordion-header {
    padding: 16px 24px;
    background: var(--surface-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: var(--transition-base);
}

.accordion-header:hover {
    background: var(--surface-hover);
}

.accordion-header.active {
    background: var(--primary-light);
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-light);
}

.accordion-content {
    padding: 24px;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.accordion-content.active {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sticky Footer for Evaluation */
.sticky-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
    z-index: 100;
    margin-left: -24px;
    margin-right: -24px;
    margin-bottom: -24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Adjust card content for sticky footer */
.evaluation-section .section-card {
    padding-bottom: 0;
    overflow: visible; 
}

/* Accordion Icon */
.accordion-header::after {
    content: "▼";
    font-size: 0.8rem;
    margin-left: 12px;
    transition: transform 0.3s;
    color: var(--text-muted);
}
.accordion-header.active::after {
    transform: rotate(180deg);
}
.current-cat-grade {
    margin-left: auto; /* Push to right before the icon */
    margin-right: 12px;
    font-weight: 600;
    color: var(--primary-color);
}


/* Import Modal Styles */
.import-instructions ul {
    margin: 16px 0 16px 24px;
    color: var(--text-muted);
}
.csv-example {
    background: var(--background-color);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.csv-example pre {
    margin-top: 8px;
    white-space: pre-wrap;
    font-family: monospace;
    color: var(--text-main);
}

/* Enhanced Filter/Search Controls */
.filter-controls {
    background: var(--surface-color);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 2; /* Give search more space */
    min-width: 250px;
    position: relative;
}

.search-box input {
    padding-left: 36px; /* Space for icon */
    border-radius: 50px; /* Pill shape for search */
}

/* Search Icon pseudo-element */
.search-box::before {
    content: "🔍";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-options {
    flex: 1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-options select {
    flex: 1;
    min-width: 150px;
    border-radius: var(--radius-md);
    cursor: pointer;
}

/* Button Tweaks in Detail Page Sticky Footer */
.sticky-footer .btn {
    padding: 10px 20px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.sticky-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Ensure Accordion content is visible by default if 'active' class is present */
.accordion-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced UI Buttons for Detail Page */
.ui-btn {
    padding: 12px 24px;
    border-radius: 50px; /* Pill shape */
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    min-width: 140px; /* Ensure minimum width for better touch targets */
}

.ui-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ui-btn .icon {
    font-size: 1.1rem;
}

.ui-btn-secondary {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.ui-btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--surface-hover);
}

.ui-btn-info {
    background: var(--info-color);
    color: white;
}

.ui-btn-info:hover {
    background: #2563eb; /* Darker blue */
}

.ui-btn-success {
    background: var(--success-color);
    color: white;
}

.ui-btn-success:hover {
    background: #059669; /* Darker green */
}

.ui-btn-danger {
    background: var(--danger-color);
    color: white;
}

.ui-btn-danger:hover {
    background: #dc2626; /* Darker red */
}

.ui-btn-gradient {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
}

.ui-btn-gradient:hover {
    opacity: 0.9;
}

/* Modal fixes */
.modal {
    z-index: 2000; /* Ensure above sticky footer */
}

/* Status Group Styles */
.status-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.email-sent-status {
    display: inline-block;
    padding: 3px 8px;
    background: #d1fae5;
    color: #065f46;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.email-pending-status {
    display: inline-block;
    padding: 3px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.finalized-status.finalized {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.finalized-status.pending {
    background: #fed7aa;
    color: #9a3412;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Email Modal Styles */
.project-info-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.project-info-section .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.project-info-section .detail-row:last-child {
    border-bottom: none;
}

.project-info-section label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 150px;
    margin: 0;
}

.project-info-section span {
    flex: 1;
    text-align: right;
    color: var(--text-primary);
}

.email-preview-section {
    margin-top: 24px;
}

.email-preview-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.email-preview-content {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    max-height: 400px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}

.email-preview-content h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.email-preview-content p {
    margin: 12px 0;
    color: var(--text-primary);
}

.email-preview-content .final-grade {
    background: var(--primary-light);
    border-left: 4px solid var(--primary-color);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
}

.email-preview-content ul {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.email-preview-content li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.email-preview-content li:last-child {
    border-bottom: none;
}

.email-preview-content .signature {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-style: italic;
}


/* User Management Page Styles */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.role-admin {
    background-color: #ffd700;
    color: #856404;
}

.role-teacher {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-current {
    background-color: #d4edda;
    color: #155724;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.warning-text {
    color: #dc3545;
    font-weight: 500;
    margin-top: 8px;
}

.modal-small {
    max-width: 500px;
}


.role-user {
    background-color: #e7f3ff;
    color: #0056b3;
}


/* Enhanced Modal Transitions */
.modal {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal.modal-active {
    opacity: 1;
    pointer-events: all;
}

.modal.modal-active .modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Modal backdrop click area */
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Improve modal content positioning */
.modal-content {
    position: relative;
    z-index: 1;
    margin: 20px;
}

/* Better button hover states */
.edit-btn, .delete-btn {
    transition: all 0.2s ease;
    cursor: pointer;
}

.edit-btn:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.delete-btn:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.edit-btn:active, .delete-btn:active {
    transform: scale(0.95);
}

/* Loading state improvements */
.btn-loader {
    animation: spin 1s linear infinite;
}

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

/* Form validation feedback */
.form-group input:invalid:not(:placeholder-shown),
.form-group select:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
}

.form-group input:valid:not(:placeholder-shown),
.form-group select:valid:not(:placeholder-shown) {
    border-color: #28a745;
}

/* Disabled button state */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal close button improvements */
.modal-header .close {
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    color: var(--text-secondary);
    opacity: 0.7;
}

.modal-header .close:hover {
    opacity: 1;
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* Message container improvements */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
