/* ===== GLOBAL VARIABLES ===== */
:root {
    --primary-pink: #ff4d8d;
    --primary-purple: #9d4edd;
    --primary-blue: #4361ee;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --card-bg: #121212;
    --card-bg-alt: #1a1a1a;
    --light-text: #ffffff;
    --muted-text: #8a8a8e;
    --border-color: #2a2a2e;
    --accent-green: #00cc88;
    --accent-yellow: #ffcc00;
    --accent-orange: #ff6b35;
    --accent-gold: #ffb703;
    --neon-blue: #00d4ff;
    --neon-pink: #ff2d78;
    --neon-purple: #9d4edd;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 50%;
    --spacing-xs: 6px;
    --spacing-sm: 12px;
    --spacing-md: 18px;
    --spacing-lg: 24px;
    --nav-height: 70px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.6);
    --glow-pink: 0 0 20px rgba(255, 77, 141, 0.3);
    --glow-purple: 0 0 20px rgba(157, 78, 221, 0.3);
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--light-text);
    background-color: var(--dark-bg);
    display: flex;
    flex-direction: column;
}

#app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.main-content, .container, .hookup-container, .profile-container {
    flex: 1;
    width: 100%;
    position: relative;
    padding-bottom: calc(var(--nav-height, 70px) + 20px); /* Buffer for bottom navigation */
}

.main-content {
    display: flex;
    flex-direction: column;
}

.main-content > *, .container > * {
    flex-shrink: 0;
}

/* When the nav is hidden, ensure zero gap at the bottom */
body.nav-is-hidden {
    overflow: hidden;
}

body.nav-is-hidden .main-content,
body.nav-is-hidden .chat-area,
body.nav-is-hidden .container,
body.nav-is-hidden #app-container {
    padding-bottom: 0 !important;
}

body.nav-is-hidden .bottom-nav {
    display: none !important;
}

body::before {
    pointer-events: none !important;
}

html {
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    background: transparent;
    position: relative;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
header {
    background: var(--card-bg, #121212);
    position: relative;
    z-index: 1000;
    width: 100%;
    flex-shrink: 0;
}

.header-content,
.discover-header,
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px var(--spacing-sm, 15px);
    width: 100%;
    min-height: 60px;
    background: var(--card-bg, #121212);
    border-bottom: 1px solid var(--border-color, #2a2a2e);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color, #2a2a2e);
    cursor: pointer;
}

.logout-btn-header {
    color: var(--muted-text, #8a8a8e);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--card-bg-alt, #1a1a1a);
    transition: all 0.3s ease;
    text-decoration: none;
}

.logout-btn-header:hover {
    color: var(--primary-pink, #ff4d8d);
    background: rgba(255, 77, 141, 0.1);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #e91e63;
    text-decoration: none;
}

.logo:hover {
    color: #d81b60;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #e91e63;
}

nav ul li a.active {
    color: #e91e63;
    font-weight: 600;
}

/* ===== USER NAVIGATION ===== */
.user-nav {
    background: white;
    border-bottom: 1px solid #eee;
}

.user-nav ul {
    display: flex;
    list-style: none;
    padding: 0.5rem 0;
    overflow-x: auto;
}

.user-nav ul li {
    flex: 1;
    text-align: center;
}

.user-nav ul li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    text-decoration: none;
    color: #666;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.user-nav ul li a:hover {
    background: #f5f5f5;
    color: #e91e63;
}

.user-nav ul li a.active {
    background: #fff5f7;
    color: #e91e63;
    font-weight: 600;
}

.user-nav ul li a span:first-child {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.badge {
    background: #e91e63;
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.3rem;
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, #e91e63 0%, #9c27b0 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: #e91e63;
    color: white;
    border: 2px solid #e91e63;
}

.btn-primary:hover {
    background: #d81b60;
    border-color: #d81b60;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(232, 30, 99, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #e91e63;
    border: 2px solid #e91e63;
}

.btn-secondary:hover {
    background: #e91e63;
    color: white;
}

.btn-text {
    background: transparent;
    color: #e91e63;
    border: none;
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    text-decoration: underline;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-dislike {
    background: #ffebee;
    color: #f44336;
    border: 2px solid #ffcdd2;
}

.btn-like {
    background: #e8f5e9;
    color: #4caf50;
    border: 2px solid #c8e6c9;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    padding: 0.5rem;
    cursor: pointer;
}

/* ===== AUTH PAGES ===== */
.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--card-bg, #121212);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 500px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--light-text, #333);
}

.auth-form {
    margin-bottom: 2rem;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--muted-text, #555);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e91e63;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left-color: #f44336;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left-color: #4caf50;
}

/* ===== DASHBOARD ===== */
.dashboard {
    padding: 2rem 0;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg, #121212);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow-sm, 0 3px 10px rgba(0, 0, 0, 0.1));
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
    background: rgba(255, 77, 141, 0.1);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content h3 {
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

.stat-content p {
    color: var(--muted-text, #666);
}

.dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.dashboard-section {
    background: var(--card-bg, #121212);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow-sm, 0 3px 10px rgba(0, 0, 0, 0.1));
    flex-shrink: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* ===== MATCHES ===== */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.match-card {
    background: var(--card-bg, #121212);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: var(--shadow-sm, 0 3px 10px rgba(0, 0, 0, 0.1));
    display: flex;
    gap: 1rem;
    align-items: center;
}

.match-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
}

.match-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.match-info h4 {
    margin-bottom: 0.5rem;
}

.match-last-message {
    color: #666;
    margin-bottom: 0.5rem;
}

.message-time {
    color: #999;
    font-size: 0.8rem;
}

/* ===== DISCOVER PAGE ===== */
.discover-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.discover-header {
    text-align: center;
    margin-bottom: 2rem;
}

.discover-card {
    background: var(--card-bg, #121212);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md, 0 10px 30px rgba(0, 0, 0, 0.1));
    margin-bottom: 2rem;
    transition: transform 0.3s;
}

.card-photo {
    height: 400px;
    overflow: hidden;
}

.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 2rem;
}

.card-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.card-location {
    color: var(--muted-text, #666);
    margin-bottom: 1rem;
}

.card-bio {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.card-details {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.detail-item {
    flex: 1;
}

.detail-label {
    display: block;
    color: var(--muted-text, #666);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.detail-value {
    font-weight: 600;
    color: var(--light-text, #fff);
}

.card-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-action {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-action span:first-child {
    font-size: 1.5rem;
}

/* ===== MESSAGES ===== */
.messages-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - 150px);
    background: var(--card-bg, #121212);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 3px 10px rgba(0, 0, 0, 0.1));
}

.messages-sidebar {
    border-right: 1px solid var(--border-color, #eee);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.search-box input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
}

.conversations-list {
    padding: 0.5rem;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: var(--light-text, #fff);
    border-radius: 8px;
    transition: background 0.3s;
}

.conversation-item:hover,
.conversation-item.active {
    background: var(--card-bg-alt, #1a1a1a);
}

.conversation-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

.conversation-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e91e63;
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-info h4 {
    margin-bottom: 0.2rem;
}

.last-message {
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messages-main {
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-partner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.partner-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

.partner-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.partner-status {
    color: #666;
    font-size: 0.9rem;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-row {
    display: flex;
}

.message-row.sent {
    justify-content: flex-end;
}

.message-row.received {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    position: relative;
}

.message-row.sent .message-bubble {
    background: #e91e63;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-row.received .message-bubble {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.3rem;
    display: block;
}

.read-indicator {
    margin-left: 0.5rem;
}

.chat-input {
    padding: 1.5rem;
    border-top: 1px solid #eee;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: #e91e63;
}

/* ===== PROFILE PAGE ===== */
.profile-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.profile-header {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.profile-photo-section {
    text-align: center;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.profile-age {
    color: var(--muted-text, #666);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.profile-location {
    color: var(--muted-text, #666);
}

.profile-content {
    display: grid;
    gap: 2rem;
}

.profile-section {
    background: var(--card-bg, #121212);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow-sm, 0 3px 10px rgba(0, 0, 0, 0.1));
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--card-bg-alt, #1a1a1a);
    border-radius: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color, #eee);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--muted-text, #666);
}

.stat-value {
    font-weight: 600;
}

.preferences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    text-decoration: none;
    color: var(--light-text, #fff);
    border-radius: 8px;
    transition: background 0.3s;
}

.settings-item:hover {
    background: var(--card-bg-alt, #1a1a1a);
}

.settings-item.text-danger {
    color: #f44336;
}

.settings-item.text-danger:hover {
    background: rgba(244, 67, 54, 0.1);
}

/* ===== MATCH ALERT ===== */
.match-alert {
    background: linear-gradient(135deg, #e91e63 0%, #9c27b0 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.match-alert-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.match-alert-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* ===== EMPTY STATES ===== */
.empty-state,
.no-profiles,
.no-messages,
.no-chat-selected {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state p,
.no-profiles p,
.no-messages p,
.no-chat-selected p {
    color: #666;
    margin-bottom: 2rem;
}

/* ===== FOOTER ===== */
footer {
    background: #333;
    color: white;
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ddd;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
    text-decoration: underline;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile First - Extra Small Devices (320px and up) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }

    .logo {
        font-size: 1.3rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        font-size: 0.85rem;
    }

    nav li a {
        padding: 0.4rem 0.6rem;
    }

    .user-nav ul {
        justify-content: flex-start;
        padding: 0.3rem;
    }

    .user-nav ul li {
        flex: 0 0 auto;
        margin: 0 0.3rem;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .dashboard-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-card {
        padding: 1rem;
    }

    .dashboard-card h3 {
        font-size: 0.95rem;
    }

    .dashboard-card .stat-number {
        font-size: 1.5rem;
    }

    .messages-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .messages-sidebar {
        display: none;
    }

    .messages-main {
        min-height: auto;
    }

    .sidebar-header {
        padding: 0.8rem;
    }

    .chat-header {
        padding: 0.8rem;
        gap: 0.5rem;
    }

    .chat-header-actions {
        gap: 0.3rem;
    }

    .chat-messages {
        height: calc(100vh - 250px);
    }

    .message-input-form {
        padding: 0.8rem;
        gap: 0.5rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-photo {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .card-photo {
        height: 200px;
    }

    .discover-container {
        margin: 0.5rem auto;
    }

    .discover-card {
        margin: 0.5rem auto;
    }

    .preferences-grid {
        grid-template-columns: 1fr;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    button,
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1rem;
    }
}

/* Small Devices (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    nav ul {
        flex-wrap: wrap;
        gap: 0.8rem;
        font-size: 0.9rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .messages-container {
        grid-template-columns: 1fr;
    }

    .messages-sidebar {
        display: none;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
    }

    .profile-info-header {
        text-align: center;
    }

    .card-photo {
        height: 250px;
    }

    .preferences-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: column;
    }
}

/* Medium Devices - Tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
    }

    nav ul {
        gap: 1rem;
    }

    .dashboard-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .messages-container {
        grid-template-columns: 250px 1fr;
    }

    .messages-sidebar {
        display: flex;
        width: 250px;
    }

    .card-photo {
        height: 300px;
    }

    .preferences-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Devices - Desktops (1025px and up) */
@media (min-width: 1025px) {
    .dashboard-content {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .messages-container {
        grid-template-columns: 300px 1fr;
    }

    .messages-sidebar {
        display: flex;
        width: 300px;
    }

    .preferences-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .profile-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Landscape mode adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .chat-messages {
        height: calc(100vh - 150px);
    }

    .header-content {
        padding: 0.5rem 0;
    }

    nav ul {
        gap: 0.5rem;
    }
}

/* Print styles */
@media print {

    header,
    nav,
    footer,
    .btn,
    .sidebar {
        display: none;
    }

    body {
        background: white;
    }

    .container {
        max-width: 100%;
    }
}

/* Avatar initials styling */
.avatar-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.avatar-initials {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    font-family: 'Segoe UI', sans-serif;
}

.card-photo-initials {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 48px;
    font-family: 'Segoe UI', sans-serif;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    /* Fix Bottom Navigation Cramping */
    .bottom-nav {
        gap: 0 !important;
        padding: 0 5px !important;
        display: flex !important;
        justify-content: space-between !important;
    }

    .nav-item {
        min-width: 45px !important;
        padding: 6px 2px !important;
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .nav-icon {
        font-size: 1.1rem !important;
        margin-bottom: 2px !important;
    }

    .nav-label {
        font-size: 0.55rem !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
    }

    /* Fix Discover Button in Middle */
    .nav-item.center-nav {
        width: 50px !important;
        height: 50px !important;
        bottom: 15px !important;
        z-index: 1001 !important;
    }

    .nav-item.center-nav .nav-icon {
        font-size: 1.3rem !important;
    }

    /* Fix Badge Positioning */
    .nav-badge,
    .badge,
    .unread-badge {
        position: absolute !important;
        top: -2px !important;
        right: 2px !important;
        background: var(--primary-pink) !important;
        color: white !important;
        font-size: 0.65rem !important;
        width: 16px !important;
        height: 16px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: 700 !important;
        border: 2px solid var(--card-bg, #121212) !important;
        z-index: 10 !important;
    }

    /* Fix Content Cut-off in Messages */
    .messages-container {
        grid-template-columns: 1fr;
        height: calc(100vh - 140px);
    }

    .messages-sidebar {
        display: none;
    }

    .messages-main {
        width: 100%;
    }

    .chat-input-area {
        padding-bottom: 45px !important;
    }

    /* Auth pages fix */
    .auth-card {
        padding: 1.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

.profile-photo-initials {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 48px;
    font-family: 'Segoe UI', sans-serif;
}

/* ===== SHARED COMPONENT STYLES (MIGRATED FROM PHP HEADERS) ===== */

/* Subscription & Pass Cards */
.subscription-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: 0 var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Ribbon Removed from Premium Cards */

.subscription-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-pink), var(--primary-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: var(--shadow-md);
}

.subscription-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 4px;
}

.subscription-info p {
    font-size: 0.9rem;
    color: var(--muted-text);
}

.subscription-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-active {
    background: rgba(0, 204, 136, 0.2);
    color: var(--accent-green);
}

.status-expired {
    background: rgba(255, 77, 141, 0.2);
    color: var(--primary-pink);
}

.perks-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0;
    padding: 0 4px;
}

.perk-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--light-text);
    font-weight: 500;
}

.perk-item i.fa-check-circle {
    color: var(--accent-green);
    font-size: 0.85rem;
}

.subscription-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
    color: #000;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    z-index: 2;
}

/* Match Card Styles */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px;
}

.match-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
}

.match-header {
    padding: 15px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.match-avatar-container {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary-pink);
}

.match-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.match-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--light-text);
}

.match-age {
    font-size: 0.9rem;
    color: var(--muted-text);
}

.match-message-preview {
    background: var(--card-bg-alt);
    margin: 0 15px 15px;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--muted-text);
    border-left: 3px solid var(--primary-pink);
}

.match-actions {
    padding: 0 15px 15px;
    display: flex;
    gap: 10px;
}

.match-action-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
}

.message-btn {
    background: linear-gradient(135deg, var(--primary-pink), var(--primary-purple));
    color: white;
}

.unmatch-btn {
    border: 1px solid var(--border-color);
}

/* Modal Styles */
.bottom-nav {
    position: fixed;
    bottom: 0px;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    backdrop-filter: blur(10px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: var(--muted-text);
    cursor: pointer;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 10px;
    text-align: center;
}

.modal-body p {
    font-size: 0.95rem;
    color: var(--muted-text);
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.5;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-pink);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    z-index: 1001;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(10px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Responsive sidebar-item fixes */
.match-sidebar-item.active {
    background: var(--card-bg-alt);
    border-left: 3px solid var(--primary-pink);
}

/* ===== NAVIGATION STYLES (Consolidated from navigation.php) ===== */
:root {
    --nav-height: 70px;
    --nav-bg: #121212;
    --nav-border: rgba(255, 255, 255, 0.1);
    --nav-active: #ff4d8d;
}

@media (max-width: 768px) {
    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: var(--nav-height) !important;
        background: var(--nav-bg) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-top: 1px solid var(--nav-border) !important;
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        align-items: center !important;
        z-index: 9999 !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.3) !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        border-radius: 20px 20px 0 0 !important;
    }

    /* Hide when specific class is added via PHP (e.g. in chat) */
    .bottom-nav.nav-hidden {
        display: none !important;
    }
}

/* Base Nav Items (Global for both Desktop & Mobile) */
.nav-item {
    text-decoration: none !important;
    color: var(--muted-text, #8a8a8e) !important;
    transition: all 0.2s ease !important;
}

.nav-item:hover {
    color: var(--nav-active, #ff4d8d) !important;
}

.nav-item.active {
    color: var(--nav-active, #ff4d8d) !important;
}

@media (max-width: 768px) {

    .nav-left,
    .nav-right {
        display: flex !important;
        justify-content: space-evenly !important;
        align-items: center !important;
        height: 100% !important;
    }

    .nav-center {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        z-index: 100 !important;
        width: 60px !important;
    }

    .nav-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        color: var(--muted-text, #8a8a8e) !important;
        transition: all 0.2s ease !important;
        min-width: 50px !important;
        height: 100% !important;
        position: relative !important;
    }

    .nav-item.active {
        color: var(--primary-pink) !important;
        background: transparent !important;
    }

    .nav-icon {
        font-size: 1.3rem !important;
        margin-bottom: 2px !important;
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .nav-label {
        font-size: 0.65rem !important;
        font-weight: 600 !important;
        letter-spacing: 0.2px !important;
    }

    /* Special style for center Discover button */
    .center-nav {
        background: linear-gradient(135deg, #4361ee, #9d4edd) !important;
        width: 54px !important;
        height: 54px !important;
        border-radius: 50% !important;
        color: white !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: absolute !important;
        bottom: 12px !important;
        box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4) !important;
        border: 4px solid #121212 !important;
    }

    .center-nav.active {
        background: linear-gradient(135deg, #3a56d4, #7b2cbf) !important;
        transform: scale(0.95) !important;
    }

    .center-nav .nav-icon {
        margin-bottom: 0 !important;
        font-size: 1.4rem !important;
    }

    .center-nav .nav-label {
        display: none !important;
    }

    /* Badges */
    .nav-badge {
        position: absolute !important;
        top: -4px !important;
        right: -6px !important;
        background: #ff3b30 !important;
        color: white !important;
        font-size: 0.6rem !important;
        min-width: 16px !important;
        height: 16px !important;
        border-radius: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: 700 !important;
        border: 2px solid #121212 !important;
        line-height: 1 !important;
        padding: 0 4px !important;
    }
}

/* Desktop Only Visibility */
.desktop-only {
    display: none !important;
}

@media (min-width: 769px) {
    .desktop-only {
        display: flex !important;
    }
}

/* ============================================================
   GLOBAL APP HEADER (Used on Dashboard, Hookup, Matches, Discover)
   Fixes massive white backgrounds on pages missing inline styles
   ============================================================ */
.app-header,
.discover-header {
    background: var(--card-bg, #1a1a1f);
    color: var(--light-text, #f5f5f7);
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #2a2a2e);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 100;
}

.logo {
    font-family: 'Kaffeesatz', cursive;
    font-size: 2.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -1px;
    flex: 1;
}

.logo-image {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 8px;
    background: #000;
}

.logo-text {
    background: linear-gradient(45deg, #ff4d8d, #9d4edd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff4d8d;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.logout-btn-header {
    color: #8a8a8e;
    font-size: 1.2rem;
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.logout-btn-header:hover {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
}

/* ===== TYPING INDICATORS (WEB & SIDEBAR) ===== */
.sidebar-typing-indicator {
    display: inline-flex;
    align-items: center;
}

.typing-text {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--primary-pink, #ff4d8d);
    margin-right: 4px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background-color: var(--primary-pink, #ff4d8d);
    border-radius: 50%;
    margin: 0 2px;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}