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

:root {
    --bg-grading: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --bg-editor: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    --bg-gradient: var(--bg-grading);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --primary-color: #2b6cb0;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --accent-color: #4299e1;
    --accent-hover: #3182ce;
    --success-color: #48bb78;
    --koreferent-color: #ed8936;
    --danger-color: #f56565;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --border-radius: 12px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed; /* Ensures gradient stays while scrolling */
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

body.page-editor {
    --bg-gradient: var(--bg-editor);
}

body.page-grading {
    --bg-gradient: var(--bg-grading);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

h1, h2, h3 {
    margin-top: 0;
    font-weight: 600;
}

.grid {
    display: grid;
    gap: 20px;
}

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

/* Drag and Drop Zone */
.drop-zone {
    border: 2px dashed var(--accent-color);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255,255,255,0.4);
    position: relative;
    overflow: hidden;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.drop-zone.dragover {
    background: rgba(66, 153, 225, 0.2);
    border-color: var(--accent-hover);
    transform: scale(1.02);
}

.drop-zone img.preview {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: none;
    margin-top: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Inputs and Buttons */
input[type="number"], input[type="text"], textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    background: rgba(255,255,255,0.8);
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s, transform 0.1s;
}

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

.btn:active {
    transform: scale(0.98);
}

.btn-koreferent {
    background: var(--koreferent-color);
}
.btn-koreferent:hover {
    background: #dd6b20;
}

.btn-success { background: var(--success-color); }
.btn-success:hover { background: #38a169; }

.task-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 10px;
}

.points-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    background: rgba(255,255,255,0.4);
    padding: 15px;
    border-radius: 8px;
}

.points-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.points-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.soll-points {
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(0,0,0,0.05);
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
}

.referent-box {
    border-left: 3px solid var(--accent-color);
    padding-left: 10px;
}

.koreferent-box {
    border-left: 3px solid var(--koreferent-color);
    padding-left: 10px;
}

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

.nav-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: 20px;
}
.nav-links a:hover {
    text-decoration: underline;
}

/* Toast Notification */
#toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

#toast.show {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 768px) {
    .header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .header-bar > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .nav-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .nav-links a, .nav-links button {
        margin-left: 0 !important;
        margin-right: 0 !important;
        text-align: center;
        display: block;
        padding: 10px;
        background: rgba(255,255,255,0.5);
        border-radius: 6px;
        width: 100%;
        box-sizing: border-box;
    }
    .nav-links .btn-koreferent {
        background: var(--koreferent-color);
        color: white;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .points-grid {
        grid-template-columns: 1fr;
    }
    .action-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    select, button {
        width: 100%;
        box-sizing: border-box;
    }
    .soll-points {
        display: block !important;
        margin-bottom: 5px;
    }
}
/* Modal / Comparison Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.comparison-table {
    width: 100%;
    border-collapse: collapse;
}
.comparison-table th, .comparison-table td {
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    text-align: left;
}
.comparison-table th {
    background: rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}
.comparison-table input[type="number"] {
    width: 60px;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
}
.comparison-table textarea {
    width: 100%;
    min-width: 200px;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
    resize: vertical;
}
