/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

/* Контейнер авторизации */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: rgba(45, 45, 45, 0.95);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #9146ff, #00f5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo p {
    color: #b0b0b0;
    font-size: 1.1rem;
}

/* Сообщения об ошибках */
.error-message {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #ff6b6b;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.success-message {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
    color: #4caf50;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

/* Контент авторизации */
.auth-content {
    text-align: center;
}

.auth-content h2 {
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 1.8rem;
}

.auth-content p {
    color: #b0b0b0;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Кнопка входа через Twitch */
.twitch-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(45deg, #9146ff, #772ce8);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(145, 70, 255, 0.3);
    border: none;
    cursor: pointer;
}

.twitch-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(145, 70, 255, 0.4);
    background: linear-gradient(45deg, #a855ff, #8b3dff);
}

.twitch-login-btn svg {
    width: 24px;
    height: 24px;
}

/* Список возможностей */
.features {
    margin-top: 40px;
    text-align: left;
}

.features h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.features ul {
    list-style: none;
    padding: 0;
}

.features li {
    color: #b0b0b0;
    margin-bottom: 10px;
    font-size: 1rem;
    padding-left: 5px;
}

/* Панель управления */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: rgba(45, 45, 45, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #9146ff;
}

.user-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-details h2 {
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.user-details p {
    color: #b0b0b0;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.2;
}

.logout-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.logout-btn:hover {
    transform: scale(1.1);
}

.logout-btn img {
    transition: all 0.3s ease;
}

/* Карточки настроек */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
    align-items: start;
}

.settings-card {
    background: rgba(45, 45, 45, 0.95);
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    height: auto;
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

.settings-card.expanded {
    height: 500px;
}

.settings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.settings-card-header {
    padding: 25px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.settings-card-header:hover {
    background: rgba(55, 55, 55, 0.8);
}


.settings-card-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.settings-card-header h3 svg {
    width: 36px;
    height: 36px;
    fill: #ffffff !important;
    flex-shrink: 0;
}

.settings-card-header p {
    display: none;
}

.settings-card-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.settings-card.expanded .settings-card-content {
    max-height: calc(500px - 120px);
    padding: 20px 25px 25px 25px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Стилизация скроллбара для контента карточек */
.settings-card-content::-webkit-scrollbar {
    width: 6px;
}

.settings-card-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.settings-card-content::-webkit-scrollbar-thumb {
    background: rgba(145, 70, 255, 0.6);
    border-radius: 3px;
}

.settings-card-content::-webkit-scrollbar-thumb:hover {
    background: rgba(145, 70, 255, 0.8);
}

/* Улучшение формы в контенте */
.settings-card-content form {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
}

.collapse-icon {
    display: none;
}

/* Дополнительные стили для улучшения UX */
.settings-card-header {
    border-bottom: none;
}

.settings-card.expanded .settings-card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-card-content form {
    margin: 0;
}

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

.settings-card.expanded .settings-card-content {
    animation: expandContent 0.3s ease 0.1s both;
}

/* Улучшенные hover эффекты */
.settings-card-header:active {
    transform: scale(0.98);
}

.collapse-icon {
    opacity: 0.7;
}

.settings-card-header:hover .collapse-icon {
    opacity: 1;
    color: #a855ff;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(60, 60, 60, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #9146ff;
    box-shadow: 0 0 0 2px rgba(145, 70, 255, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #888;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Переключатели */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    vertical-align: middle;
    flex-shrink: 0;
    min-width: 60px;
    max-width: 60px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 60px;
    height: 34px;
    background-color: #444;
    transition: 0.4s;
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: #9146ff;
    box-shadow: inset 0 2px 4px rgba(145, 70, 255, 0.3);
}

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

.slider:hover {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(145, 70, 255, 0.2);
}

/* Улучшенная группа с переключателем */
.form-group.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(60, 60, 60, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group.toggle-group label:not(.toggle-switch) {
    margin: 0;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    flex: 1;
}

.form-group.toggle-group .toggle-switch {
    flex-shrink: 0;
}

/* Переключатели в заголовках */
.header-toggle {
    margin-left: auto;
}

.header-toggle input {
    pointer-events: auto;
}

.settings-card-header {
    pointer-events: auto;
}

.settings-card-header .toggle-switch {
    pointer-events: auto;
    z-index: 10;
    position: relative;
}

/* Кнопки */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, #9146ff, #772ce8);
    color: white;
    box-shadow: 0 4px 15px rgba(145, 70, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(145, 70, 255, 0.4);
}

.btn-secondary {
    background: rgba(108, 117, 125, 0.2);
    border: 1px solid #6c757d;
    color: #ffffff;
}

.btn-secondary:hover {
    background: rgba(108, 117, 125, 0.3);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Группа кнопок действий */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 120px;
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Статус индикаторы */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-enabled {
    background: rgba(40, 167, 69, 0.2);
    color: #4caf50;
    border: 1px solid #28a745;
}

.status-disabled {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

/* Адаптивность */
@media (max-width: 768px) {
    .auth-card {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-container {
        padding: 10px;
    }
    
    .settings-card.expanded {
        height: 400px;
    }
    
    .settings-card.expanded .settings-card-content {
        max-height: calc(400px - 100px);
    }
    
    .settings-card-header h3 {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .status-indicator {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .form-group.toggle-group {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
    }
    
    .form-group.toggle-group .toggle-switch {
        flex-shrink: 0;
        min-width: 60px;
        max-width: 60px;
    }
}

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

.auth-card,
.settings-card {
    animation: fadeIn 0.6s ease-out;
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2c2c2c;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, rgba(45, 45, 45, 0.95), rgba(35, 35, 35, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.8) translateY(50px);
    transition: all 0.3s ease;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
}

.modal-header h3 svg {
    width: 28px;
    height: 28px;
    fill: #ffffff !important;
    flex-shrink: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    max-height: calc(80vh - 140px);
    overflow-y: auto;
    
    /* Кастомный скроллбар */
    scrollbar-width: thin;
    scrollbar-color: rgba(145, 70, 255, 0.6) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(145, 70, 255, 0.6);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(145, 70, 255, 0.8);
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
        max-height: calc(90vh - 100px);
    }
}

/* Анимация загрузки точек */
.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

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

/* Стили для Discord активности */
.discord-activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.discord-activity-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #36393f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.discord-activity-info {
    flex: 1;
}

.discord-activity-name {
    color: #fff;
    font-weight: 500;
    font-size: 0.85rem;
    margin: 0 0 2px 0;
}

.discord-activity-details {
    color: #b0b0b0;
    font-size: 0.75rem;
    margin: 0;
}

.discord-activity-status {
    color: #4caf50;
    font-size: 0.75rem;
    font-weight: 500;
}
