/* Основные стили с glassmorphism и неоновым свечением */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #fff;
}

/* Градиентный фон */
.bg-gradient {
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Стеклянный эффект */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-nav {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

/* Минималистичный текст */
.neon-text {
    color: #fff;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.5),
                 0 0 6px rgba(255, 255, 255, 0.3),
                 0 0 9px rgba(102, 126, 234, 0.3);
    font-weight: 600;
    letter-spacing: 1px;
    display: inline-block;
    margin: 10px 0;
}

/* Темные кнопки */
.btn-neon {
    background: linear-gradient(45deg, #1a1a2e, #0f0f1e);
    border: none;
    border-radius: 25px;
    color: white;
    padding: 12px 30px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(26, 26, 46, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-neon:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 26, 46, 0.4);
    color: white;
}

.btn-neon:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn-neon:hover:before {
    left: 100%;
}

.btn-outline-neon {
    background: transparent;
    border: 2px solid #1a1a2e;
    border-radius: 25px;
    color: #1a1a2e;
    padding: 10px 25px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(26, 26, 46, 0.2);
    transition: all 0.3s ease;
}

.btn-outline-neon:hover {
    background: rgba(26, 26, 46, 0.1);
    box-shadow: 0 6px 20px rgba(26, 26, 46, 0.3);
    color: white;
    border-color: white;
}

/* Темные формы */
.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: white;
    padding: 12px 20px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #1a1a2e;
    box-shadow: 0 0 15px rgba(26, 26, 46, 0.3);
    color: white;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Опции в select */
.form-control option {
    background: #333;
    color: white;
    padding: 10px;
}

/* Специальные стили для select */
select.form-control {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Для Internet Explorer */
select.form-control::-ms-expand {
    display: none;
}

/* Для Firefox */
.form-control::-moz-color-swatch {
    border: none;
}

.form-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 8px;
}

/* Поляроид карточка */
.polaroid-card {
    background: #333;
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 180px;
    margin: 0 auto;
}

.polaroid-card:hover {
    transform: rotate(0deg) translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.polaroid-card:nth-child(even) {
    transform: rotate(2deg);
}

.polaroid-card:nth-child(even):hover {
    transform: rotate(0deg) translateY(-5px);
}

.photo-container {
    position: relative;
    height: 150px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-photo {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.online-status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.online-dot {
    color: #28a745;
    font-size: 12px;
    filter: drop-shadow(0 0 3px rgba(40, 167, 69, 0.8));
    animation: pulse-green 2s infinite;
}

.offline-dot {
    color: #6c757d;
    font-size: 12px;
    opacity: 0.7;
}

@keyframes pulse-green {
    0% {
        filter: drop-shadow(0 0 3px rgba(40, 167, 69, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 6px rgba(40, 167, 69, 1));
    }
    100% {
        filter: drop-shadow(0 0 3px rgba(40, 167, 69, 0.8));
    }
}

.polaroid-card:hover .photo-overlay {
    opacity: 1;
}

.like-icon {
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.like-icon:hover {
    transform: scale(1.2);
    color: #667eea;
    text-shadow: 0 0 15px rgba(102, 126, 234, 0.6);
}

.like-icon.liked {
    color: #667eea;
    text-shadow: 0 0 15px rgba(102, 126, 234, 0.6);
}

.info-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Info-section для карточек на главной странице */
.polaroid-card .info-section {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px;
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.polaroid-card .info-section h5 {
    color: #fff !important;
    margin-bottom: 15px;
}

.polaroid-card .info-section p {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 10px;
    line-height: 1.6;
}

.user-name {
    color: #fff;
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.user-info {
    color: #ddd;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.user-username {
    color: #667eea;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.online-status {
    font-size: 0.7rem;
}

.online-indicator {
    color: #28a745;
    font-weight: 500;
}

.online-indicator i {
    font-size: 0.6rem;
    margin-right: 2px;
}

.offline-indicator {
    color: #6c757d;
    font-weight: 500;
}

.offline-indicator i {
    font-size: 0.6rem;
    margin-right: 2px;
}

.user-details {
    margin-bottom: 8px;
}

.purposes-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 5px;
}

.purpose-mini {
    background: linear-gradient(45deg, #1a1a2e, #16213e);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1;
}

.hashtags-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 5px;
}

.hashtag-mini {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 500;
    line-height: 1;
}

.hashtags-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.hashtag-tag {
    background: linear-gradient(45deg, #f093fb, #f5576c);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 3px;
    display: inline-block;
}

/* Профиль фото */
.profile-photo-large {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
}

.no-photo-large {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
}

.no-photo-large p {
    font-size: 0.8rem !important;
    opacity: 0.7;
    margin: 5px 0 0 0 !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.profile-name-section {
    text-align: center;
    margin-bottom: 20px;
}

.profile-name-section h2 {
    margin-bottom: 10px;
}

.profile-name-section .btn {
    margin: 5px;
}

.input-group {
    max-width: 400px;
    margin: 0 auto;
}

/* Улучшение читаемости текста в профиле */
.profile-info {
    margin-top: 20px;
}

.profile-info .text-white-50 {
    color: rgba(255, 255, 255, 0.8) !important;
    line-height: 1.6;
}

.profile-info .text-white {
    color: rgba(255, 255, 255, 0.95) !important;
}

.current-photo {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Теги интересов */
.interests-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.interest-tag {
    background: linear-gradient(45deg, #1a1a2e, #16213e);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 0 10px rgba(26, 26, 46, 0.3);
}

/* Теги целей знакомства */
.purposes-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.purpose-tag {
    background: linear-gradient(45deg, #16213e, #0f0f1e);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 0 10px rgba(22, 33, 62, 0.3);
}

/* Стили для чекбоксов целей */
.purpose-checkboxes-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 100%;
    overflow: hidden;
}

.purpose-checkboxes-container.compact {
    padding: 10px;
}

.purpose-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.purpose-checkboxes-container.compact .purpose-checkboxes {
    gap: 5px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.purpose-checkboxes label {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}

.purpose-checkboxes-container.compact .purpose-checkboxes label {
    padding: 5px;
    font-size: 0.9rem;
}

.purpose-checkboxes label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.purpose-checkboxes input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.purpose-checkboxes-container.compact .purpose-checkboxes input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

/* Галерея фото */
.existing-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.photo-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.existing-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.photo-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photo-controls label {
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.photo-controls input[type="checkbox"] {
    margin-right: 5px;
}

.photo-controls button {
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 5px;
}

/* Галерея в профиле */
.profile-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gallery-photo {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-photo:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.gallery-photo img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gallery-photo-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-photo:hover .gallery-photo-controls {
    opacity: 1;
}

.gallery-photo-controls button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.gallery-photo-controls button:hover {
    transform: scale(1.1);
}

.main-photo-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(45deg, #1a1a2e, #16213e);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 0 15px rgba(26, 26, 46, 0.5);
}

.main-photo-badge i {
    font-size: 0.9rem;
}

.main-photo {
    border: 3px solid #1a1a2e;
    box-shadow: 0 0 20px rgba(26, 26, 46, 0.4);
}

.private-photo-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.private-photo-overlay i {
    font-size: 0.9rem;
}

/* Модальное окно фото */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.photo-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.photo-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}


/* Темный чат */
.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
}

.chat-header {
    flex-shrink: 0;
    background: rgba(26, 26, 46, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-input {
    flex-shrink: 0;
    background: rgba(26, 26, 46, 0.3);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
}

.message {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 20px;
    word-wrap: break-word;
}

.message-own {
    align-self: flex-end;
    background: linear-gradient(45deg, #1a1a2e, #16213e);
    color: white;
    border-bottom-right-radius: 5px;
}

.message-other {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border-bottom-left-radius: 5px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.avatar-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unread-badge {
    background: linear-gradient(45deg, #1a1a2e, #16213e);
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(26, 26, 46, 0.5);
}

/* Инвайты */
.invite-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Навигация */
.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 10px;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    text-shadow: 0 0 10px rgba(255, 0, 110, 0.8);
}

/* Сообщения */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
}

.glass-message {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    margin-bottom: 10px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .polaroid-card {
        margin-bottom: 20px;
    }
    
    .profile-photo-large,
    .no-photo-large {
        width: 150px;
        height: 150px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .chat-container {
        height: 100vh;
    }
    
    .fixed-bottom {
        bottom: 0;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Центрированный поиск по хэштегам */
.search-container {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.search-container .form-control {
    text-align: center;
    font-size: 1rem;
    padding: 6px 20px;
    height: auto;
}

.search-buttons {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    gap: 8px;
}
#userCards > div[id^="profile-"] {
    position: relative !important;
    z-index: 1 !important;
}

#userCards > div[id^="profile-"]:not(:first-of-type) {
    /* Дополнительная защита для последующих карточек */
}

.polaroid-card {
    /* Убрана анимация для предотвращения дублирования */
    will-change: auto !important;
    transform: none !important;
    transition: none !important;
}

.polaroid-card:hover {
    transform: translateY(-5px) !important;
    transition: transform 0.3s ease !important;
}

/* Темная кнопка лайка в детальной странице */
.like-btn {
    background: linear-gradient(45deg, #1a1a2e, #16213e);
    border: none;
    border-radius: 25px;
    color: white;
    padding: 15px 40px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(26, 26, 46, 0.3);
    transition: all 0.3s ease;
}

.like-btn.liked {
    background: linear-gradient(45deg, #28a745, #20c997);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.like-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 26, 46, 0.4);
}
