:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F3F4F6;
    --card-bg: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --error-color: #EF4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

.container {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container.active {
    display: block;
}

/* Login Card */
.login-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-width: 400px;
    margin: 4rem auto;
    text-align: center;
}

.login-card h1 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--primary-hover);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.secondary-btn {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    width: auto;
    padding: 0.5rem 1rem;
}

.secondary-btn:hover {
    background-color: var(--bg-color);
}

.error-msg {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 1rem;
    min-height: 1.5em;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.modal-content h2 {
    margin-bottom: 0.5rem;
}

.student-list {
    list-style: none;
    margin: 1.5rem 0;
}

.student-list li {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.student-list li:hover {
    border-color: var(--primary-color);
    background-color: #F8FAFC;
}

.student-list li strong {
    display: block;
    font-size: 1.1rem;
}

.student-list li span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

#close-modal-btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Dashboard */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.homework-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.homework-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--primary-color);
    transition: transform 0.2s;
}

.homework-card:hover {
    transform: translateY(-2px);
}

.homework-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.homework-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.homework-meta div {
    margin-bottom: 0.25rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #DBEAFE;
    color: #1E40AF;
    margin-top: 0.5rem;
}
.badge.status-done {
    background: #D1FAE5;
    color: #065F46;
}
.badge.status-progress {
    background: #FEF3C7;
    color: #92400E;
}

.pages-highlight {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Upload Pipeline Styles */
.upload-content {
    max-width: 600px;
    width: 95%;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

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

.upload-body {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.upload-body p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.slot-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.slot {
    aspect-ratio: 3/4;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}

.slot:hover {
    background-color: #f1f5f9;
}

.slot.focused {
    border-color: var(--primary-color);
    background-color: #e0e7ff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.slot.has-image {
    border-style: solid;
    border-color: transparent;
}

.slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slot .status-icon {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.upload-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    display: flex;
    justify-content: flex-end;
}
