/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    background: white;
    color: #0f172a;
}

/* Design System Variables */
:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --primary-color: #8b5cf6;
    --primary-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(226, 232, 240, 0.5);
    --glass-hover: rgba(248, 250, 252, 0.8);
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    --gradient-primary: linear-gradient(135deg, #8b5cf6, #a78bfa);
    --gradient-hero: linear-gradient(135deg, #8b5cf6 0%, #c084fc 50%, #a78bfa 100%);
    --shadow-elegant: 0 10px 25px -5px rgba(139, 92, 246, 0.1), 0 8px 10px -6px rgba(139, 92, 246, 0.1);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 8px;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    outline: none;
}

.btn:focus {
    ring: 2px solid var(--primary);
    ring-offset: 2px;
}

.btn-hero {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-elegant);
    font-weight: 600;
}

.btn-hero:hover {
    box-shadow: var(--shadow-glow);
    transform: scale(1.05);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.btn-outline:hover {
    background: #f8fafc;
    color: #334155;
}

.btn-outline-white {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-outline-white:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
    background: transparent;
    color: #64748b;
}

.btn-ghost:hover {
    background: #f8fafc;
    color: #334155;
}

.btn-full {
    width: 100%;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2100;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid #e2e8f0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

/* Mobile navigation */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #64748b;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    color: #334155;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid #e2e8f0;
    z-index: 2000;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu-content {
    padding: 1rem;
}

.mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-menu-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #936af7;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    transition: right 0.3s ease;
    z-index: 999;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-content {
    padding: 80px 20px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Session mobile menu items */
.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    padding: 12px 16px;
    width: 100%;
    text-align: left;
}

.mobile-menu-item i {
    width: 20px;
    height: 20px;
}

@media (max-width: 767px) {
    .nav-container {
        justify-content: space-between;
        position: relative;
    }
    
    .nav-actions.desktop-nav {
        display: none !important;
    }
    
    .mobile-menu-btn {
        display: block !important;
    }
    
    /* When user is logged in on mobile */
    .nav-container.logged-in {
        justify-content: space-between;
    }
    
    .nav-container.logged-in .brand-text {
        flex: 1;
        text-align: center;
    }
    
    .nav-container.logged-in .mobile-menu-btn {
        order: 3;
    }
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.nav-links {
    display: none;
    gap: 2rem;
}

.nav-links a {
    color: #64748b;
    text-decoration: none;
    transition: var(--transition);
}

.nav-links a:hover {
    color: #334155;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-actions .btn .desktop-only {
    display: none;
}

@media (min-width: 1024px) {
    .nav-actions .btn .desktop-only {
        display: inline;
    }
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    opacity: 0.9;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    padding: 0 1rem;
    animation: fadeIn 0.8s ease-out;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-title-gradient {
    display: block;
    background: linear-gradient(to right, white, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 4rem;
    align-items: center;
}

.hero-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 64rem;
    margin: 0 auto;
}

.hero-feature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero-feature i {
    color: var(--primary-light);
}

.hero-decoration {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
}

.hero-decoration-1 {
    top: 25%;
    left: 25%;
    width: 8rem;
    height: 8rem;
    background: rgba(255, 255, 255, 0.05);
}

.hero-decoration-2 {
    bottom: 25%;
    right: 25%;
    width: 6rem;
    height: 6rem;
    background: rgba(168, 139, 250, 0.2);
}

@media (min-width: 640px) {
    .hero-actions {
        flex-direction: row;
        justify-content: center;
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 4.5rem;
    }
    
    .hero-description {
        font-size: 1.5rem;
    }
    
    .hero-features {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Features Section */
.features-section {
    padding: 6rem 0;
    background: linear-gradient(180deg, white, #f8fafc);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.section-description {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 48rem;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 2rem;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card:hover {
    box-shadow: var(--shadow-elegant);
    transform: translateY(-2px);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    background: var(--gradient-primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-icon i {
    color: white;
    width: 1.5rem;
    height: 1.5rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.feature-description {
    color: #64748b;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-title {
        font-size: 3rem;
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Footer */
.footer {
    background: #0f172a;
    color: white;
    padding: 4rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-brand .brand-text {
    color: white;
    margin-bottom: 1rem;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    max-width: 20rem;
}

.footer-title {
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 2rem 0;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-social a:hover {
    color: white;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 28rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    flex: 1;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #64748b;
    transition: var(--transition);
}

.modal-close:hover {
    color: #334155;
}

.login-form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 0.75rem;
    color: #9ca3af;
    width: 1rem;
    height: 1rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: var(--transition);
        margin-left: 10px;
}



.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    transition: var(--transition);
}

.password-toggle:hover {
    color: #374151;
}

/* Interests selection */
.interests-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.interest-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    background: white;
    font-size: 0.875rem;
    font-weight: 500;
}

.interest-option:hover {
    border-color: var(--primary-light);
    background: #f8fafc;
}

.interest-option.selected {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white;
}

.interest-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.interest-option.disabled:hover {
    border-color: #e2e8f0;
    background: white;
}

.interest-option i {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.interests-counter {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

@media (min-width: 640px) {
    .interests-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

.form-separator {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.form-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.form-separator span {
    background: white;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.form-footer {
    text-align: center;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.form-footer span {
    color: #9ca3af;
}

.form-footer button {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* App Interface Styles */
.app-section {
    padding: 6rem 0 4rem;
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc, white);
}

.app-header {
    text-align: center;
    margin-bottom: 4rem;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.app-description {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 36rem;
    margin: 0 auto;
}

.people-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.person-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 1px solid #e2e8f0;
}

.person-card:hover {
    box-shadow: var(--shadow-elegant);
    transform: translateY(-4px);
}

.person-avatar {
    text-align: center;
    margin-bottom: 1.5rem;
}

.avatar-placeholder {
    width: 4rem;
    height: 4rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.avatar-placeholder2 {
    width: 4rem;
    height: 4rem;
    background: url('./img/pfp-woman-3.jpg');
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
        background-size: cover;
}


.avatar-placeholder3 {
    width: 4rem;
    height: 4rem;
    background: url('./img/pfp-man.jpg');
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
        background-size: cover;
}


.avatar-placeholder5 {
    width: 4rem;
    height: 4rem;
    background: url('./img/pfp-man-2.jpg');
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
        background-size: cover;
}

.avatar-placeholder6 {
    width: 4rem;
    height: 4rem;
    background: url('./img/pfp-woman-2.jpg');
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
        background-size: cover;
}

.person-info {
    text-align: center;
}

.person-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.person-bio {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.person-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.interest-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
}

.person-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.person-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-greeting {
    color: #64748b;
    font-weight: 500;
}

#appContent {
    display: none;
}

/* Chat Interface Styles */
#chatInterface {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: var(--primary-bg);
}

.chat-container {
    height: 85vh;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    background: var(--primary-bg);
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 1rem;
    transition: var(--transition-smooth);
}

.chat-back-btn:hover {
    background: var(--glass-hover);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}


.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    background-size: cover !important;
    background-position: center;
    background: var(--gradient-primary); /* fallback for letters */
}

.chat-user-details {
    flex: 1;
}

.chat-user-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chat-user-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    margin-bottom: 0.5rem;
    flex-direction: column;
}

.chat-message.sent {
    align-items: flex-end; 
}

.chat-message.received {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 1.5rem;
    position: relative;
}

.chat-message.sent .message-bubble {
    background: var(--gradient-primary);
    color: white;
    border-bottom-right-radius: 0.5rem;
}

.chat-message.received .message-bubble {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 0.5rem;
}

/* System message styles */
.chat-message.system {
    justify-items: center;
    display: flex;
    justify-content: center; 
    align-items: center;   
}

.chat-message.system .message-bubble {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    text-align: center;
    font-style: italic;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 1rem;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
        margin: auto;
}

.message-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    display: block;
    margin-top: 0.25rem;
}

.chat-message.sent .message-time {
    text-align: right;
}

/* Message status styles - positioned directly under the bubble */
.message-status {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
    margin-top: 4px;
    margin-bottom: 8px;
}

.chat-message.sent .message-status {
    text-align: right;
    color: #9ca3af;
    margin-right: 0;
}

.chat-message.received .message-status {
    text-align: left;
    color: #9ca3af;
    margin-left: 0;
}

/* Messages tab styles */
.messages-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.messages-tab i {
    width: 16px;
    height: 16px;
}

/* Messages interface styles */
.messages-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.messages-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--card);
}

.messages-back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.messages-back-btn:hover {
    background: var(--muted);
}

.messages-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.conversation-item:hover {
    background: var(--muted);
}

.conversation-item:last-child {
    border-bottom: none;
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.conversation-preview {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.conversation-count {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.no-messages {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.no-messages i {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-messages h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.no-messages p {
    margin: 0;
    max-width: 300px;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 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 typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-input-container {
    padding: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    transition: var(--transition-smooth);
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

#chatInput {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.5rem 0;
}

#chatInput::placeholder {
    color: var(--text-secondary);
}

.chat-send-btn {
    background: var(--gradient-primary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-left: 0.5rem;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-elegant);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* Responsive chat design */
@media (max-width: 768px) {
    .chat-container {
        max-width: 100%;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .chat-header {
        padding: 0.75rem;
    }
    
    .chat-messages {
        padding: 0.75rem;
    }
    
    .chat-input-container {
        padding: 0.75rem;
    }
}

@media (min-width: 640px) {
    .people-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .person-actions {
        flex-direction: row;
    }
}

@media (min-width: 1024px) {
    .people-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .app-title {
        font-size: 3rem;
    }
}

/* Form Select Styles */
.input-group select {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    margin-left: 10px;
}

.input-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group select[multiple] {
    height: 120px;
    background-image: none;
    padding: 8px 40px 8px 40px;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

.checkbox-group label {
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

.terms-link {
    color: #3b82f6;
    text-decoration: underline;
}

.terms-link:hover {
    color: #2563eb;
}