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

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #141b2d;
    --bg-card: #1a2332;
    --bg-input: #252d3f;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1f3a 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
}

/* Mobile-First App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-primary);
    position: relative;
    padding-bottom: 90px; /* Space for bottom nav (70px nav + 20px extra) */
}

/* App Header */
.app-header {
    background: var(--bg-secondary);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.app-logo {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin: 0;
}

.header-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.header-btn:active {
    transform: scale(0.95);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: visible;
    padding: 20px;
    margin-bottom: 100px; 
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}

.section-header-compact {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.section-header-compact h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.user-select-small {
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    max-width: 150px;
}

.user-select-small:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    height: auto;
    min-height: 70px;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 5px 8px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
}

.nav-item.active {
    color: var(--accent-primary);
}

.nav-icon {
    font-size: 1.3rem;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Profile Section */
.profile-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid var(--border-color);
    /* Extra bottom space so last answers clear the bottom nav */
    margin-bottom: 140px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.profile-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.profile-gender, .profile-phone {
    margin: 5px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.profile-answers h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-item {
    padding: 12px;
    background: var(--bg-input);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.answer-question-block {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.answer-question-num {
    background: var(--accent-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    min-width: 35px;
    text-align: center;
}

.answer-question-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
}

.answer-value-block {
    display: flex;
    gap: 6px;
    align-items: baseline;
    flex-wrap: wrap;
}

.answer-label-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.answer-value {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Recommended Profiles Section */
.recommended-profiles {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card-recommended {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-card-recommended:active {
    transform: scale(0.98);
    background: var(--bg-input);
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.profile-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.profile-card-info {
    flex: 1;
}

.profile-card-info h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.profile-card-gender {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-card-score {
    font-weight: 600;
    font-size: 1.1rem;
}

.profile-card-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.like-btn {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.like-btn:active {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.view-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.view-btn:active {
    transform: scale(0.95);
}

/* Matches/Search Section */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.match-card:active {
    transform: scale(0.98);
    background: var(--bg-input);
}

.match-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.match-info {
    flex: 1;
}

.match-info h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.match-gender {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.match-score {
    font-weight: 600;
    font-size: 1rem;
}

.match-action {
    color: var(--text-secondary);
    font-size: 1.5rem;
}

/* Messages Section */
.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.conversation-item {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.conversation-item:active {
    transform: scale(0.98);
    background: var(--bg-input);
}

.conversation-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.conversation-info {
    flex: 1;
}

.conversation-info h4 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.conversation-preview {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.conversation-badge {
    background: var(--accent-primary);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Chat Interface */
.chat-container {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    height: 100%;
    min-height: 500px;
}

.chat-header {
    background: var(--bg-secondary);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn-chat {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.back-btn-chat:hover {
    color: var(--accent-primary);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.chat-header-info h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.chat-status {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

.chat-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-style: italic;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: fadeIn 0.3s ease;
}

.chat-message.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.received {
    align-self: flex-start;
    align-items: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
}

.chat-message.sent .message-content {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.received .message-content {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 0 4px;
}

.chat-input-container {
    background: var(--bg-secondary);
    padding: 18px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
    position: sticky;
    bottom: 0;
}

.chat-input {
    flex: 1;
    padding: 16px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 1.1rem;
    outline: none;
    min-height: 50px;
}

.chat-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 1rem;
    min-height: 50px;
    white-space: nowrap;
}

.send-btn:active {
    transform: scale(0.95);
}

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

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

.empty-state p {
    font-size: 1rem;
}

/* User Select */
.user-select {
    padding: 10px 15px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.user-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Modal Updates for Mobile */
.modal-large {
    width: 95%;
    max-width: 100%;
    margin: 2% auto;
    max-height: 95vh;
}

/* Loading Message */
.loading-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .app-container {
        max-width: 500px;
        margin: 0 auto;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    }
    
    .main-content {
        padding: 20px;
    }
}

/* Navigation */
.top-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 10px 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: var(--bg-input);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-color: transparent;
}

/* Legacy container for old pages */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.header h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.form-container {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.form-section h2 {
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-weight: 600;
}

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

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

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.questions-section {
    margin-top: 40px;
}

.questions-section h2 {
    color: var(--text-primary);
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 600;
}

.question-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.question-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
}

.question-header {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.question-number {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.question-type {
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.question-text {
    color: var(--text-primary);
    font-size: 1.05rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.options label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-input);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.options label:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.options input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.scale-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scale-options label {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: var(--bg-input);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.scale-options label:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.scale-options input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.submit-section {
    margin-top: 40px;
    text-align: center;
}

.submit-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    position: relative;
    min-width: 200px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

/* Results Page Styles */
.results-container {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
    transform: translateX(5px);
}

.result-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-score {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.back-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 30px;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.back-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-input);
}

.refresh-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.refresh-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-input);
}

.compatibility-card {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
}

.compatibility-pair {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-gender {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: var(--bg-input);
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
}

.vs-divider {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0 15px;
}

.compatibility-score-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.loading-message {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.user-select-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.select-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
}

.user-select {
    padding: 10px 15px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.user-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.user-select:hover {
    border-color: var(--accent-primary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-secondary);
    margin: 2% auto;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.8rem;
}

.close-modal {
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 20px;
}

.analysis-users {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.analysis-user {
    text-align: center;
}

.analysis-user h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.overall-score {
    text-align: center;
    padding: 15px 25px;
    background: var(--bg-card);
    border-radius: 15px;
    border: 2px solid var(--accent-primary);
}

.score-large {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.score-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.breakdown-section {
    margin-top: 20px;
}

.breakdown-section h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.breakdown-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.breakdown-item:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.breakdown-question {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.question-num {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.question-text {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
    line-height: 1.5;
}

.breakdown-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.breakdown-answers {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.answer-label {
    font-weight: 600;
    color: var(--text-primary);
}

.answer-value {
    color: var(--text-secondary);
}

.answer-separator {
    color: var(--border-color);
    margin: 0 5px;
}

.breakdown-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.compatibility-level {
    font-weight: 600;
    font-size: 1rem;
}

.score-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.multiplier-explanation {
    cursor: help;
    color: var(--accent-primary);
    font-size: 0.85rem;
}

.breakdown-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.breakdown-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.clickable-score {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 8px;
}

.clickable-score:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.05);
}

.error-message {
    color: var(--error);
    text-align: center;
    padding: 20px;
    font-size: 1.1rem;
}

/* Scrollbar for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--bg-input);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .form-container {
        padding: 25px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .question-card {
        padding: 20px;
    }

    .result-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .result-score {
        font-size: 1.3rem;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-input);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}
