/* NeonConnect - Purple Dark Mode */

:root {
    /* Purple Branding */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #312e54;
    --primary-glow: rgba(99, 102, 241, 0.3);
    
    /* Dark Mode */
    --text: #f3f4f6;
    --text-light: #9ca3af;
    --text-muted: #6b7280;
    --bg: #0f0f14;
    --bg-card: #16161e;
    --bg-elevated: #1e1e28;
    --border: #2d2d3a;
    --border-light: #3d3d4a;
    
    /* Accents */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Radius */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo-icon {
    font-size: 1.8rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.nav-link-primary {
    background: var(--primary);
    color: white;
}

.nav-link-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 20px var(--primary-glow);
    color: white;
}

.nav-link-secondary {
    color: var(--text-light);
}

.badge {
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 4px;
    font-weight: 600;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* Main */
.main {
    flex: 1;
    padding: 40px 0;
}

/* Flash Messages */
.flash-message {
    max-width: 600px;
    margin: 0 auto 20px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 500;
}

.flash-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.flash-error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.flash-info {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    border: 1px solid var(--primary-glow);
}

/* Auth Forms */
.auth-container {
    max-width: 420px;
    margin: 0 auto;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

.auth-title h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-title p {
    color: var(--text-light);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

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

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 6px;
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Profile Card */
.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.profile-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.profile-avatar {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--primary-light), #1e1e40);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    position: relative;
    overflow: hidden;
}

.profile-avatar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 40%, var(--primary-glow) 50%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.profile-card:hover .profile-avatar::before {
    opacity: 1;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--primary-light), #1e1e40);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

.profile-info {
    padding: 24px;
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.profile-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.profile-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-bio {
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 16px;
}

.profile-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Browse Grid */
.browse-header {
    margin-bottom: 30px;
}

.browse-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.browse-header p {
    color: var(--text-light);
}

.filters {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    padding: 10px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.875rem;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--primary);
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.pagination .active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
}

/* Messages */
.messages-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: calc(100vh - 200px);
}

.conversations-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.conversation-item:hover,
.conversation-item.active {
    background: var(--bg-elevated);
}

.conversation-item.active {
    border-left: 3px solid var(--primary);
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.conversation-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.2rem;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.conversation-preview {
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-unread {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.chat-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: var(--radius);
}

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
}

.message.received {
    align-self: flex-start;
    background: var(--bg-elevated);
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-input {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.chat-input input {
    flex: 1;
    padding: 14px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
}

.chat-input input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Profile Page */
.profile-page {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
}

.profile-header-content {
    padding: 24px;
    display: flex;
    gap: 24px;
    align-items: flex-end;
    margin-top: -60px;
}

.profile-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-card);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.profile-avatar-large-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary);
    border: 4px solid var(--bg-card);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.profile-header-info h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.profile-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
}

.profile-section h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
}

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 30px 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-muted);
}

.footer-links {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state h2 {
    margin-bottom: 8px;
    color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
        z-index: 99;
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav-link {
        padding: 12px 16px;
        text-align: left;
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block;
        padding: 8px 12px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 16px;
    }
    
    .messages-layout {
        grid-template-columns: 1fr;
    }
    
    .conversations-list {
        display: none;
    }
    
    .profiles-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .profile-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .browse-header h1 {
        font-size: 1.5rem;
    }
}