/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    color: #667eea;
}

.back-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.header-stats {
    display: flex;
    gap: 20px;
    font-size: 18px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-text {
    background: transparent;
    color: #667eea;
    text-decoration: underline;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    margin-bottom: 30px;
}

.hero h2 {
    font-size: 36px;
    color: #333;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature {
    text-align: center;
}

.feature .icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.feature h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.feature p {
    color: #666;
    font-size: 14px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.modal-content input:focus {
    outline: none;
    border-color: #667eea;
}

.error {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* Dashboard */
.dashboard {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 40px;
}

.dashboard h2 {
    margin-bottom: 30px;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

/* Achievements */
.achievements h3 {
    margin-bottom: 20px;
}

.achievement-list {
    display: grid;
    gap: 15px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.achievement-icon {
    font-size: 32px;
}

.achievement-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 14px;
    color: #666;
}

/* Learning Page */
.session-progress {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

/* Flashcard */
.flashcard-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
}

.word-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.word-level, .word-category, .word-topic {
    padding: 5px 12px;
    background: #f0f0f0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

.flashcard {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.word-dutch {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.word-pronunciation {
    font-size: 18px;
    color: #999;
    margin-bottom: 10px;
}

.word-gender {
    font-size: 16px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 30px;
}

.word-translation {
    font-size: 24px;
    margin-bottom: 15px;
}

.word-translation-en {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.examples {
    text-align: left;
    width: 100%;
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.examples h4 {
    margin-bottom: 15px;
    color: #667eea;
}

.example {
    margin-bottom: 15px;
}

.example-nl {
    font-weight: 600;
    margin-bottom: 5px;
}

.example-ua {
    color: #666;
    font-size: 14px;
}

/* Answer Buttons */
.answer-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
    margin-top: 30px;
}

.btn-again {
    background: #ff4757;
    color: white;
}

.btn-hard {
    background: #ffa502;
    color: white;
}

.btn-good {
    background: #2ed573;
    color: white;
}

.btn-easy {
    background: #5352ed;
    color: white;
}

.btn-again:hover { background: #ee2e3c; }
.btn-hard:hover { background: #ff8c00; }
.btn-good:hover { background: #26c35a; }
.btn-easy:hover { background: #3b3ad4; }

/* Loading */
.loading {
    text-align: center;
    padding: 100px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Cards */
.no-cards {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
}

.no-cards h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.no-cards p {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: rgba(255, 255, 255, 0.8);
}

/* Admin Edit Button */
.btn-edit-inline {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border: 1px solid #6366f1;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.btn-edit-inline:hover {
    background: #6366f1;
    color: white;
}

.word-meta {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content.edit-modal {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #1f2937;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

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

.btn-danger:hover {
    background: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .answer-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .word-dutch {
        font-size: 36px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content.edit-modal {
        max-width: 100% !important;
    }
}
