/* Глобальные стили и переменные */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #4f46e5;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Базовые сброс стилей */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Анимации */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes slideInLeft {
    from { 
        opacity: 0; 
        transform: translateX(-30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes scaleIn {
    from { 
        opacity: 0; 
        transform: scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes bounce {
    0%, 100% { 
        transform: translateY(0); 
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 
    }
    50% { 
        transform: translateY(-25%); 
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 
    }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.5; 
    }
}

@keyframes spin {
    from { 
        transform: rotate(0deg); 
    }
    to { 
        transform: rotate(360deg); 
    }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 5px var(--primary-color); 
    }
    50% { 
        box-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color); 
    }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Основные стили */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Контейнер авторизации */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
}

.auth-container.hidden {
    display: none;
}

.auth-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 450px;
    animation: none; /* отключаем тряску/масштаб при открытии формы */
    position: relative;
    overflow: hidden;
}

.auth-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.auth-form:hover::before {
    left: 100%;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.875rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow: hidden;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 15px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    transition: var(--transition);
    position: relative;
    background: transparent;
    border: none;
    font-size: 1rem;
}

.auth-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.auth-tab.active {
    color: var(--primary-color);
}

.auth-tab.active::after {
    width: 100%;
}

.auth-tab:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.auth-page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.auth-page.active {
    display: block;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.8);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.input-group input:focus + .input-icon {
    color: var(--primary-color);
    animation: bounce 0.6s ease;
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    transition: var(--transition);
}

.auth-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.auth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
}

.auth-button:hover::before {
    left: 100%;
}

.auth-button:active {
    transform: translateY(-1px);
}

/* Главная навигация */
nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px 24px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 50px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(102, 126, 234, 0.1);
    transition: left 0.3s ease;
    z-index: -1;
}

nav a:hover {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

nav a:hover::before {
    left: 0;
}

nav a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.logout-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    margin-left: auto;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #ee5a52, #dc3545);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

/* Основной контент */
.main-content {
    display: none;
    min-height: 100vh;
}

.main-content.visible {
    display: block;
    animation: fadeIn 0.8s ease;
}

/* Секции */
section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-slow);
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Карточки */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    margin: 30px 0;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.card:hover::before {
    transform: scaleX(1);
}

/* Профиль пользователя */
.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.avatar-container {
    position: relative;
    width: 150px;
    height: 150px;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transition: all 0.3s;
}

.avatar:hover {
    transform: scale(1.05);
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    font-weight: bold;
    border: 5px solid #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.avatar-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #4CAF50;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.avatar-upload:hover {
    background: #45a049;
    transform: scale(1.1);
}

.avatar-input {
    display: none;
}

.profile-info {
    flex: 1;
    min-width: 300px;
}

.profile-info h2 {
    color: #333;
    margin-bottom: 10px;
}

.profile-info p {
    color: #666;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s;
}

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

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin: 10px 0;
}

.stat-label {
    opacity: 0.9;
    font-size: 0.9em;
}

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

.detail-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

.detail-card h4 {
    color: #667eea;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.test-history {
    margin-top: 40px;
}

.test-history h3 {
    color: #333;
    margin-bottom: 20px;
}

.history-item {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.history-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.test-name {
    font-weight: 600;
    color: #333;
}

.test-score {
    font-size: 1.2em;
    font-weight: bold;
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.test-date {
    color: #999;
    font-size: 0.9em;
}

/* Тесты */
.test-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
    touch-action: pan-y;
}

.test-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    animation: fadeIn 0.5s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

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

@media (max-width: 768px) {
    .test-cards {
        grid-template-columns: 1fr;
    }
}

@media (hover: none) {
    .test-card:hover {
        transform: none;
        box-shadow: none;
    }
}

.test-card h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
}

.test-card p {
    opacity: 0.9;
    font-size: 0.9em;
}

/* Контейнер вопросов */
.test-container {
    display: none;
}

.test-container.active {
    display: block;
    animation: fadeIn 0.5s;
}

/* Панель навигации по вопросам */
.question-nav-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.question-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-nav-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.question-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e1e1e1;
    background: white;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.question-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.question-nav-btn.answered {
    border-color: #4CAF50;
    background: #4CAF50;
    color: white;
}

.question-nav-btn.current {
    border-color: #667eea;
    background: #667eea;
    color: white;
    animation: pulse 2s infinite;
}

.question-nav-btn.skipped {
    border-color: #ff9800;
    background: #ff9800;
    color: white;
    animation: bounce 2s infinite;
}

.question-nav-btn.empty {
    border-color: #ff6b6b;
    background: #ff6b6b;
    color: white;
}

.question-nav-btn.marked {
    border-color: #9c27b0;
    background: #9c27b0;
    color: white;
}

.question-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.question-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.question-stat-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

/* Обучение */
.learning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.learning-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.learning-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.learning-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.learning-card p {
    color: #666;
    line-height: 1.5;
}

.learning-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 0;
}

.learning-details.active {
    max-height: 2000px;
    padding-top: 20px;
}

.learning-content {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
}

.learning-content h4 {
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.learning-content ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.learning-content li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.learning-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.learning-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
}

.learning-toggle:hover {
    background: #764ba2;
    transform: rotate(180deg);
}

.learning-toggle.active {
    transform: rotate(180deg);
    background: #764ba2;
}

/* Контакты */
.contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
    cursor: pointer;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-left: 5px solid #667eea;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.contact-text {
    flex: 1;
}

.contact-text h4 {
    color: #333;
    margin-bottom: 5px;
}

.contact-text p {
    color: #666;
    font-size: 0.9em;
}

/* Модальные окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: var(--transition);
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Спиннеры загрузки */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .auth-form {
        margin: 20px;
        padding: 30px 20px;
    }
    
    nav {
        padding: 12px 16px;
        gap: 10px;
    }
    
    nav a {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .card {
        margin: 20px 10px;
        padding: 20px;
    }
    
    section {
        padding: 40px 10px;
    }
    
    .avatar-container {
        width: 120px;
        height: 120px;
    }
    
    .avatar-placeholder {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .auth-form {
        padding: 20px 15px;
    }
    
    .auth-form h2 {
        font-size: 1.5rem;
    }
    
    nav {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .card {
        margin: 15px 5px;
        padding: 15px;
    }
    
    .avatar-container {
        width: 100px;
        height: 100px;
    }
    
    .avatar-placeholder {
        font-size: 28px;
    }
}

/* Дополнительные утилиты */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }

.hidden { display: none; }
.visible { display: block; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--border-radius); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-full { border-radius: 50%; }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.select-none { user-select: none; }

.transition { transition: var(--transition); }
.transition-slow { transition: var(--transition-slow); }

/* Анимационные классы */
.animate-fadeIn { animation: fadeIn 0.8s ease; }
.animate-slideInRight { animation: slideInRight 0.8s ease; }
.animate-slideInLeft { animation: slideInLeft 0.8s ease; }
.animate-scaleIn { animation: scaleIn 0.8s ease; }
.animate-bounce { animation: bounce 1s infinite; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-wiggle { animation: wiggle 1s ease-in-out infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite alternate; }

.hover-lift:hover {
    transform: translateY(-8px);
    transition: var(--transition);
}

.hover-scale:hover {
    transform: scale(1.05);
    transition: var(--transition);
}

.hover-rotate:hover {
    transform: rotate(5deg);
    transition: var(--transition);
}

/* Современные кнопки с анимациями */
.test-button, .auth-button, .logout-btn, .question-action-btn {
    position: relative;
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.test-button::before, .auth-button::before, .logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.test-button:hover, .auth-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
    filter: brightness(1.1);
}

.test-button:hover::before, .auth-button:hover::before {
    left: 100%;
}

.test-button:active, .auth-button:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.test-button.secondary {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    box-shadow: 0 8px 20px rgba(107, 114, 128, 0.3);
}

.test-button.secondary:hover {
    box-shadow: 0 15px 35px rgba(107, 114, 128, 0.4);
}

.test-button.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.test-button.success:hover {
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.test-button.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.test-button.danger:hover {
    box-shadow: 0 15px 35px rgba(239, 68, 68, 0.4);
}

.test-button.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.test-button.warning:hover {
    box-shadow: 0 15px 35px rgba(245, 158, 11, 0.4);
}

.logout-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
}

.logout-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 25px rgba(255, 107, 107, 0.4);
}

/* Анимированные кнопки действий */
.question-action-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #333;
    border-radius: 15px;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: visible;
}

.question-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.question-action-btn.mark {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
}

.question-action-btn.mark:hover {
    box-shadow: 0 8px 20px rgba(156, 39, 176, 0.4);
}

/* Пульсирующая анимация для важных кнопок */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    }
    100% {
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    }
}

.test-button.pulse {
    animation: pulse-glow 2s infinite;
}

/* Анимация появления кнопок */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.test-button {
    animation: slideInUp 0.6s ease-out;
}

/* Анимация плавающих элементов */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Анимация волны */
@keyframes wave {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.wave-bg {
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
    background-size: 200% 200%;
    animation: none; /* убираем бегущую волну на фоне авторизации */
}

/* Анимация частиц */
@keyframes particles {
    0% {
        opacity: 0;
        transform: translateY(100px) scale(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1);
    }
}

.particles::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: particles 2s linear infinite;
}

/* Глобальные анимации отключены для комфортного UX */

/* Дополнительные эффекты в стиле Cosmo */
.cosmic-glow {
    position: relative;
    overflow: hidden;
}

.cosmic-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: cosmic-sweep 3s linear infinite;
}

@keyframes cosmic-sweep {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Магнетический эффект для кнопок */
.test-button.magnetic {
    position: relative;
    transform-style: preserve-3d;
}

.test-button.magnetic:hover {
    transform: translateY(-8px) rotateX(15deg);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.5);
}

/* Пульсация для важных элементов */
.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.3);
    transform: translate(-50%, -50%);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 100%;
        height: 100%;
        opacity: 0;
    }
}

/* Морфинг фон */
.morphing-bg {
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe, #00f2fe);
    background-size: 400% 400%;
    animation: morphing 8s ease infinite;
}

@keyframes morphing {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

/* Голографический эффект */
.hologram {
    background: linear-gradient(45deg, 
        transparent 25%, 
        rgba(255,255,255,0.1) 25%, 
        rgba(255,255,255,0.1) 50%, 
        transparent 50%);
    background-size: 20px 20px;
    animation: hologram-move 2s linear infinite;
}

@keyframes hologram-move {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}