* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Навігація */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: relative;
}

.nav-brand h1 {
    color: #667eea;
    font-size: 24px;
}

.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 16px;
}

.nav-btn:hover {
    background: #f0f0f0;
}

/* Бургер меню */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: #667eea;
    border-radius: 3px;
    transition: all 0.3s;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Overlay для мобільного меню */
.nav-menu::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: -1;
}

@media (max-width: 768px) {
    .nav-menu.active::before {
        opacity: 1;
        visibility: visible;
    }
}

/* Секції */
.section {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-top: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Головна сторінка */
.hero {
    text-align: center;
    padding: 40px 0;
}

.hero h2 {
    font-size: 36px;
    color: #667eea;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}

.stat-card h3 {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Кнопки */
.btn-primary, .btn-secondary, .btn-control, .btn-back, .btn-preview {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-preview {
    background: #ffa502;
    color: white;
}

.btn-preview:hover {
    background: #ff8c00;
    transform: translateY(-2px);
}

.btn-back {
    background: #f0f0f0;
    color: #333;
}

/* Додаткові стилі для кнопок */
.action-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.import-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.import-section h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.import-hint {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.import-options {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.import-options label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.import-options select {
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
}

/* Форми */
.input-large, textarea, .term-input, .definition-input {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    transition: border 0.3s;
    box-sizing: border-box;
}

.input-large:focus, textarea:focus, .term-input:focus, .definition-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Створення набору */
.create-form {
    max-width: 800px;
    margin: 0 auto;
}

/* Імпорт */
.import-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.import-section h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.import-hint {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

#importText {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    margin-bottom: 15px;
    resize: vertical;
}

.import-options {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.import-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.import-options select {
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.cards-container {
    margin: 20px 0;
}

.card-input {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.btn-remove {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 18px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-preview {
    padding: 12px 30px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Сітка наборів */
.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.set-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.set-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.set-card h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.set-card p {
    color: #666;
    margin-bottom: 15px;
}

.set-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #999;
    font-size: 14px;
}

.set-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-small {
    padding: 5px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-edit {
    background: #ffa502;
    color: white;
}

.btn-delete {
    background: #ff4757;
    color: white;
}

/* Фільтрація */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-bar input, .filter-bar select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.filter-bar input {
    flex: 1;
}

/* Вивчення */
.study-header {
    text-align: center;
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

.progress-text {
    color: #666;
    font-size: 18px;
}

/* Режими вивчення */
.study-modes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.study-mode {
    display: none;
}

.study-mode.active {
    display: block;
}

/* Картки */
.flashcard {
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 0 auto 30px;
    perspective: 1000px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard-inner.flipped {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.flashcard-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.flashcard-back {
    background: white;
    border: 3px solid #667eea;
    transform: rotateY(180deg);
}

.flashcard p {
    font-size: 28px;
    text-align: center;
}

.card-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-control {
    background: #f0f0f0;
    color: #333;
}

.card-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-know {
    padding: 12px 30px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

.btn-study {
    padding: 12px 30px;
    background: #f39c12;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

/* Тест */
.test-question {
    max-width: 600px;
    margin: 0 auto;
}

.test-question h3 {
    font-size: 24px;
    margin-bottom: 30px;
    text-align: center;
}

.test-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.test-button-container {
    display: flex;
    justify-content: flex-end;
    max-width: 600px;
    margin: 0 auto 20px;
}

.test-option {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.test-option:hover {
    border-color: #667eea;
    background: #f9f9f9;
}

.test-option.selected {
    border-color: #667eea;
    background: #e8eaf6;
}

.test-option.correct {
    border-color: #2ecc71;
    background: #d4edda;
}

.test-option.incorrect {
    border-color: #ff4757;
    background: #f8d7da;
}

.test-result {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 18px;
}

.test-result.correct {
    background: #d4edda;
    color: #155724;
}

.test-result.incorrect {
    background: #f8d7da;
    color: #721c24;
}

/* Співставлення */
.match-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.match-card {
    padding: 20px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-card:hover {
    transform: scale(1.05);
}

.match-card.selected {
    background: #ffa502;
}

.match-card.matched {
    background: #2ecc71;
    cursor: default;
}

.match-stats {
    text-align: center;
    font-size: 18px;
}

.match-stats p {
    margin: 10px 0;
}

/* Письмо */
.write-question {
    max-width: 600px;
    margin: 0 auto;
}

.write-question h3 {
    font-size: 24px;
    margin-bottom: 30px;
    text-align: center;
}

/* Імпорт */
.import-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.import-section h3 {
    margin-bottom: 10px;
    color: #667eea;
}

.import-hint {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.import-options {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.import-options label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.import-options select {
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-preview {
    padding: 12px 30px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-preview:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Передивитись */
.preview-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.preview-info {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.preview-info h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.preview-count {
    color: #666;
    margin-top: 10px;
}

.preview-modes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.preview-mode {
    display: none;
}

.preview-mode.active {
    display: block;
}

.preview-flashcard {
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 0 auto 30px;
    perspective: 1000px;
    cursor: pointer;
}

.preview-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.preview-counter {
    font-size: 18px;
    color: #666;
}

.preview-table {
    max-width: 800px;
    margin: 0 auto;
}

.preview-table-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.3s;
}

.preview-table-row:hover {
    background: #f9f9f9;
}

.preview-table-row:first-child {
    background: #667eea;
    color: white;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
}

.preview-table-row:first-child:hover {
    background: #667eea;
}

.preview-test-info {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* Адаптивність */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .section {
        padding: 15px;
        margin-top: 10px;
        border-radius: 10px;
    }
    
    .burger-menu {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s;
        z-index: 1000;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-btn {
        width: 100%;
        text-align: left;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 5px;
        font-size: 14px;
    }
    
    .navbar .container {
        flex-wrap: nowrap;
        padding: 10px 15px;
    }
    
    .nav-brand h1 {
        font-size: 20px;
    }
    
    .nav-profile {
        margin-left: auto;
    }
    
    .profile-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .hero {
        padding: 20px 0;
    }
    
    .hero h2 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .card-input {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }
    
    .match-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .match-card {
        padding: 15px;
        min-height: 80px;
        font-size: 14px;
    }
    
    .flashcard {
        height: 250px;
        max-width: 100%;
    }
    
    .flashcard p {
        font-size: 18px;
        padding: 20px;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card h3 {
        font-size: 36px;
    }
    
    .sets-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .set-card {
        padding: 15px;
    }
    
    .test-button-container {
        justify-content: center;
    }
    
    .card-controls {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .btn-control, .btn-primary, .btn-secondary {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .card-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-know, .btn-study {
        width: 100%;
    }
    
    .study-modes {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .mode-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-bar input, .filter-bar select {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .import-options {
        flex-direction: column;
        align-items: stretch;
    }
    
    .import-options label {
        width: 100%;
    }
    
    .import-options select {
        width: 100%;
    }
    
    .visibility-options {
        flex-direction: column;
    }
    
    .visibility-option {
        min-width: 100%;
    }
    
    .test-options {
        gap: 10px;
    }
    
    .test-option {
        padding: 12px;
        font-size: 14px;
    }
    
    .preview-controls {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .preview-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .preview-actions button {
        width: 100%;
    }
    
    .ai-tabs {
        flex-direction: column;
    }
    
    .ai-tab {
        width: 100%;
        min-width: 100%;
    }
    
    .chat-input-container {
        flex-direction: column;
    }
    
    .chat-input-container button {
        width: 100%;
    }
}


/* ============ ПРОФІЛЬ ============ */
.nav-profile {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.profile-btn:hover {
    background: #e0e0e0;
}

#profileIcon {
    font-size: 20px;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    min-width: 250px;
    display: none;
    z-index: 1000;
}

.profile-dropdown.show {
    display: block;
}

.profile-info {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.profile-info h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.profile-stat {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.profile-menu-btn {
    width: 100%;
    padding: 15px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: 16px;
    transition: background 0.3s;
}

.profile-menu-btn:hover {
    background: #f0f0f0;
}

/* ============ АВТЕНТИФІКАЦІЯ ============ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    max-width: 450px;
    width: 100%;
}

.auth-box h2 {
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
}

.auth-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.auth-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.auth-tab:hover:not(.active) {
    border-color: #667eea;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form input {
    margin-bottom: 15px;
}

.auth-form button {
    width: 100%;
    margin-top: 10px;
}

/* ============ СТАТИСТИКА НАБОРІВ ============ */
.set-stats-mini {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.study-stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
}

.study-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-weight: bold;
    color: #667eea;
}

/* Адаптивність для профілю */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .nav-profile {
        width: 100%;
        margin-top: 10px;
        display: flex;
        justify-content: center;
    }
    
    .profile-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .auth-box {
        padding: 20px;
    }
}


/* ============ ВИДИМІСТЬ НАБОРУ ============ */
.visibility-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.visibility-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.visibility-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.visibility-option {
    flex: 1;
    min-width: 200px;
    cursor: pointer;
}

.visibility-option input[type="radio"] {
    display: none;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    transition: all 0.3s;
}

.visibility-option input[type="radio"]:checked + .option-content {
    border-color: #667eea;
    background: #e8eaf6;
}

.option-content:hover {
    border-color: #667eea;
}

.option-icon {
    font-size: 32px;
}

.option-content strong {
    display: block;
    color: #333;
    margin-bottom: 5px;
}

.option-content p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* ============ ПУБЛІЧНІ НАБОРИ ============ */
.set-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
}

.set-badge.public {
    background: #e8f5e9;
    color: #2e7d32;
}

.set-badge.private {
    background: #fce4ec;
    color: #c2185b;
}

.set-author {
    margin: 10px 0;
    font-size: 14px;
}

.author-link {
    color: #667eea;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s;
}

.author-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.btn-favorite, .btn-favorited {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-favorite {
    background: #f0f0f0;
    color: #333;
}

.btn-favorite:hover {
    background: #ffebee;
    color: #e91e63;
}

.btn-favorited {
    background: #ffebee;
    color: #e91e63;
}

.btn-favorited:hover {
    background: #f0f0f0;
    color: #333;
}

.public-set-card {
    position: relative;
}

/* Адаптивність */
@media (max-width: 768px) {
    .visibility-options {
        flex-direction: column;
    }
    
    .visibility-option {
        min-width: 100%;
    }
}


/* ============ МОДАЛЬНЕ ВІКНО ПРОФІЛЮ ============ */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

.profile-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.profile-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 35px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.profile-modal-close:hover {
    color: #333;
}

.profile-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.profile-modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.profile-modal-body {
    padding: 30px;
}

.profile-info-section {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.profile-avatar {
    font-size: 80px;
    margin-bottom: 15px;
}

.profile-info-section h3 {
    color: #667eea;
    font-size: 28px;
    margin: 10px 0;
}

.profile-date {
    color: #666;
    font-size: 16px;
}

.profile-stats-section {
    margin-bottom: 30px;
}

.profile-stats-section h4 {
    color: #667eea;
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.profile-stat-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s;
}

.profile-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.profile-stat-item .stat-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.profile-stat-item .stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.profile-stat-item .stat-label {
    display: block;
    font-size: 14px;
    color: #666;
}

.profile-sets-section h4 {
    color: #667eea;
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.profile-sets-list {
    max-height: 400px;
    overflow-y: auto;
}

.profile-set-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.profile-set-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.profile-set-info {
    flex: 1;
}

.profile-set-info h5 {
    color: #333;
    margin: 0 0 5px 0;
    font-size: 16px;
}

.profile-set-info p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.profile-set-stats {
    display: flex;
    gap: 10px;
    font-size: 14px;
    color: #666;
}

.no-sets {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}

.profile-modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.profile-modal-footer .btn-primary {
    min-width: 150px;
}

/* Адаптивність */
@media (max-width: 768px) {
    .profile-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-set-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .profile-set-stats {
        width: 100%;
        justify-content: space-around;
    }
}


/* ============ МОДАЛЬНЕ ВІКНО УПРАВЛІННЯ НАБОРОМ ============ */
.manage-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

.manage-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.manage-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 35px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.manage-modal-close:hover {
    color: #333;
}

.manage-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.manage-modal-header h2 {
    margin: 0;
    font-size: 22px;
}

.manage-modal-body {
    padding: 30px;
}

.manage-modal-body h3 {
    color: #667eea;
    margin: 0 0 10px 0;
    font-size: 24px;
}

.manage-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 16px;
}

.manage-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #666;
}

.manage-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.manage-btn {
    padding: 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    text-align: left;
}

.edit-btn {
    background: #ffa502;
    color: white;
}

.edit-btn:hover {
    background: #ff8c00;
    transform: translateX(5px);
}

.private-btn {
    background: #667eea;
    color: white;
}

.private-btn:hover {
    background: #5568d3;
    transform: translateX(5px);
}

.delete-btn {
    background: #ff4757;
    color: white;
}

.delete-btn:hover {
    background: #ee3344;
    transform: translateX(5px);
}

.btn-settings {
    background: #ffa502;
    color: white;
}

.btn-settings:hover {
    background: #ff8c00;
}

/* Адаптивність */
@media (max-width: 768px) {
    .manage-modal-content {
        width: 95%;
    }
    
    .manage-stats {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}


/* ============ AI АСИСТЕНТ ============ */
.ai-container {
    max-width: 900px;
    margin: 0 auto;
}

.ai-settings {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}

.ai-settings h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.ai-hint {
    margin-top: 15px;
    font-size: 14px;
}

.ai-hint a {
    color: #667eea;
    text-decoration: none;
}

.ai-hint a:hover {
    text-decoration: underline;
}

.ai-functions {
    background: white;
    padding: 30px;
    border-radius: 15px;
}

.ai-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.ai-tab {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.ai-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.ai-tab:hover:not(.active) {
    border-color: #667eea;
    background: #f9f9f9;
}

.ai-tab-content {
    display: none;
}

.ai-tab-content.active {
    display: block;
}

.ai-tab-content h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.ai-response {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    min-height: 100px;
}

.ai-result {
    line-height: 1.8;
    color: #333;
}

.ai-result.error {
    color: #ff4757;
}

.ai-test-preview {
    margin-top: 20px;
}

.preview-card {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Чат */
.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 20px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
}

.user-message {
    background: #e8eaf6;
    text-align: right;
}

.ai-message {
    background: white;
    border: 1px solid #e0e0e0;
}

.ai-message.loading {
    opacity: 0.6;
    font-style: italic;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input-container textarea {
    flex: 1;
}

/* Модальне вікно аналізу */
.ai-analysis-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.ai-analysis-content {
    background: white;
    border-radius: 20px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

.ai-analysis-content .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 35px;
    color: #999;
    cursor: pointer;
}

.ai-analysis-content h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.ai-analysis-body {
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Адаптивність */
@media (max-width: 768px) {
    .ai-tabs {
        flex-direction: column;
    }
    
    .ai-tab {
        min-width: 100%;
    }
    
    .chat-input-container {
        flex-direction: column;
    }
}
