/* Android Material Design Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f5f5f5;
    color: #212121;
    overflow-x: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Status Bar */
.status-bar {
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 500;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.status-left {
    display: flex;
    align-items: center;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-right .material-icons {
    font-size: 14px;
}

/* App Bar */
.app-bar {
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    top: 24px;
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.app-bar-content {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.menu-icon {
    margin-right: 16px;
    cursor: pointer;
}

.app-title {
    flex: 1;
    font-size: 20px;
    font-weight: 500;
}

.app-actions {
    display: flex;
    gap: 16px;
}

.app-actions .material-icons {
    cursor: pointer;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    margin-bottom: 80px;
    padding: 16px;
    min-height: calc(100vh - 160px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Greeting Card */
.greeting-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.greeting-content h2 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 4px;
}

.greeting-content p {
    opacity: 0.9;
    font-size: 14px;
}

.greeting-icon .material-icons {
    font-size: 48px;
    opacity: 0.8;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.stat-icon {
    margin-bottom: 8px;
}

.stat-icon .material-icons {
    font-size: 32px;
    color: #667eea;
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: #212121;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 12px;
    color: #757575;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 500;
    color: #212121;
}

.section-header .material-icons {
    color: #757575;
}

/* Subjects Grid */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.subject-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.subject-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.subject-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.subject-card.math .subject-icon {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.subject-card.languages .subject-icon {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.subject-card.sciences .subject-icon {
    background: linear-gradient(135deg, #45b7d1, #96c93d);
}

.subject-card.humanities .subject-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.subject-icon .material-icons {
    color: white;
    font-size: 24px;
}

.subject-card h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #212121;
}

.subject-card p {
    font-size: 12px;
    color: #757575;
    margin-bottom: 12px;
}

.progress-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

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

/* Search Bar */
.search-bar {
    background: white;
    border-radius: 24px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-bar .material-icons {
    color: #757575;
    margin-right: 12px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #212121;
}

.search-bar input::placeholder {
    color: #bdbdbd;
}

/* Lesson List */
.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lesson-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.lesson-item:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.lesson-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.lesson-icon.math {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.lesson-icon.languages {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.lesson-icon.sciences {
    background: linear-gradient(135deg, #45b7d1, #96c93d);
}

.lesson-icon .material-icons {
    color: white;
    font-size: 24px;
}

.lesson-content {
    flex: 1;
}

.lesson-content h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #212121;
}

.lesson-content p {
    font-size: 12px;
    color: #757575;
    margin-bottom: 8px;
}

.lesson-tags {
    display: flex;
    gap: 8px;
}

.tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

.lesson-action .material-icons {
    color: #667eea;
    font-size: 32px;
}

/* Exercise Cards */
.exercise-header {
    text-align: center;
    margin-bottom: 24px;
}

.exercise-header h3 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #212121;
}

.exercise-header p {
    color: #757575;
    font-size: 14px;
}

.exercise-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.exercise-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.exercise-info h4 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #212121;
}

.exercise-info p {
    color: #757575;
    margin-bottom: 12px;
}

.difficulty {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 16px;
}

.difficulty.easy {
    background: #e8f5e8;
    color: #2e7d32;
}

.difficulty.medium {
    background: #fff3e0;
    color: #f57c00;
}

.exercise-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #757575;
    font-size: 14px;
}

.stat .material-icons {
    font-size: 18px;
}

.start-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.start-btn:active {
    transform: scale(0.98);
}

/* Recent Results */
.recent-results {
    margin-top: 32px;
}

.recent-results h4 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #212121;
}

.result-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.result-icon .material-icons {
    color: #4caf50;
    font-size: 32px;
    margin-right: 16px;
}

.result-info {
    flex: 1;
}

.result-info h5 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #212121;
}

.result-info p {
    font-size: 12px;
    color: #757575;
}

.result-score {
    font-size: 24px;
    font-weight: 700;
    color: #4caf50;
}

/* Essay Styles */
.essay-prompt {
    margin-bottom: 32px;
}

.essay-prompt h3 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #212121;
}

.prompt-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.prompt-card h4 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 12px;
    color: #212121;
}

.prompt-card p {
    color: #757575;
    line-height: 1.5;
    margin-bottom: 20px;
}

.write-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.write-btn:active {
    transform: scale(0.98);
}

.essay-history h4 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #212121;
}

.essay-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.essay-info h5 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #212121;
}

.essay-info p {
    font-size: 12px;
    color: #757575;
}

.essay-score {
    text-align: right;
}

.essay-score .score {
    font-size: 24px;
    font-weight: 700;
    color: #4caf50;
}

.essay-score .max {
    font-size: 14px;
    color: #757575;
}

/* Profile Styles */
.profile-header {
    text-align: center;
    margin-bottom: 32px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.profile-avatar .material-icons {
    color: white;
    font-size: 40px;
}

.profile-header h3 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #212121;
}

.profile-header p {
    color: #757575;
    font-size: 14px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.profile-stat {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-stat h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #212121;
}

.profile-stat p {
    font-size: 12px;
    color: #757575;
}

.profile-menu {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.menu-item {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background-color: #f5f5f5;
}

.menu-item .material-icons:first-child {
    color: #757575;
    margin-right: 16px;
}

.menu-item span:nth-child(2) {
    flex: 1;
    font-size: 16px;
    color: #212121;
}

.menu-item .material-icons:last-child {
    color: #bdbdbd;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: white;
    display: flex;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 999;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 4px;
}

.nav-item.active {
    color: #667eea;
}

.nav-item:not(.active) {
    color: #bdbdbd;
}

.nav-item .material-icons {
    font-size: 24px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 998;
}

.fab:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.fab .material-icons {
    color: white;
    font-size: 24px;
}

/* Responsive Design */
@media (max-width: 360px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 12px;
    }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Loading Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #ffffff;
    }
    
    .greeting-card,
    .stat-card,
    .subject-card,
    .search-bar,
    .lesson-item,
    .exercise-card,
    .result-item,
    .prompt-card,
    .essay-item,
    .profile-stat,
    .profile-menu,
    .bottom-nav {
        background: #1e1e1e;
        color: #ffffff;
    }
    
    .section-header h3,
    .lesson-content h4,
    .exercise-info h4,
    .result-info h5,
    .essay-info h5,
    .profile-header h3,
    .profile-stat h4 {
        color: #ffffff;
    }
}