/*
Theme Name: PlatypusMatch
Theme URI: https://platypusmatch.com
Author: PlatypusMatch Team
Description: A secure, community-driven dating theme with mobile-first responsive design, women's safety features, and anti-bot protection.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: platypusmatch
Tags: dating, community, responsive-layout, accessibility-ready
*/

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    /* Brand Colors */
    --pm-primary: #6C63FF;
    --pm-primary-dark: #5A52D5;
    --pm-primary-light: #8B85FF;
    --pm-secondary: #FF6584;
    --pm-secondary-dark: #E55070;
    --pm-accent: #00D2FF;

    /* Neutrals */
    --pm-white: #FFFFFF;
    --pm-bg: #F7F8FC;
    --pm-bg-card: #FFFFFF;
    --pm-border: #E2E8F0;
    --pm-text: #2D3748;
    --pm-text-light: #718096;
    --pm-text-muted: #A0AEC0;

    /* Status */
    --pm-success: #48BB78;
    --pm-warning: #ECC94B;
    --pm-danger: #F56565;
    --pm-info: #4299E1;

    /* Safety indicator */
    --pm-safe: #48BB78;
    --pm-verified: #6C63FF;

    /* Spacing */
    --pm-space-xs: 0.25rem;
    --pm-space-sm: 0.5rem;
    --pm-space-md: 1rem;
    --pm-space-lg: 1.5rem;
    --pm-space-xl: 2rem;
    --pm-space-2xl: 3rem;
    --pm-space-3xl: 4rem;

    /* Typography */
    --pm-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pm-font-heading: 'Poppins', var(--pm-font-body);
    --pm-font-size-xs: 0.75rem;
    --pm-font-size-sm: 0.875rem;
    --pm-font-size-base: 1rem;
    --pm-font-size-lg: 1.125rem;
    --pm-font-size-xl: 1.25rem;
    --pm-font-size-2xl: 1.5rem;
    --pm-font-size-3xl: 1.875rem;
    --pm-font-size-4xl: 2.25rem;

    /* Borders & Radius */
    --pm-radius-sm: 0.375rem;
    --pm-radius-md: 0.5rem;
    --pm-radius-lg: 0.75rem;
    --pm-radius-xl: 1rem;
    --pm-radius-full: 9999px;

    /* Shadows */
    --pm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --pm-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --pm-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --pm-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);

    /* Layout */
    --pm-max-width: 1200px;
    --pm-sidebar-width: 280px;
    --pm-header-height: 64px;
    --pm-mobile-nav-height: 60px;

    /* Transitions */
    --pm-transition: 0.2s ease-in-out;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--pm-font-body);
    font-size: var(--pm-font-size-base);
    line-height: 1.6;
    color: var(--pm-text);
    background-color: var(--pm-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--pm-primary);
    text-decoration: none;
    transition: color var(--pm-transition);
}
a:hover { color: var(--pm-primary-dark); }
a:focus-visible {
    outline: 2px solid var(--pm-primary);
    outline-offset: 2px;
    border-radius: var(--pm-radius-sm);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--pm-font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--pm-text);
}
h1 { font-size: var(--pm-font-size-4xl); }
h2 { font-size: var(--pm-font-size-3xl); }
h3 { font-size: var(--pm-font-size-2xl); }
h4 { font-size: var(--pm-font-size-xl); }

/* ============================================
   UTILITY CLASSES
   ============================================ */
.pm-container {
    width: 100%;
    max-width: var(--pm-max-width);
    margin: 0 auto;
    padding: 0 var(--pm-space-md);
}

.pm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pm-flex { display: flex; }
.pm-flex-col { flex-direction: column; }
.pm-items-center { align-items: center; }
.pm-justify-between { justify-content: space-between; }
.pm-gap-sm { gap: var(--pm-space-sm); }
.pm-gap-md { gap: var(--pm-space-md); }
.pm-gap-lg { gap: var(--pm-space-lg); }

.pm-text-center { text-align: center; }
.pm-text-muted { color: var(--pm-text-muted); }

/* ============================================
   BUTTONS
   ============================================ */
.pm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--pm-space-sm);
    padding: 0.625rem 1.25rem;
    font-family: var(--pm-font-body);
    font-size: var(--pm-font-size-sm);
    font-weight: 500;
    line-height: 1;
    border: 2px solid transparent;
    border-radius: var(--pm-radius-md);
    cursor: pointer;
    transition: all var(--pm-transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* Touch target */
    min-width: 44px;
}
.pm-btn:focus-visible {
    outline: 2px solid var(--pm-primary);
    outline-offset: 2px;
}

.pm-btn-primary {
    background: var(--pm-primary);
    color: var(--pm-white);
}
.pm-btn-primary:hover {
    background: var(--pm-primary-dark);
    color: var(--pm-white);
    transform: translateY(-1px);
    box-shadow: var(--pm-shadow-md);
}

.pm-btn-secondary {
    background: var(--pm-secondary);
    color: var(--pm-white);
}
.pm-btn-secondary:hover {
    background: var(--pm-secondary-dark);
    color: var(--pm-white);
}

.pm-btn-outline {
    background: transparent;
    color: var(--pm-primary);
    border-color: var(--pm-primary);
}
.pm-btn-outline:hover {
    background: var(--pm-primary);
    color: var(--pm-white);
}

.pm-btn-danger {
    background: var(--pm-danger);
    color: var(--pm-white);
}
.pm-btn-danger:hover {
    background: #E53E3E;
    color: var(--pm-white);
}

.pm-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--pm-font-size-xs);
    min-height: 36px;
}

.pm-btn-lg {
    padding: 0.875rem 2rem;
    font-size: var(--pm-font-size-lg);
}

.pm-btn-block {
    display: flex;
    width: 100%;
}

.pm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   FORMS
   ============================================ */
.pm-form-group {
    margin-bottom: var(--pm-space-lg);
}

.pm-form-label {
    display: block;
    margin-bottom: var(--pm-space-xs);
    font-size: var(--pm-font-size-sm);
    font-weight: 500;
    color: var(--pm-text);
}

.pm-form-input,
.pm-form-textarea,
.pm-form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: var(--pm-font-body);
    font-size: var(--pm-font-size-base);
    color: var(--pm-text);
    background: var(--pm-white);
    border: 2px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    transition: border-color var(--pm-transition), box-shadow var(--pm-transition);
    min-height: 44px;
    -webkit-appearance: none;
}
.pm-form-input:focus,
.pm-form-textarea:focus,
.pm-form-select:focus {
    outline: none;
    border-color: var(--pm-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.pm-form-input.error,
.pm-form-textarea.error {
    border-color: var(--pm-danger);
}

.pm-form-error {
    color: var(--pm-danger);
    font-size: var(--pm-font-size-xs);
    margin-top: var(--pm-space-xs);
}

.pm-form-help {
    color: var(--pm-text-muted);
    font-size: var(--pm-font-size-xs);
    margin-top: var(--pm-space-xs);
}

.pm-form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* ============================================
   CARDS
   ============================================ */
.pm-card {
    background: var(--pm-bg-card);
    border-radius: var(--pm-radius-lg);
    box-shadow: var(--pm-shadow-sm);
    border: 1px solid var(--pm-border);
    overflow: hidden;
    transition: box-shadow var(--pm-transition), transform var(--pm-transition);
}
.pm-card:hover {
    box-shadow: var(--pm-shadow-md);
}

.pm-card-body {
    padding: var(--pm-space-lg);
}

.pm-card-header {
    padding: var(--pm-space-lg);
    border-bottom: 1px solid var(--pm-border);
}

.pm-card-footer {
    padding: var(--pm-space-md) var(--pm-space-lg);
    border-top: 1px solid var(--pm-border);
    background: var(--pm-bg);
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.pm-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--pm-white);
    border-bottom: 1px solid var(--pm-border);
    height: var(--pm-header-height);
    box-shadow: var(--pm-shadow-sm);
}

.pm-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--pm-max-width);
    margin: 0 auto;
    padding: 0 var(--pm-space-md);
}

.pm-logo {
    display: flex;
    align-items: center;
    gap: var(--pm-space-sm);
    font-family: var(--pm-font-heading);
    font-size: var(--pm-font-size-xl);
    font-weight: 700;
    color: var(--pm-primary);
    text-decoration: none;
}
.pm-logo:hover { color: var(--pm-primary); }

.pm-logo-icon {
    width: 36px;
    height: 36px;
}

.pm-nav-desktop {
    display: none;
    align-items: center;
    gap: var(--pm-space-lg);
    list-style: none;
}

.pm-nav-desktop a {
    color: var(--pm-text-light);
    font-size: var(--pm-font-size-sm);
    font-weight: 500;
    padding: var(--pm-space-sm) 0;
    position: relative;
    transition: color var(--pm-transition);
}
.pm-nav-desktop a:hover,
.pm-nav-desktop a.active {
    color: var(--pm-primary);
}
.pm-nav-desktop a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--pm-primary);
    border-radius: 1px;
}

.pm-header-actions {
    display: flex;
    align-items: center;
    gap: var(--pm-space-sm);
}

.pm-notification-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--pm-space-sm);
    color: var(--pm-text-light);
    border-radius: var(--pm-radius-full);
    transition: background var(--pm-transition);
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pm-notification-btn:hover {
    background: var(--pm-bg);
}

.pm-notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: var(--pm-danger);
    color: var(--pm-white);
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--pm-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--pm-white);
}

.pm-avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--pm-radius-full);
    overflow: hidden;
    border: 2px solid var(--pm-border);
    cursor: pointer;
    transition: border-color var(--pm-transition);
    background: none;
    padding: 0;
}
.pm-avatar-btn:hover {
    border-color: var(--pm-primary);
}
.pm-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile hamburger */
.pm-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--pm-space-sm);
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}
.pm-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--pm-text);
    border-radius: 1px;
    transition: all var(--pm-transition);
}
.pm-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.pm-hamburger.active span:nth-child(2) {
    opacity: 0;
}
.pm-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile navigation overlay */
.pm-mobile-nav {
    display: none;
    position: fixed;
    top: var(--pm-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--pm-white);
    z-index: 999;
    overflow-y: auto;
    padding: var(--pm-space-lg);
    animation: slideDown 0.2s ease-out;
}
.pm-mobile-nav.open {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pm-mobile-nav ul {
    list-style: none;
}

.pm-mobile-nav a {
    display: flex;
    align-items: center;
    gap: var(--pm-space-md);
    padding: var(--pm-space-md) 0;
    font-size: var(--pm-font-size-lg);
    color: var(--pm-text);
    border-bottom: 1px solid var(--pm-border);
}
.pm-mobile-nav a:hover,
.pm-mobile-nav a.active {
    color: var(--pm-primary);
}

/* ============================================
   MOBILE BOTTOM TAB BAR
   ============================================ */
.pm-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--pm-white);
    border-top: 1px solid var(--pm-border);
    height: var(--pm-mobile-nav-height);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.pm-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--pm-text-muted);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    min-height: 44px;
    transition: color var(--pm-transition);
    position: relative;
}
.pm-bottom-nav a:hover,
.pm-bottom-nav a.active {
    color: var(--pm-primary);
}
.pm-bottom-nav a .icon {
    font-size: 20px;
}

/* ============================================
   PROFILE CARDS GRID
   ============================================ */
.pm-profiles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--pm-space-lg);
    padding: var(--pm-space-lg) 0;
}

.pm-profile-card {
    position: relative;
    border-radius: var(--pm-radius-xl);
    overflow: hidden;
    background: var(--pm-white);
    box-shadow: var(--pm-shadow-md);
    transition: transform var(--pm-transition), box-shadow var(--pm-transition);
}
.pm-profile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--pm-shadow-lg);
}

.pm-profile-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
}
.pm-profile-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pm-profile-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--pm-space-xl) var(--pm-space-lg) var(--pm-space-lg);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: var(--pm-white);
}

.pm-profile-card-name {
    font-size: var(--pm-font-size-xl);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--pm-space-sm);
}

.pm-verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--pm-verified);
    color: var(--pm-white);
    border-radius: var(--pm-radius-full);
    font-size: 11px;
}

.pm-profile-card-info {
    font-size: var(--pm-font-size-sm);
    opacity: 0.9;
    margin-top: var(--pm-space-xs);
}

.pm-profile-card-interests {
    display: flex;
    flex-wrap: wrap;
    gap: var(--pm-space-xs);
    margin-top: var(--pm-space-sm);
}

.pm-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: var(--pm-radius-full);
    font-size: var(--pm-font-size-xs);
    font-weight: 500;
    color: var(--pm-white);
}

.pm-tag-solid {
    background: var(--pm-bg);
    color: var(--pm-text-light);
}

.pm-profile-card-actions {
    display: flex;
    justify-content: center;
    gap: var(--pm-space-md);
    padding: var(--pm-space-md);
}

.pm-action-btn {
    width: 52px;
    height: 52px;
    border-radius: var(--pm-radius-full);
    border: 2px solid var(--pm-border);
    background: var(--pm-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all var(--pm-transition);
}
.pm-action-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--pm-shadow-md);
}
.pm-action-btn.like {
    border-color: var(--pm-secondary);
    color: var(--pm-secondary);
}
.pm-action-btn.like:hover {
    background: var(--pm-secondary);
    color: var(--pm-white);
}

/* ============================================
   COMMUNITY / TOPICS
   ============================================ */
.pm-topics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--pm-space-md);
    padding: var(--pm-space-lg) 0;
}

.pm-topic-card {
    background: var(--pm-white);
    border-radius: var(--pm-radius-lg);
    padding: var(--pm-space-lg);
    text-align: center;
    border: 2px solid var(--pm-border);
    transition: all var(--pm-transition);
    cursor: pointer;
}
.pm-topic-card:hover {
    border-color: var(--pm-primary);
    transform: translateY(-2px);
    box-shadow: var(--pm-shadow-md);
}
.pm-topic-card.active {
    border-color: var(--pm-primary);
    background: rgba(108, 99, 255, 0.05);
}

.pm-topic-icon {
    font-size: 2rem;
    margin-bottom: var(--pm-space-sm);
}

.pm-topic-name {
    font-size: var(--pm-font-size-sm);
    font-weight: 600;
}

.pm-topic-count {
    font-size: var(--pm-font-size-xs);
    color: var(--pm-text-muted);
}

/* ============================================
   SAFETY FEATURES
   ============================================ */
.pm-safety-shield {
    display: inline-flex;
    align-items: center;
    gap: var(--pm-space-xs);
    padding: var(--pm-space-xs) var(--pm-space-sm);
    background: rgba(72, 187, 120, 0.1);
    color: var(--pm-safe);
    border-radius: var(--pm-radius-full);
    font-size: var(--pm-font-size-xs);
    font-weight: 600;
}

.pm-report-btn {
    background: none;
    border: none;
    color: var(--pm-text-muted);
    cursor: pointer;
    font-size: var(--pm-font-size-sm);
    padding: var(--pm-space-sm);
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: var(--pm-space-xs);
    transition: color var(--pm-transition);
}
.pm-report-btn:hover {
    color: var(--pm-danger);
}

.pm-block-btn {
    color: var(--pm-danger);
    font-weight: 500;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.pm-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--pm-space-lg);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pm-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--pm-white);
    border-radius: var(--pm-radius-xl);
    padding: var(--pm-space-2xl);
    box-shadow: var(--pm-shadow-xl);
}

.pm-auth-header {
    text-align: center;
    margin-bottom: var(--pm-space-2xl);
}

.pm-auth-header h1 {
    font-size: var(--pm-font-size-2xl);
    margin-top: var(--pm-space-md);
}

.pm-auth-header p {
    color: var(--pm-text-muted);
    font-size: var(--pm-font-size-sm);
    margin-top: var(--pm-space-xs);
}

.pm-password-strength {
    height: 4px;
    border-radius: 2px;
    background: var(--pm-border);
    margin-top: var(--pm-space-xs);
    overflow: hidden;
}
.pm-password-strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}
.pm-password-strength-bar.weak { width: 25%; background: var(--pm-danger); }
.pm-password-strength-bar.fair { width: 50%; background: var(--pm-warning); }
.pm-password-strength-bar.good { width: 75%; background: var(--pm-info); }
.pm-password-strength-bar.strong { width: 100%; background: var(--pm-success); }

.pm-divider {
    display: flex;
    align-items: center;
    gap: var(--pm-space-md);
    margin: var(--pm-space-lg) 0;
    color: var(--pm-text-muted);
    font-size: var(--pm-font-size-sm);
}
.pm-divider::before,
.pm-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--pm-border);
}

/* ============================================
   MESSAGING
   ============================================ */
.pm-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--pm-header-height) - var(--pm-mobile-nav-height));
}

.pm-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--pm-space-md);
    display: flex;
    flex-direction: column;
    gap: var(--pm-space-sm);
}

.pm-message {
    max-width: 80%;
    padding: var(--pm-space-sm) var(--pm-space-md);
    border-radius: var(--pm-radius-lg);
    font-size: var(--pm-font-size-sm);
    line-height: 1.5;
}
.pm-message.sent {
    align-self: flex-end;
    background: var(--pm-primary);
    color: var(--pm-white);
    border-bottom-right-radius: var(--pm-space-xs);
}
.pm-message.received {
    align-self: flex-start;
    background: var(--pm-bg);
    color: var(--pm-text);
    border-bottom-left-radius: var(--pm-space-xs);
}

.pm-chat-input {
    display: flex;
    align-items: center;
    gap: var(--pm-space-sm);
    padding: var(--pm-space-md);
    background: var(--pm-white);
    border-top: 1px solid var(--pm-border);
}

.pm-chat-input input {
    flex: 1;
}

/* ============================================
   USER DATA CONTROL PANEL
   ============================================ */
.pm-data-control {
    background: var(--pm-white);
    border-radius: var(--pm-radius-lg);
    border: 1px solid var(--pm-border);
    overflow: hidden;
}

.pm-data-control-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--pm-space-md) var(--pm-space-lg);
    border-bottom: 1px solid var(--pm-border);
}
.pm-data-control-item:last-child {
    border-bottom: none;
}

.pm-data-control-info h4 {
    font-size: var(--pm-font-size-sm);
    font-weight: 600;
}
.pm-data-control-info p {
    font-size: var(--pm-font-size-xs);
    color: var(--pm-text-muted);
    margin-top: 2px;
}

/* Toggle switch */
.pm-toggle {
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}
.pm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.pm-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--pm-border);
    border-radius: 14px;
    cursor: pointer;
    transition: background var(--pm-transition);
}
.pm-toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    background: var(--pm-white);
    border-radius: 50%;
    transition: transform var(--pm-transition);
    box-shadow: var(--pm-shadow-sm);
}
.pm-toggle input:checked + .pm-toggle-slider {
    background: var(--pm-primary);
}
.pm-toggle input:checked + .pm-toggle-slider::before {
    transform: translateX(20px);
}

/* ============================================
   ALERTS / NOTIFICATIONS
   ============================================ */
.pm-alert {
    padding: var(--pm-space-md) var(--pm-space-lg);
    border-radius: var(--pm-radius-md);
    font-size: var(--pm-font-size-sm);
    display: flex;
    align-items: start;
    gap: var(--pm-space-sm);
    margin-bottom: var(--pm-space-md);
}
.pm-alert-success { background: #F0FFF4; color: #276749; border: 1px solid #C6F6D5; }
.pm-alert-error { background: #FFF5F5; color: #9B2C2C; border: 1px solid #FED7D7; }
.pm-alert-warning { background: #FFFFF0; color: #975A16; border: 1px solid #FEFCBF; }
.pm-alert-info { background: #EBF8FF; color: #2A4365; border: 1px solid #BEE3F8; }

/* ============================================
   MODAL
   ============================================ */
.pm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: var(--pm-space-md);
    animation: fadeIn 0.2s;
}
.pm-modal-overlay.open {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pm-modal {
    background: var(--pm-white);
    border-radius: var(--pm-radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.pm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--pm-space-lg);
    border-bottom: 1px solid var(--pm-border);
}

.pm-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--pm-text-muted);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--pm-radius-full);
    transition: background var(--pm-transition);
}
.pm-modal-close:hover {
    background: var(--pm-bg);
}

.pm-modal-body {
    padding: var(--pm-space-lg);
}

.pm-modal-footer {
    padding: var(--pm-space-md) var(--pm-space-lg);
    border-top: 1px solid var(--pm-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--pm-space-sm);
}

/* ============================================
   LOADING / SKELETON
   ============================================ */
.pm-skeleton {
    background: linear-gradient(90deg, var(--pm-border) 25%, #f0f0f0 50%, var(--pm-border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--pm-radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pm-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--pm-border);
    border-top-color: var(--pm-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   FOOTER
   ============================================ */
.pm-footer {
    background: var(--pm-white);
    border-top: 1px solid var(--pm-border);
    padding: var(--pm-space-2xl) 0;
    margin-bottom: var(--pm-mobile-nav-height); /* Space for bottom nav on mobile */
}

.pm-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--pm-space-xl);
}

.pm-footer-section h4 {
    font-size: var(--pm-font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pm-text-muted);
    margin-bottom: var(--pm-space-md);
}

.pm-footer-links {
    list-style: none;
}
.pm-footer-links a {
    color: var(--pm-text-light);
    font-size: var(--pm-font-size-sm);
    padding: var(--pm-space-xs) 0;
    display: block;
}
.pm-footer-links a:hover {
    color: var(--pm-primary);
}

.pm-footer-bottom {
    margin-top: var(--pm-space-xl);
    padding-top: var(--pm-space-lg);
    border-top: 1px solid var(--pm-border);
    text-align: center;
    font-size: var(--pm-font-size-xs);
    color: var(--pm-text-muted);
}

/* ============================================
   RESPONSIVE: TABLET (≥ 640px)
   ============================================ */
@media (min-width: 640px) {
    .pm-profiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pm-topics-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pm-footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   RESPONSIVE: DESKTOP (≥ 1024px)
   ============================================ */
@media (min-width: 1024px) {
    .pm-hamburger {
        display: none;
    }

    .pm-nav-desktop {
        display: flex;
    }

    .pm-bottom-nav {
        display: none;
    }

    .pm-footer {
        margin-bottom: 0;
    }

    .pm-profiles-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pm-topics-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .pm-footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    .pm-chat-container {
        height: calc(100vh - var(--pm-header-height));
    }

    .pm-message {
        max-width: 60%;
    }
}

/* ============================================
   RESPONSIVE: LARGE DESKTOP (≥ 1280px)
   ============================================ */
@media (min-width: 1280px) {
    .pm-profiles-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .pm-topics-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ============================================
   DARK MODE (respects system preference)
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --pm-bg: #1A202C;
        --pm-bg-card: #2D3748;
        --pm-border: #4A5568;
        --pm-text: #E2E8F0;
        --pm-text-light: #A0AEC0;
        --pm-text-muted: #718096;
        --pm-white: #2D3748;
    }

    .pm-header,
    .pm-bottom-nav,
    .pm-footer {
        background: #2D3748;
    }

    .pm-form-input,
    .pm-form-textarea,
    .pm-form-select {
        background: #4A5568;
        color: #E2E8F0;
    }

    .pm-auth-card {
        background: #2D3748;
    }

    .pm-modal {
        background: #2D3748;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .pm-header,
    .pm-bottom-nav,
    .pm-footer,
    .pm-chat-input,
    .pm-action-btn,
    .pm-hamburger,
    .pm-notification-btn {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}

/* ============================================
   ACCESSIBILITY: REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
