* {
    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;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    padding: 40px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.upload-section {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-section:hover {
    border-color: #764ba2;
    background: #f0f1ff;
}

.upload-section.dragover {
    border-color: #764ba2;
    background: #e8e9ff;
    transform: scale(1.02);
}

#fileInput {
    display: none;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-text {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 5px;
}

.upload-hint {
    color: #999;
    font-size: 14px;
}

.csv-format {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 13px;
    text-align: left;
}

.csv-format code {
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.flashcard-container {
    display: none;
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.flashcard {
    background: white;
    border-radius: 15px;
    padding: 60px 40px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    border: 2px solid #e0e0e0;
}

.flashcard:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.topic {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.difficulty {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.card-content {
    text-align: center;
    font-size: 20px;
    color: #333;
    line-height: 1.6;
}

.question {
    font-weight: 600;
    color: #667eea;
}

.answer {
    color: #2ecc71;
    font-weight: 500;
}

.flip-hint {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 12px;
    color: #999;
}

.review-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: #f39c12;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.review-btn:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

.controls {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

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

.shuffle-btn {
    background: #764ba2;
}

.shuffle-btn:hover {
    background: #5a3a7a;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .flashcard {
        padding: 40px 20px;
        min-height: 250px;
    }

    .controls {
        flex-wrap: wrap;
    }

    button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Auth Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 10px;
    text-align: center;
    font-size: 24px;
}

.modal-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

#authForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#authForm input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#authForm input:focus {
    outline: none;
    border-color: #667eea;
}

#authSubmitBtn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#authSubmitBtn:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.auth-toggle {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

#toggleAuthMode {
    color: #667eea;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

#toggleAuthMode:hover {
    color: #764ba2;
}

/* Deck List Styles */
.deck-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.deck-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.deck-list-header h1 {
    color: white;
    margin: 0;
}

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

.deck-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.deck-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.deck-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.deck-card-info {
    color: #666;
    font-size: 14px;
}

.delete-deck-btn {
    margin-top: 15px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.delete-deck-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}