* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header h1 {
    color: #667eea;
    font-size: 2em;
    display: inline-block;
}

.header nav {
    float: right;
    margin-top: 10px;
}

.header nav a {
    color: #555;
    text-decoration: none;
    margin-left: 20px;
    padding: 5px 10px;
    border-radius: 20px;
    transition: all 0.3s;
}

.header nav a:hover {
    background: #667eea;
    color: white;
}

.hero {
    padding: 80px 0;
    text-align: center;
    color: white;
}

.hero h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
}

.daily-word-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.daily-word-card .word-front, .daily-word-card .word-back {
    backface-visibility: hidden;
}

.daily-word-card .word-back {
    transform: rotateY(180deg);
}

.daily-word-card.flipped .word-front {
    display: none;
}

.daily-word-card.flipped .word-back {
    display: block;
}

.daily-word-card h3 {
    font-size: 2em;
    color: #333;
}

.daily-word-card .phonetic {
    color: #666;
    margin: 10px 0;
}

.daily-word-card button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
}

.daily-word-card button:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.section {
    padding: 80px 0;
}

.section h2 {
    color: white;
    margin-bottom: 40px;
    font-size: 2.2em;
}

.bg-light {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.bg-light h2 {
    color: white;
}

.flashcard-container {
    max-width: 600px;
    margin: 0 auto;
}

.flashcard {
    width: 100%;
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: white;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

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

.card-controls button {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.card-controls button:hover {
    background: #667eea;
    color: white;
}

.ai-chat {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.chat-box {
    height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.message {
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 10px;
    max-width: 80%;
}

.message.ai {
    background: #667eea;
    color: white;
    margin-right: auto;
}

.message.user {
    background: #e9ecef;
    color: #333;
    margin-left: auto;
}

.chat-input {
    display: flex;
    padding: 10px;
    background: white;
    border-top: 1px solid #dee2e6;
}

.chat-input textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 10px;
    resize: none;
    margin-right: 10px;
}

.chat-input button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
}

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

.grammar-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.grammar-card:hover {
    transform: translateY(-5px);
}

.grammar-exercise {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.grammar-exercise button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    margin: 5px;
    cursor: pointer;
}

.listening-levels {
    text-align: center;
    margin-bottom: 30px;
}

.level-btn {
    background: white;
    color: #667eea;
    border: 2px solid white;
    padding: 12px 30px;
    border-radius: 30px;
    margin: 0 10px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.listening-content {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.listening-content button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    margin: 10px 0;
    cursor: pointer;
}

.listening-content textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin: 10px 0;
    resize: vertical;
}

.reading-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 800px;
    margin: 0 auto;
}

.quiz-options button {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    padding: 10px 20px;
    border-radius: 10px;
    margin: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.quiz-options button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.writing-tool {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.writing-tool textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 20px;
    resize: vertical;
}

.writing-tool button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    cursor: pointer;
}

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

.stat {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.stat p {
    font-size: 2em;
    font-weight: bold;
}

.progress-chart {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

#errorList {
    max-width: 700px;
    margin: 0 auto;
}

.error-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.footer {
    background: rgba(0,0,0,0.8);
    color: white;
    text-align: center;
    padding: 30px 0;
}

/* Admin styles */
.admin-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid #e9ecef;
    border-radius: 10px;
}

.login-box button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
}

.admin-panel header {
    background: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-panel main {
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.admin-panel form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.admin-panel textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: monospace;
    margin: 10px 0;
}

.admin-panel button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    cursor: pointer;
}

.hidden {
    display: none;
}

.success {
    color: #28a745;
    margin-top: 10px;
}

.error {
    color: #dc3545;
    margin-top: 10px;
}