* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #48bb78;
    --error: #f56565;
    --warning: #ed8936;
    --dark: #2d3748;
    --light: #f7fafc;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
    --shadow-xl: 0 25px 50px rgba(0,0,0,0.25);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Auth Page Styles */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    box-shadow: var(--shadow-xl);
}

.auth-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 32px;
    padding: 48px 40px;
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-animated {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.auth-header h1 {
    font-size: 32px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: #718096;
    transition: all 0.3s;
    position: relative;
}

.tab-btn.active {
    color: #667eea;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-1);
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    z-index: 1;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
}

.input-group textarea {
    padding: 14px 16px;
    resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Dashboard Styles */
.app {
    min-height: 100vh;
}

.glass-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    font-size: 28px;
    -webkit-text-fill-color: initial;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #edf2f7;
    border-radius: 40px;
}

.nav-link {
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 40px;
    transition: all 0.3s;
    font-weight: 500;
}

.admin-link {
    background: var(--gradient-2);
    color: white;
}

.logout-link {
    background: #fee;
    color: #e53e3e;
}

.hero-section {
    background: var(--gradient-1);
    padding: 60px 32px;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 48px;
    margin-bottom: 16px;
}

.highlight {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 40px;
    display: inline-block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: -40px auto 48px;
    padding: 0 24px;
}

.stat-card {
    background: white;
    padding: 32px;
    border-radius: 24px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card-1::before { background: var(--gradient-1); }
.stat-card-2::before { background: var(--gradient-2); }
.stat-card-3::before { background: var(--gradient-3); }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.stat-number {
    font-size: 48px;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.quick-actions {
    max-width: 1200px;
    margin: 48px auto;
    padding: 0 24px;
}

.action-buttons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: white;
    border-radius: 20px;
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.create-group { border-left: 4px solid #667eea; }
.add-word { border-left: 4px solid #48bb78; }

.groups-section,
.practice-modes {
    max-width: 1200px;
    margin: 48px auto;
    padding: 0 24px;
}

.groups-grid,
.modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.group-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    transition: all 0.3s;
}

.group-header {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.group-icon {
    font-size: 48px;
}

.group-info h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--dark);
}

.group-info p {
    color: #718096;
    font-size: 14px;
}

.group-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.group-word-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.group-word-count .count {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

.group-actions {
    display: flex;
    gap: 10px;
}

.group-btn {
    padding: 8px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.view-btn {
    background: #edf2f7;
    color: #4a5568;
}

.practice-btn {
    background: var(--gradient-1);
    color: white;
}

.mode-card {
    background: white;
    border-radius: 24px;
    padding: 32px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    display: block;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.mode-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.mode-card h3 {
    color: var(--dark);
    margin-bottom: 12px;
}

.mode-card p {
    color: #718096;
    margin-bottom: 16px;
}

.mode-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #edf2f7;
    border-radius: 20px;
    font-size: 12px;
    color: #4a5568;
}

/* Two Columns Layout */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.form-card,
.words-list-card {
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.icon-option {
    cursor: pointer;
}

.icon-option input {
    display: none;
}

.icon-display {
    display: inline-block;
    padding: 12px;
    background: #f7fafc;
    border-radius: 12px;
    font-size: 24px;
    transition: all 0.3s;
    cursor: pointer;
}

.icon-option input:checked + .icon-display {
    background: var(--gradient-1);
    transform: scale(1.1);
}

/* Words Table */
.words-table {
    overflow-x: auto;
}

.words-table table {
    width: 100%;
    border-collapse: collapse;
}

.words-table th {
    text-align: left;
    padding: 12px;
    background: #f7fafc;
    font-weight: 600;
}

.words-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.english-word {
    font-weight: 600;
    color: #667eea;
}

.btn-delete-small {
    padding: 4px 12px;
    background: #fee;
    color: #e53e3e;
    text-decoration: none;
    border-radius: 8px;
    font-size: 12px;
}

/* Practice Page */
.practice-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.practice-container {
    width: 100%;
    max-width: 800px;
}

.practice-card {
    background: white;
    border-radius: 32px;
    padding: 48px;
}

.question-area {
    text-align: center;
    margin: 40px 0;
}

.question-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #718096;
    margin-bottom: 16px;
}

.question-word {
    font-size: 48px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.options-grid {
    display: grid;
    gap: 16px;
    margin: 32px 0;
}

.option-card {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #f7fafc;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.option-card:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.option-card input {
    margin-right: 12px;
}

.option-text {
    flex: 1;
    font-size: 16px;
}

.option-check {
    opacity: 0;
    color: #48bb78;
    font-size: 20px;
}

.option-card input:checked ~ .option-check {
    opacity: 1;
}

.btn-check {
    width: 100%;
    padding: 16px;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.result-card {
    background: white;
    border-radius: 32px;
    padding: 48px;
    text-align: center;
}

.result-card.correct {
    border-top: 4px solid #48bb78;
}

.result-card.wrong {
    border-top: 4px solid #f56565;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 24px;
}

.result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
}

.btn-next,
.btn-home {
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
}

.btn-next {
    background: var(--gradient-1);
    color: white;
}

.btn-home {
    background: #edf2f7;
    color: #4a5568;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 500px;
    width: 90%;
}

.close {
    float: right;
    font-size: 28px;
    cursor: pointer;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 48px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-large {
    text-align: center;
    max-width: 500px;
    margin: 48px auto;
    padding: 48px;
}

/* Responsive */
@media (max-width: 768px) {
    .two-columns {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .groups-grid,
    .modes-grid {
        grid-template-columns: 1fr;
    }
    
    .practice-card {
        padding: 24px;
    }
    
    .question-word {
        font-size: 32px;
    }
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
}

/* Group Selector */
.group-selector {
    max-width: 1200px;
    margin: 24px auto;
    padding: 24px;
}

.group-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.group-select-btn {
    padding: 10px 20px;
    background: #f7fafc;
    border-radius: 40px;
    text-decoration: none;
    color: #4a5568;
    transition: all 0.3s;
}

.group-select-btn.active {
    background: var(--gradient-1);
    color: white;
}

/* Admin Panel */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.user-table {
    width: 100%;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.user-table th {
    background: var(--gradient-1);
    color: white;
    padding: 16px;
    text-align: left;
}

.user-table td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-approved {
    background: #c6f6d5;
    color: #22543d;
}

.status-pending {
    background: #fed7d7;
    color: #742a2a;
}