/* Modern AI Chat Platform Styles v2.1 — Полная улучшенная версия (merged with original) */

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent iOS Safari auto-inversion */
    -webkit-appearance: none;
    appearance: none;
    filter: none !important;
}

/* Force dark color scheme for iOS Safari */
html {
    color-scheme: dark;
    -webkit-color-scheme: dark;
}

body {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 30%, #16213e 70%, #0f0f23 100%) !important;
    color: #ffffff !important;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Prevent iOS Safari auto-inversion */
    -webkit-appearance: none;
    appearance: none;
    filter: none !important;
    isolation: isolate;
}

/* Animated Background + Particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: gradientShift 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Navigation */
.navbar {
    background: rgba(13, 13, 13, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1050; /* Higher than all other elements */
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.8rem;
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 5px rgba(255, 107, 157, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.8)); }
}

.navbar-brand i {
    margin-right: 10px;
    color: #ff6b9d;
}

.navbar-nav .nav-link {
    color: #ffffff !important;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem !important;
}

.navbar-nav .nav-link:hover {
    color: #ff6b9d !important;
    transform: translateY(-2px);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 80%;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(255, 107, 157, 0.2);
    border-color: rgba(255, 107, 157, 0.3);
}

.card-header {
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

/* Character Cards - Vertical Layout (Improved with Grid) */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.character-card {
    height: 100%;
    max-width: 350px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease;
}

.character-image-container {
    height: 400px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, rgba(255, 107, 157, 0.1), rgba(196, 69, 105, 0.1));
    border-radius: 15px 15px 0 0;
    position: relative;
    width: 100%;
    flex-shrink: 0;
}

.character-image {
    object-fit: contain;
    height: 100%;
    width: 100%;
    max-height: 100%;
    max-width: 100%;
    transition: transform 0.4s ease;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
}

.card-body .mt-auto {
    margin-top: auto;
}

.character-card:hover .character-image {
    transform: scale(1.05);
}

.card-title {
    color: #ffffff;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-text {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* Buttons */
.btn {
    border-radius: 25px;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    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 ease;
}

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

.btn-primary {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(45deg, #c44569, #a83754);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.6);
}

.btn-outline-primary {
    background: transparent;
    color: #ff6b9d;
    border: 2px solid #ff6b9d;
}

.btn-outline-primary:hover {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.6);
}

/* Forms */
.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ff6b9d;
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 157, 0.25);
    color: #ffffff;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Chat Interface (Improved) */
.chat-container {
    height: 70vh;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.message {
    display: flex;
    margin-bottom: 1.5rem;
    animation: messageSlide 0.3s ease;
    max-width: 100%;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-user {
    justify-content: flex-end;
    align-self: flex-end;
}

.message-user .message-content {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    color: white;
    border-radius: 20px 5px 5px 20px;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
    max-width: 80%;
}

.message-ai .message-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px 20px 20px 5px;
    color: #ffffff;
    max-width: 80%;
}

.message-avatar {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 157, 0.3);
    margin: 0 0.5rem;
    flex-shrink: 0;
}

.message-content {
    padding: 1rem 1.5rem;
    position: relative;
    word-wrap: break-word;
    line-height: 1.5;
}

.message-text {
    word-wrap: break-word;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.message-timestamp {
    font-size: 0.7rem;
    opacity: 0.7;
    text-align: right;
}

/* Message Input */
.chat-input-container {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#message-input {
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#message-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ff6b9d;
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 157, 0.25);
    color: #ffffff;
}

#message-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-input-group {
    display: flex;
    gap: 0.5rem;
}

.chat-input-group .form-control {
    flex: 1;
}

#send-button {
    border-radius: 25px;
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    border: none;
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
}

#send-button:hover {
    background: linear-gradient(45deg, #c44569, #a83754);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

#generate-image-button {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    border: 2px solid #ff6b9d;
    color: #ff6b9d;
    background: transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#generate-image-button:hover {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

/* Homepage Styles */
.hero-section {
    text-align: center;
    padding: 5rem 2rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 25px;
    margin: 2rem auto 3rem;
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    max-width: 900px;
    transition: all 0.4s ease;
}

.hero-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(255, 107, 157, 0.3);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 107, 157, 0.1) 180deg, transparent 360deg);
    animation: rotate 20s linear infinite;
    z-index: -1;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b9d, #c44569, #a8dadc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: textGlow 3s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from { filter: drop-shadow(0 0 10px rgba(255, 107, 157, 0.5)); }
    to { filter: drop-shadow(0 0 25px rgba(255, 107, 157, 0.8)); }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.hero-button {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    z-index: -1;
    transition: transform 0.5s ease;
    transform: scaleX(0);
    transform-origin: right;
}

.hero-button:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.hero-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 107, 157, 0.4);
}

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

/* Alert Messages */
.alert {
    background: rgba(255, 107, 157, 0.1);
    border: 1px solid rgba(255, 107, 157, 0.3);
    border-radius: 15px;
    color: #ffffff;
    backdrop-filter: blur(20px);
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.3);
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    padding: 2rem 0;
}

footer h5 {
    color: #ff6b9d;
    font-weight: bold;
}

footer p {
    color: rgba(255, 255, 255, 0.7);
}

/* Dropdown Menu */
.dropdown-menu {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.dropdown-item {
    color: #ffffff;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(255, 107, 157, 0.1);
    color: #ff6b9d;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 107, 157, 0.3);
    border-radius: 50%;
    border-top-color: #ff6b9d;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 992px) {
    .chat-sidebar {
        margin-bottom: 1.5rem;
    }
    
    .chat-sidebar .card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .character-image-container {
        height: 350px;
        width: 100%;
    }
    
    .character-card {
        max-width: 350px;
        margin: 0 auto 2rem;
        display: block;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .hero-button {
        width: 100%;
        max-width: 250px;
    }
    
    .platform-features .row > div {
        margin-bottom: 1rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-container {
        height: 60vh;
    }
    
    /* Prevent overlapping buttons and tags */
    .card-body {
        padding: 1rem;
    }
    
    .badge {
        font-size: 0.7rem;
        margin: 0.125rem 0.25rem 0.125rem 0;
        display: inline-block;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    /* Mobile chat improvements */
    .chat-input-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    #send-button {
        min-width: auto;
    }
    
    #generate-image-button {
        width: 100%;
        border-radius: 25px;
    }
    
    #generate-image-button i {
        margin-right: 0.5rem;
    }
    
    /* Mobile navigation improvements */
    .navbar-nav {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-item {
        margin-bottom: 0.5rem;
    }
    
    /* Mobile form improvements */
    .form-control {
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }
    
    /* Tags cloud mobile improvements */
    .tags-cloud {
        max-height: 200px;
        overflow-y: auto;
        padding: 0.5rem;
    }
    
    /* Mobile character cards spacing */
    .character-grid {
        gap: 1.5rem;
    }
    
    .col-xl-3.col-lg-3.col-md-4.col-sm-6.col-12 {
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .character-image-container {
        height: 300px;
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .character-card {
        max-width: 260px;
        margin: 0 auto 2rem;
        display: block;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-buttons {
        gap: 0.5rem;
    }
    
    .hero-button {
        max-width: 280px;
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .message-content {
        max-width: 90%;
        padding: 0.75rem 1rem;
    }
    
    .chat-container {
        height: 55vh;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    /* Better spacing for mobile navigation */
    .navbar-nav {
        padding-top: 1rem;
    }
    
    .nav-item {
        margin-bottom: 0.5rem;
    }
    
    /* Ensure proper spacing between elements */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .row {
        margin-left: -15px;
        margin-right: -15px;
    }
    
    /* Mobile-specific chat improvements */
    .message {
        margin-bottom: 1rem;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
    
    #message-input {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    #send-button, #generate-image-button {
        padding: 0.75rem;
    }
    
    /* Small screen improvements */
    .tags-cloud {
        max-height: 150px;
        padding: 0.25rem;
        gap: 4px;
    }
    
    .tag-cloud-item {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    .tag-cloud-item.size-xlarge {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    /* Compact character description */
    .card-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Better spacing for small screens */
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .mt-4 {
        margin-top: 1.5rem !important;
    }
    
    /* Improve touch targets */
    .btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #c44569, #a83754);
}

/* Tags */
.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
    border-radius: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.badge.bg-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ff6b9d;
    border: 1px solid rgba(255, 107, 157, 0.3);
}

.badge.bg-secondary:hover {
    background: linear-gradient(45deg, #ff6b9d, #c44569) !important;
    color: white !important;
    border-color: #ff6b9d;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
    text-decoration: none !important;
}

.tag-clickable {
    position: relative;
    overflow: hidden;
}

.tag-clickable::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.tag-clickable:hover::before {
    width: 200%;
    height: 200%;
}

/* Tag size variations for different contexts */
.badge.size-small {
    font-size: 0.7rem;
    padding: 0.4em 0.6em;
}

.badge.size-medium {
    font-size: 0.8rem;
    padding: 0.6em 0.8em;
}

.badge.size-large {
    font-size: 0.9rem;
    padding: 0.8em 1em;
}

.badge.size-xlarge {
    font-size: 1.1rem;
    padding: 1em 1.2em;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glow-effect {
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.3);
}

.glow-effect:hover {
    box-shadow: 0 0 30px rgba(255, 107, 157, 0.5);
}

/* Force light text for all elements */
.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
    /* Prevent iOS Safari auto-inversion */
    filter: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.text-muted:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    filter: none !important;
}

.text-light {
    color: rgba(255, 255, 255, 0.9) !important;
    filter: none !important;
}

.text-white {
    color: #ffffff !important;
    filter: none !important;
}

/* Fix any potential dark text on dark background */
body, p, span, div, h1, h2, h3, h4, h5, h6, a, label, small {
    color: #ffffff !important;
    /* Prevent iOS Safari auto-inversion */
    filter: none !important;
    -webkit-appearance: none;
    appearance: none;
}

p.text-muted, .text-muted p {
    color: rgba(255, 255, 255, 0.7) !important;
    filter: none !important;
}

/* Additional iOS Safari protection for key elements */
.navbar, .card, .btn, .form-control, .alert, footer, .dropdown-menu {
    filter: none !important;
    -webkit-appearance: none;
    appearance: none;
    backdrop-filter: blur(20px) !important;
}

/* Protect background images and gradients */
.card::before, .hero-section::before, .hero-section::after, body::before {
    filter: none !important;
}

/* High contrast text for better readability */
.card-title {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
    filter: none !important;
}

.card-text {
    color: rgba(255, 255, 255, 0.8) !important;
    filter: none !important;
}

/* Добавленные улучшения (из моего предыдущего) */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b9d, #c44569);
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

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

.character-card:hover {
    transform: translateY(-15px) rotateX(5deg) scale(1.02);
    box-shadow: 0 25px 50px rgba(255, 107, 157, 0.25), 0 0 30px rgba(255, 107, 157, 0.15);
}

.character-image {
    transition: transform 0.6s ease;
}

.character-card:hover .character-image {
    transform: scale(1.1) rotate(2deg);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    margin-bottom: 1rem;
}

.badge:hover {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    transform: scale(1.05);
}

.chat-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 107, 157, 0.3) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(#ff6b9d, #c44569);
    border-radius: 10px;
}

.message {
    opacity: 0;
    animation: messageSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes messageSlideIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-user .message-content {
    border-radius: 22px 22px 5px 22px;
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.4);
}

.message-ai .message-content {
    border-radius: 22px 22px 22px 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.message:hover .message-avatar {
    transform: scale(1.1);
}

.message-content::before {
    content: '';
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.message-user .message-content::before {
    right: -10px;
    border-left-color: #ff6b9d;
}

.message-ai .message-content::before {
    left: -10px;
    border-right-color: rgba(255, 255, 255, 0.15);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 1rem 1.6rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 22px 22px 22px 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.typing-dots {
    display: flex;
    gap: 0.4rem;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #ff6b9d;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.chat-input-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#send-button, #generate-image-button {
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#send-button {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    color: white;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
}

#send-button:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.6);
}

#generate-image-button {
    background: transparent;
    border: 2px solid #ff6b9d;
    color: #ff6b9d;
}

#generate-image-button:hover {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    color: white;
    transform: scale(1.1) rotate(-10deg);
}

.hero-section::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 107, 157, 0.1) 180deg, transparent 360deg);
    animation: rotate 20s linear infinite;
}

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

/* Override Bootstrap for list-groups in cards */
.card .list-group-flush .list-group-item {
    background-color: transparent !important;  /* Убираем белый фон */
    border-color: rgba(255, 255, 255, 0.1) !important;  /* Лёгкая граница */
    color: #ffffff !important;  /* Белый текст */
    padding: 1rem;  /* Лучший spacing */
    transition: all 0.3s ease;  /* Smooth hover */
}

.card .list-group-flush .list-group-item-action:hover,
.card .list-group-flush .list-group-item:hover {
    background-color: rgba(255, 107, 157, 0.1) !important;  /* Розовый hover */
    transform: translateX(5px);  /* Лёгкий сдвиг для динамики */
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.2);  /* Glow on hover */
}

.card .list-group-flush .list-group-item-action {
    color: inherit !important;  /* Наследуем белый цвет */
}

/* Улучшение card-header для consistency */
.card-header {
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    color: #ff6b9d;  /* Градиентный текст для header */
}

/* Fix для btn в list-items (delete button) */
.btn-outline-danger {
    border-color: rgba(244, 67, 54, 0.5);
    color: #ff6b9d;
}

.btn-outline-danger:hover {
    background: rgba(244, 67, 54, 0.2);
    color: white;
}

/* Если нужно усилить glass-effect на cards */
.glass-effect {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Image Generation Status Indicator */
.image-generation-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.image-generation-status:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.status-dot::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.status-online {
    background: linear-gradient(45deg, #28a745, #20c997);
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.6);
}

.status-online::after {
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.4);
}

.status-offline {
    background: linear-gradient(45deg, #dc3545, #6c757d);
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.4);
}

.status-offline::after {
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.2);
}

.status-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Cookie Consent Popup Styles */
.cookie-consent-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: none;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: cookieSlideIn 0.5s ease-out;
    max-width: 380px;
    min-width: 300px;
}

@keyframes cookieSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cookie-consent-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-icon {
    font-size: 2rem;
    text-align: center;
    color: #ff6b9d;
    animation: cookieFloat 2s ease-in-out infinite;
}

@keyframes cookieFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.cookie-text h5 {
    color: #ffffff;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-align: center;
}

.cookie-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cookie-actions .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    min-width: 120px;
}

.cookie-actions .btn-accept {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.cookie-actions .btn-accept:hover {
    background: linear-gradient(45deg, #c44569, #a83754);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.6);
}

.cookie-actions .btn-decline {
    background: transparent;
    color: #ff6b9d;
    border: 2px solid #ff6b9d;
}

.cookie-actions .btn-decline:hover {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.6);
}

/* Mobile responsive for cookie popup */
@media (max-width: 480px) {
    .cookie-consent-popup {
        bottom: 15px;
        right: 15px;
        left: 15px;
        max-width: none;
        min-width: auto;
    }
    
    .cookie-consent-content {
        padding: 1.25rem;
        gap: 0.75rem;
    }
    
    .cookie-icon {
        font-size: 1.75rem;
    }
    
    .cookie-text h5 {
        font-size: 1.1rem;
    }
    
    .cookie-text p {
        font-size: 0.85rem;
    }
    
    .cookie-actions {
        gap: 0.5rem;
    }
    
    .cookie-actions .btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.85rem;
        min-width: 110px;
    }
}

/* Tablet responsive */
@media (max-width: 768px) {
    .cookie-consent-popup {
        bottom: 15px;
        right: 15px;
        max-width: 350px;
    }
    
    .cookie-actions .btn {
        min-width: 115px;
    }
}

/* Accessibility improvements */
.cookie-consent-popup:focus-within {
    box-shadow: 0 10px 40px rgba(255, 107, 157, 0.3);
}

.cookie-consent-popup .btn:focus {
    outline: 3px solid rgba(255, 107, 157, 0.3);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-consent-popup {
        border: 2px solid #ffffff;
        background: rgba(0, 0, 0, 0.98);
    }
    
    .cookie-actions .btn-accept {
        background: #ff6b9d;
        color: white;
    }
    
    .cookie-actions .btn-decline {
        background: transparent;
        color: #ff6b9d;
        border: 2px solid #ff6b9d;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-popup {
        animation: none;
    }
    
    .cookie-icon {
        animation: none;
    }
    
    .cookie-actions .btn {
        transition: none;
    }
}
