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

:root {
    --bg-main: #f8fafc;
    --bg-panel: rgba(255, 255, 255, 0.9);
    --bg-panel-solid: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-active: rgba(14, 165, 233, 0.5);
    
    --accent: #0284c7;
    --accent-hover: #0369a1;
    --accent-glow: rgba(14, 165, 233, 0.15);
    --accent-danger: #ef4444;
    
    --cut-color: #ef4444;
    --engrave-color: #000000;
    
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --text-secondary: #334155;
    
    --font-title: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --header-height: 60px;
    --card-radius: 10px;
    --transition-speed: 0.2s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* APP HEADER */
.app-header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 0;
}

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

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 4px var(--accent-glow));
    width: 22px;
    height: 22px;
}

.brand-title {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.brand-accent {
    color: var(--accent);
}

.nav-badge {
    background: #e0f2fe;
    color: var(--accent);
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid #bae6fd;
    margin-left: 6px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    text-decoration: none;
    font-family: var(--font-body);
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: #f1f5f9;
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.15);
}

.btn-accent {
    background: #10b981;
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.btn-accent:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.btn-danger:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* MAIN CONTAINER */
.main-container {
    width: 100%;
    max-width: 100%;
    padding: 24px 30px;
}

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

.section-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* CARDS & PANELS */
.panel-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.15s ease;
}

.panel-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
}

/* Dashboard Hero */
.welcome-hero {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.welcome-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-glow);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin: 0 auto 16px;
}

.welcome-title {
    font-family: var(--font-title);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 620px;
    margin: 0 auto 24px;
}

.action-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.action-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
}

.action-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.card-icon {
    width: 42px;
    height: 42px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 16px;
}

.card-title {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* CLASSES GRID */
.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.class-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.class-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.class-name {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.class-code-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 3px 12px;
    background: #e0f2fe;
    color: var(--accent);
    border-radius: 6px;
    border: 1px solid #bae6fd;
    letter-spacing: 0.08em;
}

.class-stats {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.class-actions {
    display: flex;
    gap: 8px;
}

/* FORM CONTROLS & INPUTS */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: var(--font-body);
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent);
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 6px var(--accent-glow);
}

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(15px);
    transition: all 0.25s ease;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

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

.modal-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
}

/* WORKSPACE BAR */
.workspace-bar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.batch-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* SUBMISSIONS GRID */
.submissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.submission-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}

.submission-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

/* STATUS HIGHLIGHT STYLES */
.submission-card.status-retry {
    background: #fffdf5;
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
}

.submission-card.status-done {
    background: #f0fdf4;
    border: 2px solid #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.status-picker-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.status-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    outline: none;
}

.status-btn:hover {
    transform: scale(1.3);
}

.status-btn.active {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px currentColor;
}

.status-btn-todo {
    background-color: #94a3b8;
    color: #64748b;
}

.status-btn-retry {
    background-color: #f59e0b;
    color: #f59e0b;
}

.status-btn-done {
    background-color: #10b981;
    color: #10b981;
}

.card-select-checkbox {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    z-index: 10;
    cursor: pointer;
}

.preview-box {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #ffffff;
    background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 12px 12px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    padding: 10px;
}

.preview-box svg {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    object-fit: contain;
}

.submission-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.student-nickname {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.version-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    background: #d1fae5;
    color: #059669;
    border-radius: 6px;
    border: 1px solid #a7f3d0;
}

.version-drawer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    display: none;
}

.version-drawer.open {
    display: block;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    background: #f8fafc;
    margin-bottom: 4px;
}

/* SMART SCREEN PROJECTION VIEW */
body.smartscreen-mode {
    background-color: var(--bg-main);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.smartscreen-split-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    gap: 16px;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.smartscreen-left-panel {
    flex: 0 0 42%;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 340px;
    gap: 14px;
}

.smartscreen-left-header {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-display-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.code-val-large {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
    background: #e0f2fe;
    padding: 2px 14px;
    border-radius: 8px;
    border: 1px solid #bae6fd;
    letter-spacing: 0.1em;
}

.submissions-scroll-feed {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    padding-right: 4px;
    align-content: start;
}

.smartscreen-feed-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
}

.smartscreen-feed-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.smartscreen-feed-card.active-spotlight {
    border: 2px solid var(--accent);
    background: #f0f9ff;
    box-shadow: 0 0 10px var(--accent-glow);
}

.feed-card-preview {
    width: 100%;
    height: 110px;
    background: #ffffff;
    background-image: radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    background-size: 10px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 8px;
}

.feed-card-preview svg {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    object-fit: contain;
}

.feed-card-nickname {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    text-align: center;
}

.feed-card-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 2px;
}

.smartscreen-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.hero-spotlight-full {
    flex: 1;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.hero-full-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.hero-preview-full {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1.5px, transparent 1.5px);
    background-size: 16px 16px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    overflow: hidden;
    box-sizing: border-box;
    margin-top: 40px;
    margin-bottom: 16px;
}

.hero-preview-full svg {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    object-fit: contain;
}

.hero-footer-info {
    text-align: center;
}

.hero-full-name {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.hero-full-time {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}
