/* UI Components */

/* Folder Select */
.folder-select {
    background-color: var(--dark-surface);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-dark);
}

.folder-select h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-light);
}

.folder-select p {
    margin-bottom: 1rem;
    color: var(--text-dim);
}

/* Buttons */
button {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

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

button:disabled {
    background-color: var(--border-dark);
    color: var(--text-dim);
    cursor: not-allowed;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--dark-surface);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-dark);
}

.navigation-buttons {
    display: flex;
    gap: 0.5rem;
}

.student-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-light);
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background-color: transparent;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-dim);
}

.theme-toggle:hover {
    background-color: var(--dark-surface-lighter);
    color: var(--text-light);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
}

/* Grading Interface */
#grading-interface {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.content-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background-color: var(--dark-surface);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: 1px solid var(--border-dark);
}

.submission-area {
    display: flex;
    flex: 1;
    min-height: 0;
    background-color: var(--dark-surface);
    border-bottom: 1px solid var(--border-dark);
    overflow: auto;
}

.submission-column,
.reference-column {
    flex: 1;
    padding: 1rem;
    overflow: auto;
}

.submission-column {
    border-right: 1px solid var(--border-dark);
}

.column-header {
    font-weight: 500;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-light);
}

/* File Display */
.file-container {
    background-color: var(--dark-surface-lighter);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.file-header {
    padding: 0.5rem 1rem;
    background-color: var(--dark-surface);
    border-bottom: 1px solid var(--border-dark);
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copy-button {
    background-color: transparent;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.copy-button:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.copy-button svg {
    width: 14px;
    height: 14px;
}

.file-content {
    /* Removed padding from container */
    padding: 0;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--code-bg);
}

pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    /* Preserve line breaks */
    white-space: pre;
    word-wrap: normal;
    tab-size: 4;
    /* Added padding to pre instead of container */
    padding: 1rem;
}

code {
    /* Ensure code preserves line breaks */
    white-space: pre;
    display: block;
}

.hljs {
    background: transparent;
    padding: 0;
    /* Ensure highlight.js preserves line breaks */
    white-space: pre;
}

/* Line numbers styling */
.hljs-line-numbers {
    text-align: right;
    border-right: 1px solid var(--border-dark);
    color: var(--text-dim);
    /* Increased right padding */
    padding-right: 1.2em !important;
    /* Increased left padding */
    padding-left: 1em !important;
    /* Increased minimum width */
    min-width: 4.5em;
    /* Added right margin for spacing */
    margin-right: 1em;
}

/* Feedback Area */
.feedback-area {
    padding: 1rem;
    display: flex;
    gap: 1rem;
    min-height: 200px;
    max-height: 300px;
    background-color: var(--dark-surface);
}

.comment-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.comment-section textarea {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    resize: none;
    font-family: inherit;
    font-size: 0.9rem;
    background-color: var(--dark-surface-lighter);
    color: var(--text-light);
}

.comment-section textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(77, 132, 226, 0.3);
}

.grading-section {
    width: 150px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grade-dropdown {
    padding: 0.5rem;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    width: 100%;
    font-size: 0.9rem;
    background-color: var(--dark-surface-lighter);
    color: var(--text-light);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aaaaaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1em;
    padding-right: 2rem;
}

.grade-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(77, 132, 226, 0.3);
}

.save-button {
    background-color: var(--success);
    width: 100%;
}

.save-button:hover {
    background-color: var(--success-hover);
}

label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 6px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}

.notification.success {
    background-color: var(--success);
}

.notification.error {
    background-color: var(--danger);
}

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