* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #F5F5F5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background-color 0.3s ease;
}

/* Light theme (default) */
body.theme-light {
    background: #F5F5F5;
}

/* Dark theme */
body.theme-dark {
    background: #000000;
}

body.theme-dark .phone-frame {
    background: #1a1a1a;
}

body.theme-dark .phone-screen {
    background: #121212;
    color: #FFFFFF;
}

body.theme-dark .app-content {
    background: #121212;
}

body.theme-dark .card {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .form-input {
    background: #1E1E1E;
    border-color: #333333;
    color: #FFFFFF;
}

body.theme-dark .form-input:focus {
    border-color: #6C63FF;
}

body.theme-dark .btn-title,
body.theme-dark .stat-label,
body.theme-dark .stat-value {
    color: #FFFFFF;
}

body.theme-dark .btn-subtitle {
    color: #B0B0B0;
}

body.theme-dark .word-card {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .question-card {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .answer-btn {
    background: #1E1E1E;
    border-color: #333333;
    color: #FFFFFF;
}

body.theme-dark .result-card {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .profile-card {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .stat-card {
    background: #2C2C2C;
}

body.theme-dark .dictionary-item {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .word-item {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .settings-section {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .settings-label {
    color: #FFFFFF;
}

body.theme-dark .settings-description {
    color: #B0B0B0;
}

body.theme-dark .search-input {
    background: #1E1E1E;
    border-color: #333333;
    color: #FFFFFF;
}

body.theme-dark .search-box {
    background: #1E1E1E;
}

body.theme-dark .dictionary-selector select {
    background: #1E1E1E;
    border-color: #333333;
    color: #FFFFFF;
}

body.theme-dark .start-test-section {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .form-section {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .teacher-switch-card {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .profile-header-card {
    background: linear-gradient(135deg, #6C63FF 0%, #5A52E8 100%);
}

body.theme-dark .no-results {
    color: #B0B0B0;
}

body.theme-dark .loading {
    color: #B0B0B0;
}

body.theme-dark .progress-header h2 {
    color: #FFFFFF;
}

body.theme-dark .stat-label {
    color: #B0B0B0;
}

body.theme-dark .word-transcription {
    color: #B0B0B0;
}

body.theme-dark .word-russian {
    color: #FFFFFF;
}

body.theme-dark .word-example {
    color: #B0B0B0;
    border-top-color: #333333;
}

body.theme-dark .test-progress {
    color: #B0B0B0;
}

body.theme-dark .result-text {
    color: #FFFFFF;
}

body.theme-dark .back-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

body.theme-dark .dictionary-header {
    background: #1E1E1E;
    color: #FFFFFF;
}

body.theme-dark .dictionary-title {
    color: #FFFFFF;
}

body.theme-dark .dictionary-info {
    color: #B0B0B0;
}

body.theme-dark .word-english {
    color: #8B84FF;
}

body.theme-dark .word-header {
    color: #FFFFFF;
}

body.theme-dark .result-header {
    color: #FFFFFF;
}

body.theme-dark .result-dict-name {
    color: #FFFFFF;
}

body.theme-dark .result-date {
    color: #B0B0B0;
}

body.theme-dark .result-mode {
    color: #8B84FF;
}

body.theme-dark .profile-name {
    color: #FFFFFF;
}

body.theme-dark .form-label {
    color: #FFFFFF;
}

body.theme-dark .teacher-switch-label {
    color: #FFFFFF;
}

body.theme-dark .profile-header-text h2 {
    color: #FFFFFF;
}

body.theme-dark .profile-header-text p {
    color: rgba(255, 255, 255, 0.9);
}

body.theme-dark .qr-section {
    background: transparent;
}

body.theme-dark .settings-section {
    background: #1E1E1E;
    color: #FFFFFF;
}

/* Phone Container */
.phone-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.phone-frame {
    background: #000;
    border-radius: 40px;
    padding: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.phone-screen {
    background: #FFFFFF;
    border-radius: 32px;
    overflow: hidden;
    height: 800px;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* App Bar */
.app-bar {
    background: linear-gradient(135deg, #6C63FF 0%, #5A52E8 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.app-bar-title {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 120px);
}

.app-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.app-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.back-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.back-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.back-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.theme-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.app-bar h1 {
    font-size: 20px;
    font-weight: 600;
}

/* App Content */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #F5F5F5;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #757575;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E0E0E0;
    border-top-color: #6C63FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-card {
    margin-bottom: 16px;
}

.progress-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 16px;
}

.progress-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #6C63FF;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #757575;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #E0E0E0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6C63FF 0%, #5A52E8 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: left;
    width: 100%;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn.primary {
    background: linear-gradient(135deg, #6C63FF 0%, #5A52E8 100%);
    color: white;
}

.action-btn.primary .btn-title,
.action-btn.primary .btn-subtitle {
    color: white;
}

.action-btn .icon {
    font-size: 32px;
    flex-shrink: 0;
}

.btn-content {
    flex: 1;
}

.btn-title {
    font-size: 16px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 4px;
}

.btn-subtitle {
    font-size: 14px;
    color: #757575;
}

/* Bottom Navigation */
.bottom-nav {
    background: #6C63FF;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    background: transparent;
    border: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px 16px;
    transition: opacity 0.2s;
}

.nav-btn:hover {
    opacity: 0.8;
}

.nav-icon {
    font-size: 24px;
}

.nav-label {
    font-size: 12px;
}

/* Scrollbar */
.app-content::-webkit-scrollbar {
    width: 4px;
}

.app-content::-webkit-scrollbar-track {
    background: transparent;
}

.app-content::-webkit-scrollbar-thumb {
    background: #E0E0E0;
    border-radius: 2px;
}

.app-content::-webkit-scrollbar-thumb:hover {
    background: #BDBDBD;
}
