/* Базовые размеры и адаптивность */
:root {
    --primary-dark: #1a0b2e;
    --primary-purple: #2d1b69;
    --accent-purple: #5e35b1;
    --light-purple: #9d4edd;
    --gradient-primary: linear-gradient(135deg, #9d4edd 0%, #5e35b1 50%, #2d1b69 100%);
    --gradient-text: linear-gradient(135deg, #e0d9f2 0%, #c77dff 50%, #9d4edd 100%);
    --gradient-card: linear-gradient(145deg, #2d1b69 0%, #1a0b2e 100%);
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    background: linear-gradient(135deg, #0a0418 0%, #1a0b2e 50%, #2d1b69 100%);
    color: #f8f5ff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Навигация */
.navbar {
    background: linear-gradient(135deg, #2d1b69 0%, #1a0b2e 100%) !important;
    border-bottom: 1px solid rgba(157, 78, 221, 0.3);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.navbar-nav .nav-link {
    color: #f0e6ff !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

    .navbar-nav .nav-link:hover {
        background: rgba(157, 78, 221, 0.15);
        color: #ffffff !important;
        transform: translateY(-1px);
    }

    .navbar-nav .nav-link::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--gradient-text);
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .navbar-nav .nav-link:hover::after {
        width: 80%;
    }

/* Карточки */
.card, .work-card {
    background: var(--gradient-card);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: 1rem;
    overflow: hidden;
    color: #f8f5ff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

    .card::before, .work-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: var(--gradient-text);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .work-card:hover, .card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 20px 40px rgba(157, 78, 221, 0.3);
        border-color: rgba(157, 78, 221, 0.5);
    }

        .work-card:hover::before, .card:hover::before {
            opacity: 1;
        }

    .work-card img.card-img-top {
        height: 220px;
        object-fit: cover;
        transition: transform 0.4s ease;
    }

    .work-card:hover img.card-img-top {
        transform: scale(1.05);
    }

.card-title {
    font-weight: 600;
    color: #f0e6ff;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.card-text {
    color: #e6deff;
    line-height: 1.5;
}

/* Бейджи */
.badge, .work-card .badge-ai {
    font-weight: 600;
    border-radius: 0.75rem;
    padding: 0.375rem 0.75rem;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

    .badge.bg-primary {
        background: var(--gradient-primary) !important;
        box-shadow: 0 4px 15px rgba(157, 78, 221, 0.3);
    }

.work-card .badge-ai {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-primary);
    color: #fff;
    padding: 0.375rem 0.75rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Ссылки */
a {
    color: #d8c8ff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

    a:hover {
        color: #f0e6ff;
        transform: translateY(-1px);
    }

    a::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 0;
        height: 1px;
        background: var(--gradient-text);
        transition: width 0.3s ease;
    }

    a:hover::after {
        width: 100%;
    }

.author-link:hover {
    text-decoration: none;
}

/* Кнопки */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    font-weight: 600;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

    .btn-primary::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 ease;
    }

    .btn-primary:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 25px rgba(157, 78, 221, 0.4);
        color: #ffffff !important;
    }

        .btn-primary:hover::before {
            left: 100%;
        }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(157, 78, 221, 0.25);
}

/* Формы */
.form-control {
    background: rgba(45, 27, 105, 0.7);
    border: 1px solid rgba(157, 78, 221, 0.4);
    color: #ffffff !important;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

    .form-control:focus {
        background: rgba(45, 27, 105, 0.8);
        border-color: #9d4edd;
        color: #ffffff !important;
        box-shadow: 0 0 0 0.2rem rgba(157, 78, 221, 0.25);
        transform: translateY(-1px);
    }

.form-label {
    color: #f0e6ff !important;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.form-control::placeholder {
    color: #c4b5fd !important;
    opacity: 0.8;
}

.input-group-text {
    background: rgba(45, 27, 105, 0.7);
    border: 1px solid rgba(157, 78, 221, 0.4);
    color: #d8c8ff;
    border-radius: 0.75rem;
}

/* Градиентный текст */
.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Фиолетовый текст */
.text-violet {
    color: #d8c8ff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Рейтинг */
.text-rating, .rating-stars {
    color: #ffd166 !important;
    text-shadow: 0 2px 4px rgba(255, 209, 102, 0.4);
    font-weight: 600;
}

.text-warning {
    color: #ffd166 !important;
    text-shadow: 0 2px 4px rgba(255, 209, 102, 0.4);
    font-weight: 600;
}

.rating-stars {
    font-size: 1.1rem;
}

/* Валидация */
.text-danger {
    color: #ff6b6b !important;
    font-size: 0.875rem;
    margin-top: 0.375rem;
    font-weight: 500;
}

.validation-summary-errors {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

    .validation-summary-errors ul {
        margin: 0;
        padding-left: 1.25rem;
    }

/* Футер */
.footer {
    background: linear-gradient(135deg, #2d1b69 0%, #1a0b2e 100%) !important;
    border-top: 1px solid rgba(157, 78, 221, 0.3);
    margin-top: 3rem;
    padding: 2rem 0;
    backdrop-filter: blur(10px);
}

/* Аутентификация */
.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    background: var(--gradient-card);
}

.auth-card {
    backdrop-filter: blur(20px);
    background: rgba(45, 27, 105, 0.9);
    border: 1px solid rgba(157, 78, 221, 0.4);
    border-radius: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
    color: #f0e6ff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Контейнеры */
.container {
    max-width: 1200px;
}

/* Анимация появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.work-card, .card {
    animation: fadeInUp 0.6s ease-out;
}

/* Дополнительные улучшения для читаемости */
.card-footer.bg-dark {
    background: rgba(26, 11, 46, 0.9) !important;
    border-top: 1px solid rgba(157, 78, 221, 0.2);
}

/* Улучшаем видимость иконок */
.fa-music, .fa-robot, .fa-5x {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    color: #e6deff !important;
}

/* Медиа-контейнер в карточках */
.position-relative {
    background: rgba(0, 0, 0, 0.2);
}

/* Ссылки в карточках */
.card-body a.text-violet {
    color: #d8c8ff !important;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

    .card-body a.text-violet:hover {
        color: #f0e6ff !important;
    }

/* Текст без градиента для обычного текста */
.text-muted {
    color: #c4b5fd !important;
}

.text-center {
    text-align: center;
}

/* Улучшения для select элементов */
.form-select {
    background: rgba(45, 27, 105, 0.7);
    border: 1px solid rgba(157, 78, 221, 0.4);
    color: #ffffff !important;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

    .form-select:focus {
        background: rgba(45, 27, 105, 0.8);
        border-color: #9d4edd;
        color: #ffffff !important;
        box-shadow: 0 0 0 0.2rem rgba(157, 78, 221, 0.25);
        transform: translateY(-1px);
    }

/* Улучшения для маленьких текстов */
small {
    color: #e6deff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Улучшения для иконок Font Awesome */
.fas, .fa {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
    color: #e6deff !important;
}

/* Улучшения для бейджей в карточках */
.badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    color: #ffffff !important;
}

/* Profile tabs */
.profile-tabs,
.nav-tabs {
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    gap: 8px;
}

    .nav-tabs .nav-link {
        color: #b99cff;
        border: none;
        border-radius: 12px 12px 0 0;
        padding: 12px 22px;
        font-weight: 500;
        transition: all 0.2s ease;
    }

        .nav-tabs .nav-link:hover {
            color: #ffffff;
            background: rgba(139, 92, 246, 0.18);
        }

        .nav-tabs .nav-link.active {
            color: #1d1235;
            background: #ffffff;
            border: none;
        }

/* Profile social blocks */
.profile-social-section {
    margin-top: 28px;
}

.profile-section-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 22px;
}

.profile-empty-text {
    color: rgba(255, 255, 255, 0.6);
    margin-top: 16px;
}

/* User cards grid */
.profile-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
    align-items: stretch;
}

.profile-user-card {
    background: linear-gradient(145deg, #2c1763, #1c103c);
    border: 1px solid rgba(168, 120, 255, 0.12);
    border-radius: 22px;
    padding: 28px 22px;
    min-height: 265px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

    .profile-user-card:hover {
        transform: translateY(-4px);
        border-color: rgba(185, 156, 255, 0.4);
        box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
    }

.profile-user-avatar-wrap {
    margin-bottom: 14px;
}

.profile-user-avatar,
.profile-user-avatar-placeholder {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-user-avatar {
    display: block;
    border: 3px solid rgba(255, 255, 255, 0.16);
}

.profile-user-avatar-placeholder {
    background: #a7a7a7;
    color: #1f1f1f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.profile-user-name {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    text-align: center;
    word-break: break-word;
}

.profile-user-stats {
    color: rgba(255, 255, 255, 0.72);
    font-size: 15px;
    line-height: 1.45;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 18px;
}

.profile-user-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

    .profile-user-actions form {
        margin: 0;
    }

.profile-user-btn {
    border: none;
    outline: none;
    border-radius: 10px;
    padding: 10px 18px;
    min-width: 105px;
    min-height: 42px;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

    .profile-user-btn:hover {
        color: #ffffff;
        transform: translateY(-1px);
        opacity: 0.94;
    }

.profile-user-btn-primary {
    background: #9b5cf6;
    box-shadow: 0 8px 18px rgba(155, 92, 246, 0.25);
}

.profile-user-btn-success {
    background: #22c55e;
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.22);
}

.profile-user-btn-danger {
    background: #ef4444;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.22);
}

@media (max-width: 576px) {
    .profile-section-title {
        font-size: 24px;
    }

    .profile-users-grid {
        grid-template-columns: 1fr;
    }

    .nav-tabs .nav-link {
        padding: 10px 14px;
        font-size: 14px;
    }

    .profile-user-card {
        padding: 24px 18px;
    }
}