/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Wine-inspired color palette */
    --primary-color: #722f37;
    --primary-light: #8b4049;
    --primary-dark: #5a252a;
    --secondary-color: #d4af37;
    --secondary-light: #e6c659;
    --secondary-dark: #b8941f;
    
    /* Neutral colors */
    --background: #fafafa;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --text-primary: #2d2d2d;
    --text-secondary: #666666;
    --text-muted: #999999;
    
    /* Status colors */
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --info: #2196f3;
    
    /* Difficulty colors */
    --easy-color: #4caf50;
    --medium-color: #ff9800;
    --hard-color: #f44336;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: var(--spacing-lg) 0;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    margin: 0 calc(-1 * var(--spacing-sm));
    margin-bottom: var(--spacing-lg);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.title i {
    color: var(--secondary-color);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Access Code Screen */
.access-container {
    max-width: 400px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.access-header {
    margin-bottom: var(--spacing-xl);
}

.access-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.access-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.access-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.access-form {
    margin-bottom: var(--spacing-lg);
}

.code-input-group {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.code-input {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    text-align: left;
    letter-spacing: normal;
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI', system-ui, sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    background: var(--surface);
    color: var(--text-primary);
}

.code-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.1);
}

.code-input::placeholder {
    letter-spacing: 0;
    font-size: 1rem;
    color: var(--text-muted);
}

.access-button {
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.access-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.access-error {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--error);
    font-size: 0.9rem;
    padding: var(--spacing-sm);
    background: rgba(244, 67, 54, 0.1);
    border-radius: var(--radius-sm);
}

.access-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.access-hint i {
    margin-right: var(--spacing-xs);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: var(--spacing-md);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--text-muted);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-md) 0;
}

.menu-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.menu-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.menu-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.menu-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.menu-button {
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.menu-card:hover .menu-button {
    background: var(--primary-dark);
}

/* Selection Screens */
.selection-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.back-button {
    background: var(--surface);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.back-button:hover {
    background: var(--primary-color);
    color: white;
}

.selection-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.selection-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.selection-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.selection-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.selection-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Difficulty specific styling */
.difficulty-easy {
    border-color: var(--easy-color);
}

.difficulty-easy:hover {
    border-color: var(--easy-color);
    background: rgba(76, 175, 80, 0.05);
}

.difficulty-easy .difficulty-icon {
    color: var(--easy-color);
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.difficulty-medium {
    border-color: var(--medium-color);
}

.difficulty-medium:hover {
    border-color: var(--medium-color);
    background: rgba(255, 152, 0, 0.05);
}

.difficulty-medium .difficulty-icon {
    color: var(--medium-color);
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.difficulty-hard {
    border-color: var(--hard-color);
}

.difficulty-hard:hover {
    border-color: var(--hard-color);
    background: rgba(244, 67, 54, 0.05);
}

.difficulty-hard .difficulty-icon {
    color: var(--hard-color);
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

/* File selection styling */
.file-card {
    border-color: var(--primary-color);
}

.file-card:hover {
    border-color: var(--primary-color);
    background: rgba(114, 47, 55, 0.05);
}

.file-card .file-icon {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.file-card .file-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: var(--spacing-xs);
}

.file-card .filename-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    background: var(--background);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin: var(--spacing-xs) 0;
    display: inline-block;
}

/* Statistics */
.statistics-content {
    display: grid;
    gap: var(--spacing-lg);
}

.stat-section {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.stat-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--background);
    border-radius: var(--radius-sm);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: var(--spacing-xs);
}

/* Session Configuration Screen */
.session-config-container {
    max-width: 500px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.config-info {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(114, 47, 55, 0.1) 100%);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.config-info-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.config-info p {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.config-options {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
}

.config-options h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
}

.config-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
}

.radio-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.radio-container input[type="radio"] {
    display: none;
}

.radio-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    margin-right: var(--spacing-sm);
    position: relative;
    transition: all 0.2s ease;
}

.radio-container input[type="radio"]:checked + .radio-checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.radio-container input[type="radio"]:checked + .radio-checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-label {
    font-size: 1rem;
    color: var(--text-primary);
}

/* Checkbox for config */
.checkbox-container-config {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
}

.checkbox-container-config input[type="checkbox"] {
    display: none;
}

.checkbox-checkmark {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-sm);
    margin-right: var(--spacing-sm);
    position: relative;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.checkbox-container-config input[type="checkbox"]:checked + .checkbox-checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-container-config input[type="checkbox"]:checked + .checkbox-checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkbox-label strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.checkbox-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#custom-card-count {
    width: 80px;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    text-align: center;
    transition: all 0.2s ease;
}

#custom-card-count:disabled {
    background: #f0f0f0;
    border-color: #ccc;
    color: #999;
}

#custom-card-count:not(:disabled):focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.2);
}

.config-actions {
    text-align: center;
}

.config-actions .action-button {
    min-width: 200px;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.1rem;
}

/* Custom Study Screen */
.custom-study-container {
    padding: var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
}

.custom-study-info {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(33, 150, 243, 0.05));
    border: 1px solid var(--info);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.custom-study-info i {
    color: var(--info);
    font-size: 1.2rem;
}

.custom-study-info p {
    margin: 0;
    color: var(--text-primary);
}

.custom-study-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--spacing-lg);
}

.custom-study-selection {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.custom-study-selected {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.custom-study-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--background);
}

.custom-study-header-actions {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.custom-study-header h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin: 0;
}

.custom-study-header .action-button.small {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.9rem;
}

.custom-study-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
    max-height: 600px;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.custom-study-folder-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.custom-study-folder-card {
    background: var(--background);
    border: 2px solid var(--secondary-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.custom-study-folder-card:hover {
    border-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    background: rgba(212, 175, 55, 0.05);
}

.custom-study-folder-info {
    flex: 1;
}

.custom-study-folder-checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.custom-study-folder-checkbox-label:hover {
    background: rgba(114, 47, 55, 0.05);
}

.custom-study-checkbox-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
}

.custom-study-item {
    background: var(--background);
    border: 2px solid #ddd;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    position: relative;
}

.custom-study-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.custom-study-item.selected {
    border-color: var(--primary-color);
    background: rgba(114, 47, 55, 0.05);
}

.custom-study-item-checkbox {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
}

.custom-study-item-icon {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-top: var(--spacing-xs);
}

.custom-study-item-icon.folder {
    color: var(--secondary-color);
}

.custom-study-item-icon.file {
    color: var(--primary-color);
}

.custom-study-item-name {
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-word;
}

.custom-study-item-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.custom-study-selected-list {
    flex: 1;
    overflow-y: auto;
    min-height: 300px;
    max-height: 500px;
}

.no-selection-message {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.no-selection-message i {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.5;
}

.custom-study-selected-item {
    background: var(--background);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.custom-study-selected-item-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.custom-study-selected-item-info {
    flex: 1;
}

.custom-study-selected-item-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.custom-study-selected-item-path {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.custom-study-selected-item-input {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.custom-study-selected-item-input label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.custom-study-selected-item-input input {
    width: 80px;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    text-align: center;
}

.custom-study-selected-item-remove {
    background: var(--error);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.custom-study-selected-item-remove:hover {
    background: #d32f2f;
}

.custom-study-actions {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--background);
}

.custom-study-actions .config-options {
    margin-bottom: var(--spacing-md);
}

.custom-study-actions .action-button {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 1.1rem;
}

.custom-study-actions .action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-study-presets-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--background);
}

.custom-study-presets-section h4 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.custom-study-presets-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 300px;
    overflow-y: auto;
}

.no-presets-message {
    text-align: center;
    padding: var(--spacing-md);
    color: var(--text-secondary);
    font-style: italic;
}

.custom-study-preset-item {
    background: var(--background);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    transition: border-color 0.2s ease;
}

.custom-study-preset-item:hover {
    border-color: var(--primary-color);
}

.custom-study-preset-info {
    flex: 1;
    min-width: 0;
}

.custom-study-preset-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-study-preset-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.custom-study-preset-actions {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

/* Session Statistics */
.session-stats-section {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(114, 47, 55, 0.1) 100%);
    border: 2px solid var(--primary-color);
}

.session-stats-details {
    margin-top: var(--spacing-lg);
}

.correct-incorrect-bar {
    height: 12px;
    background: var(--error);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.correct-bar {
    height: 100%;
    background: var(--easy-color);
    transition: width 0.5s ease;
}

.correct-incorrect-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-sm);
    font-size: 0.9rem;
}

.correct-label {
    color: var(--easy-color);
}

.correct-label i, .incorrect-label i {
    margin-right: var(--spacing-xs);
}

.incorrect-label {
    color: var(--error);
}

.no-session-stats {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
}

.no-session-stats i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    display: block;
    color: var(--primary-color);
}

/* Recent Sessions */
.recent-sessions-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.recent-session-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--background);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--text-muted);
}

.session-date {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.session-date i {
    margin-right: var(--spacing-xs);
    color: var(--text-muted);
}

.session-score {
    font-size: 1.2rem;
    font-weight: 700;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    min-width: 60px;
    text-align: center;
}

.session-score.good {
    background: rgba(39, 174, 96, 0.2);
    color: var(--easy-color);
}

.session-score.medium {
    background: rgba(243, 156, 18, 0.2);
    color: var(--medium-color);
}

.session-score.poor {
    background: rgba(231, 76, 60, 0.2);
    color: var(--error);
}

.session-details {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.85rem;
}

.session-details .correct {
    color: var(--easy-color);
}

.session-details .incorrect {
    color: var(--error);
}

.session-details i {
    margin-right: 2px;
}

/* Difficult Cards */
.difficult-cards-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.difficult-card-item {
    padding: var(--spacing-md);
    background: var(--background);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--error);
}

.difficult-card-question {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.difficult-card-answer {
    font-size: 0.9rem;
    color: var(--easy-color);
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(39, 174, 96, 0.1);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--easy-color);
}

.difficult-card-answer i {
    margin-right: var(--spacing-xs);
    color: var(--secondary-color);
}

.difficult-card-stats {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.8rem;
}

.category-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.accuracy-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.accuracy-badge.medium {
    background: rgba(243, 156, 18, 0.2);
    color: var(--medium-color);
}

.accuracy-badge.poor {
    background: rgba(231, 76, 60, 0.2);
    color: var(--error);
}

.attempts {
    color: var(--text-muted);
}

.attempts i {
    margin-left: var(--spacing-xs);
}

.attempts i.fa-check {
    color: var(--easy-color);
}

.attempts i.fa-times {
    color: var(--error);
}

/* Category Performance */
.category-performance-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.category-perf-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--background);
    border-radius: var(--radius-sm);
}

.category-perf-name {
    flex: 0 0 120px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-perf-bar-container {
    flex: 1;
    height: 8px;
    background: var(--text-muted);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.category-perf-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.5s ease;
}

.category-perf-score {
    flex: 0 0 50px;
    font-weight: 600;
    text-align: right;
}

.category-perf-score.good {
    color: var(--easy-color);
}

.category-perf-score.medium {
    color: var(--medium-color);
}

.category-perf-score.poor {
    color: var(--error);
}

/* Folder Statistics */
.folder-stats-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.folder-stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--background);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--secondary-color);
}

.folder-stat-icon {
    font-size: 1.5rem;
    color: var(--secondary-color);
    width: 40px;
    text-align: center;
}

.folder-stat-info {
    flex: 1;
}

.folder-stat-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.folder-stat-details {
    display: flex;
    gap: var(--spacing-lg);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.folder-stat-details span {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.folder-stat-details i {
    color: var(--text-muted);
}

.folder-stat-item.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.folder-stat-item.clickable:hover {
    background: var(--surface);
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.folder-stat-arrow {
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.folder-stat-item.clickable:hover .folder-stat-arrow {
    color: var(--primary-color);
    transform: translateX(5px);
}

.stat-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
    font-style: italic;
}

/* Folder Statistics Header */
.folder-stats-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--text-muted);
}

.folder-stats-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.folder-stats-header h2 i {
    color: var(--secondary-color);
}

/* Folder Files List */
.folder-files-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.folder-file-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--background);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
}

.folder-file-icon {
    font-size: 1.3rem;
    color: var(--primary-color);
    width: 35px;
    text-align: center;
}

.folder-file-info {
    flex: 1;
}

.folder-file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.folder-file-details {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.folder-file-details span {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.folder-file-details i {
    color: var(--text-muted);
}

/* Statistics Actions */
.stat-actions {
    display: flex;
    justify-content: center;
    padding-top: var(--spacing-md);
}

.stat-actions .action-button.danger {
    background: var(--error);
    color: white;
}

.stat-actions .action-button.danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Flashcard Session */
.session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    gap: var(--spacing-md);
}

.progress-info {
    flex: 1;
    text-align: center;
}

.progress-text {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--background);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    width: 0%;
}

.progress-fill.recovery-mode {
    background: linear-gradient(90deg, var(--warning), var(--secondary-color));
    animation: pulse-recovery 1.5s ease-in-out infinite;
}

@keyframes pulse-recovery {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Recovery Notification */
.recovery-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, var(--warning), #e67e22);
    color: white;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.recovery-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.recovery-notification-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.recovery-notification-content i {
    font-size: 2.5rem;
    animation: spin-slow 2s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.recovery-notification-text {
    display: flex;
    flex-direction: column;
}

.recovery-notification-text strong {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.recovery-notification-text span {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Recovery Stats in Results */
.recovery-stats {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), rgba(255, 193, 7, 0.1));
    border: 2px solid var(--warning);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.recovery-stats-content h4 {
    color: var(--warning);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.recovery-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.recovery-stat {
    text-align: center;
}

.recovery-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.recovery-stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.recovery-success-message {
    text-align: center;
    color: var(--success);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.recovery-success-message i {
    font-size: 1.2rem;
}

/* Flashcard */
.flashcard-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.flashcard {
    width: 100%;
    max-width: 600px;
    min-height: 400px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: transform 0.3s ease;
}


.card-front,
.card-back {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.card-category {
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.card-difficulty {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.card-difficulty.easy {
    background: rgba(76, 175, 80, 0.1);
    color: var(--easy-color);
}

.card-difficulty.medium {
    background: rgba(255, 152, 0, 0.1);
    color: var(--medium-color);
}

.card-difficulty.hard {
    background: rgba(244, 67, 54, 0.1);
    color: var(--hard-color);
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.card-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.card-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.card-action-buttons {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    justify-content: center;
}

.reveal-button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    flex: 1;
}

.reveal-button:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

.replace-button {
    background: var(--info);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    flex: 1;
}

.replace-button:hover {
    background: #1976d2;
    transform: translateY(-2px);
}

.mc-action-buttons {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.answer-buttons {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.answer-button {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.answer-button.correct {
    background: var(--success);
    color: white;
}

.answer-button.correct:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.answer-button.incorrect {
    background: var(--error);
    color: white;
}

.answer-button.incorrect:hover {
    background: #da190b;
    transform: translateY(-2px);
}

/* Multiple Choice Card */
.multiple-choice-card {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
}

.multiple-choice-card .card-content {
    margin-bottom: var(--spacing-lg);
}

.card-type-badge {
    background: var(--info);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mc-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.mc-option {
    background: var(--background);
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.mc-option:hover:not(.disabled) {
    border-color: var(--primary-color);
    background: rgba(114, 47, 55, 0.05);
    transform: translateX(4px);
}

.mc-option.selected {
    border-color: var(--primary-color);
    background: rgba(114, 47, 55, 0.1);
}

.mc-option.correct {
    border-color: var(--success);
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.mc-option.incorrect {
    border-color: var(--error);
    background: rgba(244, 67, 54, 0.15);
    color: var(--error);
}

.mc-option.show-correct {
    border-color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

.mc-option.disabled {
    cursor: default;
    opacity: 0.8;
}

.mc-option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.mc-option.correct .mc-option-letter {
    background: var(--success);
}

.mc-option.incorrect .mc-option-letter {
    background: var(--error);
}

.mc-option.show-correct .mc-option-letter {
    background: var(--success);
}

.mc-option-text {
    flex: 1;
}

.mc-option-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.mc-result {
    text-align: center;
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-top: auto;
}

.mc-result-message {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.mc-result-message.correct {
    color: var(--success);
}

.mc-result-message.incorrect {
    color: var(--error);
}

.mc-correct-answer {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.next-button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.next-button:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

/* Session Stats */
.session-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.session-stats .stat-item {
    text-align: center;
}

.session-stats .stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.session-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Results Screen */
.results-container {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

.results-header {
    margin-bottom: var(--spacing-xl);
}

.results-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

.results-icon.excellent {
    color: var(--secondary-color);
}

.results-icon.good {
    color: var(--success);
}

.results-icon.okay {
    color: var(--warning);
}

.results-icon.poor {
    color: var(--error);
}

.results-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.results-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.results-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: var(--spacing-xl);
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.result-stat {
    text-align: center;
}

.result-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

.results-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.action-button {
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.action-button.primary {
    background: var(--primary-color);
    color: white;
}

.action-button.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.action-button.secondary {
    background: var(--surface);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.action-button.secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Error Screen */
.error-container {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

.error-icon {
    font-size: 4rem;
    color: var(--error);
    margin-bottom: var(--spacing-md);
}

.error-container h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.error-container p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

/* Upload Screen */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-tabs {
    display: flex;
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--background);
}

.tab-button {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.tab-button:hover {
    color: var(--primary-color);
    background: rgba(114, 47, 55, 0.05);
}

.upload-tab {
    display: none !important;
}

.upload-tab.active {
    display: block !important;
}

.upload-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.upload-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.upload-section p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* Upload Folder Select */
.upload-folder-select {
    margin-bottom: var(--spacing-lg);
    text-align: left;
}

.upload-folder-select label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.upload-folder-select label i {
    color: var(--secondary-color);
    margin-right: var(--spacing-xs);
}

/* File Upload Area */
.file-upload-area {
    border: 3px dashed var(--text-muted);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(114, 47, 55, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.file-upload-area:hover .upload-icon,
.file-upload-area.dragover .upload-icon {
    color: var(--primary-color);
}

.upload-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: var(--spacing-md);
}

.upload-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* File Info */
.file-info {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--background);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-details {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.file-details i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* File List for Multiple Files */
.file-list {
    margin-top: var(--spacing-lg);
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.selected-files-header {
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.selected-files-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.selected-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm);
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
}

.selected-file-item:last-child {
    margin-bottom: 0;
}

.selected-file-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
    min-width: 0;
}

.selected-file-info i {
    color: var(--primary-color);
    flex-shrink: 0;
}

.selected-file-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-file-size {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.remove-file-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remove-file-btn:hover {
    color: var(--error);
    background: rgba(244, 67, 54, 0.1);
}

/* Upload Progress */
.upload-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
}

.upload-progress .spinner {
    width: 40px;
    height: 40px;
}

/* Upload Results List */
.upload-results-list {
    list-style: none;
    padding: 0;
    margin: var(--spacing-md) 0 0 0;
    text-align: left;
}

.upload-results-list li {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.upload-results-list li:last-child {
    border-bottom: none;
}

/* Text Upload Area */
.text-upload-area {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.text-upload-area label {
    font-weight: 500;
    color: var(--text-primary);
}

.filename-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--surface);
    color: var(--text-primary);
    box-sizing: border-box;
}

.filename-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#json-content {
    width: 100%;
    min-height: 300px;
    max-height: 500px;
    padding: var(--spacing-md);
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: var(--surface);
    color: var(--text-primary);
    box-sizing: border-box;
}

#json-content:focus {
    outline: none;
    border-color: var(--primary-color);
}

.upload-submit-button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    align-self: flex-start;
}

.upload-submit-button:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

/* Upload Result */
.upload-result {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    text-align: center;
}

.upload-result.success {
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid var(--success);
    color: var(--success);
}

.upload-result.error {
    background: rgba(244, 67, 54, 0.1);
    border: 2px solid var(--error);
    color: var(--error);
}

.upload-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-top: var(--spacing-lg);
}

/* File Management Styles */
.manage-files-container {
    max-width: 1000px;
    margin: 0 auto;
}

.file-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.manage-file-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.manage-file-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.manage-file-card.error {
    border-color: var(--error);
}

.file-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.file-icon-large {
    font-size: 2.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.file-info-text {
    flex: 1;
    min-width: 0;
}

.file-info-text h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    word-wrap: break-word;
}

.filename-small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    background: var(--background);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: var(--spacing-xs);
    word-break: break-all;
}

.card-count-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
}

.card-count-badge.error {
    color: var(--error);
}

.file-description-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: var(--spacing-md);
}

.file-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--background);
}

.action-btn {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.action-btn.edit-btn {
    background: var(--primary-color);
    color: white;
}

.action-btn.edit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.action-btn.delete-btn {
    background: var(--surface);
    color: var(--error);
    border: 2px solid var(--error);
}

.action-btn.delete-btn:hover {
    background: var(--error);
    color: white;
    transform: translateY(-2px);
}

.action-btn.add-btn {
    background: var(--success);
    color: white;
}

.action-btn.add-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.action-btn.edit-cards-btn {
    background: var(--info);
    color: white;
}

.action-btn.edit-cards-btn:hover {
    background: #1976d2;
    transform: translateY(-2px);
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.select-all-container {
    display: flex;
    align-items: center;
}

.select-all-label {
    margin-left: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-primary);
}

.bulk-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.bulk-delete-btn,
.bulk-move-btn {
    padding: var(--spacing-sm) var(--spacing-md);
}

.bulk-delete-btn:disabled,
.bulk-move-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.bulk-move-btn {
    background: var(--secondary-color);
}

.bulk-move-btn:hover:not(:disabled) {
    background: #e6a700;
}

/* Checkbox Styling */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: var(--surface);
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary-color);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    display: none;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container input:indeterminate ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-container input:indeterminate ~ .checkmark:after {
    display: block;
    width: 10px;
    height: 2px;
    border: none;
    background: white;
    transform: none;
}

/* File checkbox in card */
.file-checkbox {
    margin-right: var(--spacing-sm);
    flex-shrink: 0;
}

.manage-file-card .file-card-header {
    display: flex;
    align-items: flex-start;
}

.manage-file-card.selected {
    border-color: var(--primary-color);
    background: rgba(114, 47, 55, 0.05);
}

/* Edit Cards Screen */
.edit-cards-container {
    max-width: 1200px;
    margin: 0 auto;
}

.edit-cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.edit-cards-header p {
    margin: 0;
    color: var(--text-primary);
}

.editable-cards-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.edit-category-section {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.edit-category-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--background);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.edit-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.editable-card {
    background: var(--background);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.editable-card.changed {
    border-color: var(--warning);
    background: rgba(255, 152, 0, 0.05);
}

.editable-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.card-number {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.card-difficulty-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.card-difficulty-badge.easy {
    background: rgba(76, 175, 80, 0.1);
    color: var(--easy-color);
}

.card-difficulty-badge.medium {
    background: rgba(255, 152, 0, 0.1);
    color: var(--medium-color);
}

.card-difficulty-badge.hard {
    background: rgba(244, 67, 54, 0.1);
    color: var(--hard-color);
}

.delete-card-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.delete-card-btn:hover {
    color: var(--error);
    background: rgba(244, 67, 54, 0.1);
}

.editable-card-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
}

.editable-field {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.editable-field label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.editable-field textarea {
    width: 100%;
    min-height: 80px;
    padding: var(--spacing-sm);
    border: 1px solid var(--text-muted);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.4;
    resize: vertical;
    background: var(--surface);
    color: var(--text-primary);
    box-sizing: border-box;
    flex: 1;
}

.editable-field textarea.edit-question,
.editable-field textarea.edit-answer {
    min-height: 100px;
}

.editable-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.editable-field select {
    padding: var(--spacing-sm);
    border: 1px solid var(--text-muted);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
}

.editable-field select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.no-cards-message {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-xl);
    font-size: 1.1rem;
}

/* Category type badges */
.category-type-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    margin-left: var(--spacing-sm);
}

.category-type-badge.flashcard-badge {
    background: var(--secondary-color);
    color: white;
}

.category-type-badge.mc-badge {
    background: var(--info);
    color: white;
}

/* Multiple Choice Edit Card */
.editable-mc-card {
    border-left: 3px solid var(--info);
}

.card-type-badge-small {
    background: var(--info);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 2px;
}

.wrong-answers-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.wrong-answer-row {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.wrong-answer-row input {
    flex: 1;
    padding: var(--spacing-sm);
    border: 1px solid var(--text-muted);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    background: var(--surface);
    color: var(--text-primary);
}

.wrong-answer-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.remove-wrong-answer-btn {
    background: var(--error);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remove-wrong-answer-btn:hover {
    background: #da190b;
    transform: scale(1.1);
}

.add-wrong-answer-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: all 0.2s ease;
    align-self: flex-start;
    margin-top: var(--spacing-xs);
}

.add-wrong-answer-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.editable-field label i {
    margin-right: 4px;
}

.editable-field label i.fa-check {
    color: var(--success);
}

.editable-field label i.fa-times {
    color: var(--error);
}

.edit-correct-answer {
    border-color: var(--success) !important;
    background: rgba(76, 175, 80, 0.05) !important;
}

/* Add Method Tabs */
.add-method-tabs {
    display: flex;
    margin-bottom: var(--spacing-lg);
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 4px;
}

.add-method-tab {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    border-radius: var(--radius-sm);
}

.add-method-tab.active {
    background: var(--surface);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.add-method-tab:hover:not(.active) {
    color: var(--primary-color);
}

/* Card Type Tabs for Add Card Form */
.card-type-tabs {
    display: flex;
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--background);
}

.card-type-tab {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.card-type-tab.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.card-type-tab:hover {
    color: var(--primary-color);
    background: rgba(114, 47, 55, 0.05);
}

/* JSON Import Section */
.json-import-info {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(33, 150, 243, 0.05));
    border: 1px solid var(--info);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.json-import-info h3 {
    color: var(--info);
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.json-import-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.json-format-examples {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.json-example {
    font-size: 0.85rem;
}

.json-example strong {
    color: var(--text-primary);
}

.json-example code {
    display: block;
    background: rgba(0, 0, 0, 0.05);
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    overflow-x: auto;
}

#json-import-textarea {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    min-height: 200px;
    resize: vertical;
}

.json-import-preview {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    max-height: 300px;
    overflow-y: auto;
}

.json-import-preview h4 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.json-preview-item {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    border-left: 3px solid var(--primary-color);
}

.json-preview-item.flashcard {
    border-left-color: var(--info);
}

.json-preview-item.multiple_choice {
    border-left-color: var(--secondary-color);
}

.json-preview-item .preview-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.json-preview-item .preview-question {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.json-preview-item .preview-answer {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.json-preview-summary {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.json-preview-summary i {
    color: var(--success);
    font-size: 1.2rem;
}

.json-preview-error {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1), rgba(244, 67, 54, 0.05));
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    color: var(--error);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.json-preview-error i {
    font-size: 1.2rem;
    margin-top: 2px;
}

/* Wrong Answer Input Rows */
.wrong-answer-input-row {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.wrong-answer-input-row input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background: var(--surface);
    color: var(--text-primary);
}

.wrong-answer-input-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#wrong-answers-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.upload-warning {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--warning);
    padding: var(--spacing-sm);
}

@media (max-width: 1200px) {
    .edit-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .edit-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .edit-cards-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }
}

/* Edit File Screen */
.edit-file-info {
    background: var(--background);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-lg);
}

.edit-file-info p {
    margin: var(--spacing-xs) 0;
    color: var(--text-primary);
}

.edit-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

#edit-json-content {
    width: 100%;
    min-height: 400px;
    max-height: 600px;
    padding: var(--spacing-md);
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: var(--surface);
    color: var(--text-primary);
    box-sizing: border-box;
}

#edit-json-content:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Delete Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-md);
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    margin-bottom: var(--spacing-lg);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: var(--spacing-md);
}

.modal-body {
    margin-bottom: var(--spacing-lg);
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.warning-text {
    color: var(--error) !important;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.action-button.danger {
    background: var(--error);
    color: white;
}

.action-button.danger:hover {
    background: #da190b;
    transform: translateY(-2px);
}

/* Loading inline */
.loading-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    gap: var(--spacing-md);
}

.no-files {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-xl);
    font-size: 1.1rem;
}

.no-files-container {
    text-align: center;
    padding: var(--spacing-xl);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 400px;
    margin: var(--spacing-xl) auto;
}

.no-files-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.no-files-container h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.no-files-container p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.no-files-container .action-button {
    display: inline-flex;
}

/* Add Card Form Styles */
.add-card-info {
    background: var(--background);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-lg);
}

.add-card-info p {
    margin: 0;
    color: var(--text-primary);
}

.add-card-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label .required {
    color: var(--error);
}

.form-group textarea,
.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background: var(--surface);
    color: var(--text-primary);
    box-sizing: border-box;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group textarea:focus,
.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Folder Structure Styles */
.folder-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.folder-card-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.folder-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--secondary-color);
}

.folder-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: rgba(212, 175, 55, 0.05);
}

.study-folder-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.study-folder-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.study-folder-btn i {
    font-size: 0.8rem;
}

.folder-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.folder-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.folder-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Breadcrumb */
.file-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-md);
}

.breadcrumb-item {
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.breadcrumb-item:hover {
    background: var(--background);
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Manage Toolbar */
.manage-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.manage-toolbar-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.toolbar-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: all 0.3s ease;
}

.create-folder-btn {
    background: var(--secondary-color);
    color: white;
}

.create-folder-btn:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

.create-file-btn {
    background: var(--primary-color);
    color: white;
}

.create-file-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Create File Screen */
.create-file-container {
    max-width: 700px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.create-file-form {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.form-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid #eee;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: var(--spacing-md);
    padding-bottom: 0;
}

.form-section h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.form-section h3 i {
    font-size: 1rem;
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.form-group label .required {
    color: var(--error);
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--spacing-sm);
    border: 2px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-with-suffix {
    display: flex;
    align-items: stretch;
}

.input-with-suffix input {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
    border-right: none !important;
}

.input-suffix {
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: var(--spacing-sm);
    color: var(--text-secondary);
    font-family: monospace;
    display: flex;
    align-items: center;
}

.card-type-toggle {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.type-toggle-btn {
    flex: 1;
    padding: var(--spacing-sm);
    border: 2px solid #ddd;
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.type-toggle-btn:hover {
    border-color: var(--primary-light);
}

.type-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#create-file-wrong-answers {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

#create-file-wrong-answers input {
    width: 100%;
    padding: var(--spacing-sm);
    border: 2px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

#create-file-wrong-answers input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid #eee;
}

/* Manage Folder Card */
.manage-folder-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 2px solid var(--secondary-color);
}

.manage-folder-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}


.folder-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    margin-bottom: var(--spacing-md);
}

.folder-icon-large {
    font-size: 2.5rem;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.folder-info-text {
    flex: 1;
    min-width: 0;
}

.folder-info-text h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.file-count-badge {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.folder-actions {
    display: flex;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--background);
}

/* Move Button */
.action-btn.move-btn {
    background: var(--secondary-color);
    color: white;
}

.action-btn.move-btn:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

/* Folder Select */
.folder-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
}

.folder-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.folder-select option {
    padding: var(--spacing-sm);
}

/* No files message in folder */
.no-files-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.no-files-message i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    display: block;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: var(--spacing-lg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .selection-grid {
        grid-template-columns: 1fr;
    }
    
    .file-management-grid {
        grid-template-columns: 1fr;
    }
    
    .session-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }
    
    .flashcard {
        min-height: 350px;
    }
    
    .card-front,
    .card-back {
        padding: var(--spacing-lg);
        min-height: 350px;
    }
    
    .answer-buttons {
        flex-direction: column;
    }
    
    .session-stats {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .results-stats {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .edit-actions {
        flex-direction: column;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .file-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-xs);
    }
    
    .header {
        margin: 0 calc(-1 * var(--spacing-xs));
        padding: var(--spacing-md) 0;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .menu-card,
    .selection-card {
        padding: var(--spacing-lg);
    }
    
    .flashcard {
        min-height: 300px;
    }
    
    .card-front,
    .card-back {
        padding: var(--spacing-md);
        min-height: 300px;
    }
}
