/* style.css - Полная версия с исправлениями */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS переменные для цветовых схем */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --primary-gradient: linear-gradient(135deg, #667eea, #764ba2);
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* Темная тема */
body.dark-theme {
    --background-color: #1a202c;
    --surface-color: #2d3748;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --border-color: #4a5568;
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Базовые стили */
body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 16px;
    min-height: 100vh;
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Шапка */
header {
    background: var(--surface-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-minimal-new {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.logo-s {
    font-size: 36px;
    font-weight: 800;
    color: #0A2463;
    position: relative;
    font-family: 'Bebas Neue', cursive;
    z-index: 2;
    transition: transform 0.3s ease;
}

.logo-bracket-left, .logo-bracket-right {
    position: absolute;
    font-size: 42px;
    font-weight: 800;
    color: #3E92CC;
    opacity: 0.8;
    z-index: 1;
    transition: transform 0.3s ease;
}

.logo-bracket-left {
    left: 0;
    transform: translateX(-25%);
}

.logo-bracket-right {
    right: 0;
    transform: translateX(25%);
}

.logo-semicolon {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #00E5FF;
    border-radius: 50%;
    bottom: 12px;
    right: 8px;
    box-shadow: 0 0 8px #00E5FF;
    z-index: 3;
    transition: all 0.3s ease;
}

.logo-minimal-new:hover .logo-s {
    transform: scale(1.1);
}

.logo-minimal-new:hover .logo-bracket-left {
    transform: translateX(-30%) rotate(-5deg);
}

.logo-minimal-new:hover .logo-bracket-right {
    transform: translateX(30%) rotate(5deg);
}

.logo-minimal-new:hover .logo-semicolon {
    transform: scale(1.3);
    box-shadow: 0 0 12px #00E5FF;
}

.logo-text h1 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    transition: color 0.3s ease;
}

.logo-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

/* Герой секции */
.hero {
    background: var(--primary-gradient);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Навигационные кнопки */
.navigation-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    min-width: 200px;
    justify-content: center;
}

.nav-btn::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;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Ссылка назад */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 2rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    background: var(--surface-color);
    box-shadow: var(--shadow);
}

.back-link:hover {
    filter: brightness(0.9);
    transform: translateX(-5px);
}

/* Стили для поиска и фильтров */
.search-section {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    z-index: 2;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--surface-color);
    color: var(--text-primary);
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

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

.filters {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.filter-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.clear-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
    font-size: 0.9rem;
}

.clear-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

/* Статистика */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Облако тегов */
.tags-cloud-section {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.tags-cloud-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1rem;
    min-height: 60px;
    align-items: center;
    justify-content: center;
}

.tags-loading {
    text-align: center;
    color: var(--text-secondary);
    width: 100%;
}

.tags-loading i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.tag-cloud-item {
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-weight: 500;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.tag-cloud-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.tag-size-1 { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
.tag-size-2 { font-size: 0.9rem; padding: 0.5rem 1rem; }
.tag-size-3 { font-size: 1rem; padding: 0.6rem 1.2rem; }
.tag-size-4 { font-size: 1.1rem; padding: 0.7rem 1.4rem; }
.tag-size-5 { font-size: 1.2rem; padding: 0.8rem 1.6rem; }

.tag-color-1 { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.tag-color-2 { background: linear-gradient(135deg, #f093fb, #f5576c); color: white; }
.tag-color-3 { background: linear-gradient(135deg, #4facfe, #00f2fe); color: white; }
.tag-color-4 { background: linear-gradient(135deg, #43e97b, #38f9d7); color: #2d3748; }
.tag-color-5 { background: linear-gradient(135deg, #fa709a, #fee140); color: #2d3748; }
.tag-color-6 { background: linear-gradient(135deg, #a8edea, #fed6e3); color: #2d3748; }
.tag-color-7 { background: linear-gradient(135deg, #d299c2, #fef9d7); color: #2d3748; }
.tag-color-8 { background: linear-gradient(135deg, #89f7fe, #66a6ff); color: white; }

.tags-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.tags-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Стили для карточек ресурсов */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.resource-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

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

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.resource-header h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    flex: 1;
    line-height: 1.4;
}

.bookmark-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 0.5rem;
    margin: -0.5rem;
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.bookmark-btn:hover {
    transform: scale(1.2);
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.resource-card .description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-card .link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(102, 126, 234, 0.1);
}

.resource-card .link:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.resource-card .meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.resource-card .type,
.resource-card .category,
.resource-card .subcategory {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.resource-card .type {
    background: var(--primary-gradient);
    color: white;
}

.resource-card .category {
    background: rgba(226, 232, 240, 0.5);
    color: var(--text-primary);
}

.resource-card .subcategory {
    background: rgba(254, 215, 215, 0.5);
    color: #c53030;
}

.resource-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.resource-card .tag {
    background: rgba(247, 250, 252, 0.5);
    color: var(--text-primary);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.resource-card .tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.resource-card .tag.long-tag {
    font-size: 0.7rem;
}

/* Информационная секция */
.info-section {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 2rem;
}

.info-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.info-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Сообщения о пустых результатах */
.no-results, .no-lections, .empty-bookmarks {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.no-results i, .no-lections i, .empty-bookmarks i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3, .no-lections h3, .empty-bookmarks h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 2rem;
    opacity: 0.3;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Общие стили для кнопок */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::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;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff5252, #e53e3e);
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Подвал */
footer {
    background: #2d3748;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    transition: background-color 0.3s ease;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.logo-icon {
    font-size: 1.5rem;
}

/* Цветовые схемы */
.color-scheme-green {
    --primary-color: #48bb78;
    --secondary-color: #38a169;
    --primary-gradient: linear-gradient(135deg, #48bb78, #38a169);
}

.color-scheme-purple {
    --primary-color: #9f7aea;
    --secondary-color: #805ad5;
    --primary-gradient: linear-gradient(135deg, #9f7aea, #805ad5);
}

.color-scheme-orange {
    --primary-color: #ed8936;
    --secondary-color: #dd6b20;
    --primary-gradient: linear-gradient(135deg, #ed8936, #dd6b20);
}

/* Отключение анимаций */
.no-animations * {
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

/* Уведомления */
.settings-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 300px;
}

.settings-notification-success {
    background: #48bb78;
}

.settings-notification-error {
    background: #ff6b6b;
}

.settings-notification-info {
    background: #667eea;
}

.settings-notification-warning {
    background: #ed8936;
}

/* Специфичные стили для страниц */

/* Страница закладок */
.bookmarks-hero {
    background: var(--primary-gradient);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.bookmarks-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    animation: float 20s infinite linear;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.bookmark-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.bookmark-stat-item {
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(248, 250, 252, 0.5) 100%);
    padding: 2rem 1.5rem;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bookmark-stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.bookmark-stat-item:hover::before {
    transform: scaleX(1);
}

.bookmark-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.bookmark-stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.bookmark-stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .container {
        max-width: 992px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 768px;
        padding: 0 15px;
    }
    
    .resources-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1rem;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .navigation-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 576px;
        padding: 0 15px;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .search-section {
        padding: 1.5rem;
    }
    
    .filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .tags-actions {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bookmark-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .resource-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bookmark-btn {
        align-self: flex-end;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .bookmark-stats {
        grid-template-columns: 1fr;
    }
    
    .resource-card {
        padding: 1.5rem;
    }
    
    .search-section {
        padding: 1rem;
    }
    
    .nav-btn {
        min-width: auto;
        padding: 0.8rem 1.5rem;
    }
    
    .logo-text h1 {
        font-size: 1.4rem;
    }
    
    .logo-minimal-new {
        width: 50px;
        height: 50px;
    }
    
    .logo-s {
        font-size: 30px;
    }
    
    .logo-bracket-left, .logo-bracket-right {
        font-size: 36px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .container {
        padding: 0 8px;
    }
    
    .resource-card {
        padding: 1rem;
    }
    
    .hero-content h2 {
        font-size: 1.3rem;
    }
    
    .nav-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    .logo-text h1 {
        font-size: 1.2rem;
    }
}

/* Портретная ориентация */
@media (max-width: 768px) and (orientation: portrait) {
    .hero {
        padding: 2rem 0;
    }
    
    .navigation-buttons {
        margin: 1.5rem 0;
    }
}

/* Ландшафтная ориентация */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 0;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
}

/* Высокие экраны */
@media (min-height: 800px) and (max-width: 768px) {
    .hero {
        padding: 3rem 0;
    }
}

/* Поддержка сенсорных устройств */
@media (hover: none) and (pointer: coarse) {
    .resource-card:hover,
    .nav-btn:hover,
    .stat-item:hover,
    .bookmark-stat-item:hover,
    .tag-cloud-item:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    
    .resource-card:hover::before,
    .bookmark-stat-item:hover::before {
        transform: scaleX(0);
    }
    
    .nav-btn:hover::before,
    .btn:hover::before {
        left: -100%;
    }
    
    /* Увеличение области нажатия для мобильных устройств */
    .nav-btn, .btn, .bookmark-btn, .tag-cloud-item {
        min-height: 44px;
    }
    
    .filter-group select {
        min-height: 44px;
    }
}

/* Поддержка устройств с поддержкой hover */
@media (hover: hover) and (pointer: fine) {
    .resource-card:hover,
    .nav-btn:hover,
    .stat-item:hover,
    .bookmark-stat-item:hover,
    .tag-cloud-item:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-hover);
    }
}

/* Улучшенная доступность для клавиатуры */
.nav-btn:focus-visible,
.btn:focus-visible,
.bookmark-btn:focus-visible,
.tag-cloud-item:focus-visible,
.filter-group select:focus-visible,
.search-box input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Поддержка prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero::before {
        animation: none;
    }
    
    .logo-minimal-new:hover .logo-s,
    .logo-minimal-new:hover .logo-bracket-left,
    .logo-minimal-new:hover .logo-bracket-right,
    .logo-minimal-new:hover .logo-semicolon {
        transform: none;
    }
    
    .nav-btn::before,
    .btn::before {
        display: none;
    }
}

/* Улучшенная читаемость для темных тем */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a202c;
        --surface-color: #2d3748;
        --text-primary: #e2e8f0;
        --text-secondary: #a0aec0;
        --border-color: #4a5568;
        --shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.4);
    }
}

/* Печать */
@media print {
    .nav-btn,
    .bookmark-btn,
    .search-section,
    .tags-cloud-section,
    .back-link,
    footer {
        display: none !important;
    }
    
    .resource-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* Улучшенная поддержка старых браузеров */
@supports not (backdrop-filter: blur(10px)) {
    header {
        background: var(--surface-color);
    }
    
    .bookmark-stat-item {
        background: var(--surface-color);
    }
}

/* Специфичные исправления для iOS Safari */
@supports (-webkit-touch-callout: none) {
    .search-box input,
    .filter-group select {
        font-size: 16px; /* Предотвращает масштабирование в iOS */
    }
    
    .nav-btn, .btn {
        cursor: default; /* Убирает курсор на iOS */
    }
}

/* Специфичные исправления для Firefox */
@-moz-document url-prefix() {
    .stat-number,
    .bookmark-stat-number {
        background-clip: text;
        -webkit-text-fill-color: unset;
        color: var(--primary-color);
    }
}

/* Улучшенная поддержка для Internet Explorer */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .stat-number,
    .bookmark-stat-number {
        background: none;
        color: var(--primary-color);
    }
    
    .resource-card::before,
    .bookmark-stat-item::before {
        display: none;
    }
}

/* Добавьте в конец style.css */

/* Стили для переключателей */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Стили для селектов */
.select-wrapper {
    position: relative;
    min-width: 200px;
}

.select-wrapper select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    font-family: inherit;
}

.select-wrapper::after {
    content: "▼";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    pointer-events: none;
    font-size: 0.8rem;
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-hover);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.modal p {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Прогресс бар */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Стили для страницы настроек */
.settings-hero {
    background: var(--primary-gradient);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.settings-section {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.settings-section h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.settings-section h2 i {
    color: var(--primary-color);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

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

.setting-info {
    flex: 1;
}

.setting-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.setting-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Опасная зона */
.settings-section.danger-zone {
    border-left-color: #ff6b6b;
}

.settings-section.danger-zone h2 {
    color: #ff6b6b;
}

/* Дополнительные стили для уведомлений */
.settings-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 300px;
}

.settings-notification-success {
    background: #48bb78;
}

.settings-notification-error {
    background: #ff6b6b;
}

.settings-notification-info {
    background: #667eea;
}

.settings-notification-warning {
    background: #ed8936;
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-hover);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.modal p {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Стили для переключателей */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Стили для селектов */
.select-wrapper {
    position: relative;
    min-width: 200px;
}

.select-wrapper select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    font-family: inherit;
}

.select-wrapper::after {
    content: "▼";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    pointer-events: none;
    font-size: 0.8rem;
}

/* Темная тема для кастомных компонентов */
body.dark-theme .bookmarks-hero {
    background: linear-gradient(135deg, #2d3748, #4a5568);
}

body.dark-theme .bookmark-stat-item {
    background: linear-gradient(135deg, #2d3748, #4a5568);
    border: 1px solid #4a5568;
}

body.dark-theme .bookmark-stat-label {
    color: #a0aec0;
}

body.dark-theme .bookmark-filters {
    background: #2d3748;
    border: 1px solid #4a5568;
}

body.dark-theme .bookmark-filters .filter-group label {
    color: #e2e8f0;
}

body.dark-theme .bookmark-filters .filter-group select {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-theme .empty-bookmarks {
    background: linear-gradient(135deg, #2d3748, #4a5568);
    border: 1px solid #4a5568;
    color: #a0aec0;
}

/* Темная тема для лекций */
body.dark-theme .lections-hero {
    background: linear-gradient(135deg, #2d3748, #4a5568);
}

body.dark-theme .lection-card {
    background: #2d3748;
    border: 1px solid #4a5568;
}

body.dark-theme .lection-title {
    color: #e2e8f0;
}

body.dark-theme .lection-description {
    color: #a0aec0;
}

body.dark-theme .search-section {
    background: #2d3748;
    border: 1px solid #4a5568;
}

body.dark-theme .search-box input {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-theme .search-box input::placeholder {
    color: #a0aec0;
}

body.dark-theme .filter-group label {
    color: #e2e8f0;
}

body.dark-theme .filter-group select {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-theme .stat-item {
    background: #2d3748;
    border: 1px solid #4a5568;
}

body.dark-theme .stat-label {
    color: #a0aec0;
}

body.dark-theme .info-section {
    background: #2d3748;
    border: 1px solid #4a5568;
}

body.dark-theme .info-section h3 {
    color: #e2e8f0;
}

body.dark-theme .info-section p {
    color: #a0aec0;
}

/* Темная тема для markdown-viewer */
body.dark-theme .markdown-header {
    background: #2d3748;
    border: 1px solid #4a5568;
}

body.dark-theme .markdown-title {
    color: #e2e8f0;
}

body.dark-theme .markdown-content {
    background: #2d3748;
    border: 1px solid #4a5568;
    color: #e2e8f0;
}

body.dark-theme .markdown-content h1,
body.dark-theme .markdown-content h2,
body.dark-theme .markdown-content h3 {
    color: #e2e8f0;
}

body.dark-theme .markdown-content p {
    color: #a0aec0;
}

body.dark-theme .markdown-content code {
    background: #4a5568;
    color: #e2e8f0;
}

body.dark-theme .markdown-content pre {
    background: #1a202c;
    border: 1px solid #4a5568;
}

body.dark-theme .markdown-content table {
    border-color: #4a5568;
}

body.dark-theme .markdown-content th,
body.dark-theme .markdown-content td {
    border-color: #4a5568;
}

body.dark-theme .markdown-content th {
    background: #4a5568;
    color: #e2e8f0;
}

body.dark-theme .markdown-content td {
    background: #2d3748;
    color: #a0aec0;
}

body.dark-theme .markdown-content blockquote {
    border-left-color: #667eea;
    color: #a0aec0;
}

/* Темная тема для облака тегов */
body.dark-theme .tags-cloud-section {
    background: #2d3748;
    border: 1px solid #4a5568;
}

body.dark-theme .tags-cloud-section h3 {
    color: #e2e8f0;
}

body.dark-theme .tags-info {
    color: #a0aec0;
}

/* Темная тема для уведомлений */
body.dark-theme .settings-notification {
    border: 1px solid #4a5568;
}

/* Темная тема для модальных окон */
body.dark-theme .modal-content {
    background: #2d3748;
    border: 1px solid #4a5568;
}

body.dark-theme .modal h3 {
    color: #e2e8f0;
}

body.dark-theme .modal p {
    color: #a0aec0;
}

/* Темная тема для кнопок */
body.dark-theme .btn-secondary {
    background: #4a5568;
    color: #e2e8f0;
    border: 1px solid #4a5568;
}

body.dark-theme .btn-secondary:hover {
    background: #718096;
    border-color: #718096;
}

body.dark-theme .clear-btn {
    background: #c53030;
    border: 1px solid #c53030;
}

body.dark-theme .clear-btn:hover {
    background: #e53e3e;
    border-color: #e53e3e;
}

/* Темная тема для навигации */
body.dark-theme .back-link {
    background: #2d3748;
    border: 1px solid #4a5568;
    color: #667eea;
}

body.dark-theme .back-link:hover {
    background: #4a5568;
}

/* Темная тема для загрузки и ошибок */
body.dark-theme .loading,
body.dark-theme .error {
    background: #2d3748;
    border: 1px solid #4a5568;
    color: #a0aec0;
}

body.dark-theme .error h3 {
    color: #e2e8f0;
}