/* ============================================
   VILLAGE COMMUNITY PLATFORM - INTEGRATED CSS
   ============================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Custom Properties - Enhanced Color System */
:root {
    /* Core Colors */
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #10b981;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Extended Colors for Enhanced Features */
    --primary-light: rgba(139, 92, 246, 0.1);
    --secondary-light: rgba(16, 185, 129, 0.1);
    --success-light: rgba(16, 185, 129, 0.1);
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger-light: rgba(239, 68, 68, 0.1);
    
    /* Chat and Messaging */
    --border-radius-chat: 18px;
    --primary-shadow: rgba(139, 92, 246, 0.25);
    --bg-color-contrast: #e9ecef;
    
    /* Shadows */
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* Base Typography and Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

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

.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-top: 2rem;
}

/* ============================================
   NAVIGATION SYSTEM
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 180px;
    display: none;
    z-index: 1001;
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-top: 0.5rem;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 0;
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    padding-left: 1.5rem;
}

.dropdown-item::after {
    display: none;
}

/* ============================================
   BUTTON SYSTEM
   ============================================ */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   LANDING PAGE
   ============================================ */

.hero {
    padding: 150px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    animation: float 20s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 0.8s ease-out;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
}

.feature-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
    animation-delay: calc(var(--i) * 0.1s);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ============================================
   DASHBOARD
   ============================================ */

.dashboard {
    display: none;
    padding-top: 100px;
    min-height: 100vh;
}

.dashboard-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 3rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.dashboard-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 15s infinite ease-in-out reverse;
}

.village-counter {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.village-count {
    font-size: 4rem;
    font-weight: 800;
    animation: countUp 1s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Village Visualization */
.village-visualization {
    position: relative;
    height: 300px;
    margin: 2rem 0;
    background: var(--primary-light);
    border-radius: 20px;
    overflow: hidden;
}

.village-node {
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.village-node:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.5);
}

.village-connection {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    transform-origin: left center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ============================================
   FORM SYSTEM
   ============================================ */

.post-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.post-form:focus-within {
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15);
}

.post-type {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.post-type label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.post-type input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    transform: translateY(-1px);
}

select.form-control {
    cursor: pointer;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.char-counter {
    display: block;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ============================================
   POST SYSTEM
   ============================================ */

.post, .post-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.post:hover, .post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.post-header, .post-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.avatar, .post-card-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
    transition: var(--transition);
}

.post-card-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 1rem;
    margin-right: 0.75rem;
}

.avatar:hover {
    transform: rotate(360deg);
}

.post-card-author {
    font-weight: 600;
    color: var(--text);
    flex-grow: 1;
}

.post-card-tag {
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.offer-tag {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.request-tag {
    background-color: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.post-card-body h3 {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.post-card-body p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-card-footer {
    text-align: right;
}

.post-actions {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.post-action:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.post-action.liked {
    color: var(--danger);
}

.post-card-placeholder {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    background-color: var(--card-bg);
    border-radius: 12px;
    font-style: italic;
}

/* ============================================
   SIDEBAR SYSTEM
   ============================================ */

.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar > div {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.membership-banner {
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.membership-banner h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.membership-banner p {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.village-members {
    max-height: 400px;
    overflow-y: auto;
}

.village-members h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.member {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.member:hover {
    background: var(--primary-light);
    transform: translateX(5px);
}

/* ============================================
   LEARNING & CHILDCARE SECTIONS
   ============================================ */

.page-section .page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 1rem;
    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.page-section .page-header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.page-section .page-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.learning-section, .childcare-section {
    margin-bottom: 3rem;
}

.learning-section h2, .childcare-section h2 {
    font-size: 1.8rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.feed-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ============================================
   MESSAGING SYSTEM
   ============================================ */

.messaging-container {
    display: flex;
    height: calc(100vh - 120px);
    background-color: var(--bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.messaging-sidebar {
    width: 300px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
}

.messaging-sidebar .sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.messaging-sidebar .sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text);
}

.conversation-list {
    overflow-y: auto;
    flex-grow: 1;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

.conversation-item:hover {
    background-color: rgba(139, 92, 246, 0.05);
}

.conversation-item.active-conversation {
    background-color: var(--primary-light);
    border-right: 3px solid var(--primary);
}

.conversation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-light);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.conversation-details {
    flex-grow: 1;
    overflow: hidden;
}

.conversation-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

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

.conversation-meta {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.conversation-timestamp {
    margin-bottom: 0.25rem;
}

.unread-indicator {
    background-color: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

.no-conversations {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* Chat Window */
.messaging-chat-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
}

.chat-window-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background-color: var(--card-bg);
}

.chat-window-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text);
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.no-messages-placeholder {
    text-align: center;
    margin: auto;
    color: var(--text-muted);
    font-style: italic;
}

.message {
    display: flex;
    margin-bottom: 0.75rem;
    max-width: 70%;
    transition: var(--transition);
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--secondary-light);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 0.5rem;
    font-size: 0.9rem;
    flex-shrink: 0;
    align-self: flex-end;
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-sender-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.message-bubble {
    padding: 0.6rem 0.9rem;
    border-radius: var(--border-radius-chat);
    line-height: 1.5;
    font-size: 0.9rem;
    word-wrap: break-word;
}

.message-timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.message-sent {
    align-self: flex-end;
    margin-left: auto;
}

.message-sent .message-bubble {
    background-color: var(--primary);
    color: white;
}

.message-sent .message-timestamp {
    text-align: right;
}

.message-received {
    align-self: flex-start;
    margin-right: auto;
}

.message-received .message-bubble {
    background-color: var(--bg-color-contrast);
    color: var(--text);
    border: 1px solid var(--border);
}

.message-received .message-content .message-timestamp {
    text-align: left;
}

.message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Chat Input */
.chat-input-area {
    display: flex;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background-color: var(--card-bg);
    align-items: center;
}

.chat-input-area textarea {
    flex-grow: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-right: 0.75rem;
    overflow-y: auto;
    font-family: inherit;
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem var(--primary-shadow);
}

.chat-input-area .btn {
    padding: 0.6rem 1rem;
    min-height: 40px;
}

/* ============================================
   PROFILE SYSTEM
   ============================================ */

.profile-container {
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 120px;
}

.profile-header {
    animation: fadeInUp 0.6s ease-out;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-avatar-lg {
    position: relative;
}

.profile-avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
    transition: var(--transition);
}

.profile-avatar-img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.3);
}

.online-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: var(--success);
    border-radius: 50%;
    border: 3px solid white;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

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

.profile-name-section {
    margin-bottom: 1rem;
}

.profile-bio {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: 12px;
    font-style: italic;
    color: var(--text-muted);
    border-left: 4px solid var(--primary);
}

.profile-skills {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 0.25rem 0.25rem 0 0;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.profile-achievements {
    margin: 1rem 0;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.achievement-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; transform: scale(1.02); }
}

.profile-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.profile-stats-sidebar {
    min-width: 200px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.verification-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.verification-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--success-light);
    color: var(--success);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.profile-tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.profile-tab:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.profile-tab.active-tab {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
}

.profile-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.profile-tab-content.active-tab-content {
    display: block;
}

.profile-feed .placeholder-text {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    background: var(--primary-light);
    border-radius: 16px;
    border: 2px dashed var(--border);
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.tab-header h2 {
    margin: 0;
    color: var(--text);
}

.learning-subsection, .childcare-subsection {
    margin-bottom: 2rem;
}

.learning-subsection h3, .childcare-subsection h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Overview Section */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.overview-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.overview-section h3 {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1.1rem;
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--primary-light);
    border-radius: 8px;
    transition: var(--transition);
}

.activity-item:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateX(3px);
}

.activity-icon {
    color: var(--primary);
    font-size: 1.1rem;
}

.activity-item span {
    flex: 1;
    color: var(--text);
    font-size: 0.9rem;
}

.activity-item small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.quick-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
}

.quick-stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.quick-stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Settings */
.settings-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.settings-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text);
    font-size: 1.1rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item:hover {
    background: rgba(139, 92, 246, 0.02);
}

.setting-info {
    flex: 1;
}

.setting-info strong {
    display: block;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.setting-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    background: var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch.active::after {
    transform: translateX(22px);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: var(--transition);
}

.checkbox-label:hover {
    color: var(--primary);
}

.privacy-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ============================================
   MODAL SYSTEM
   ============================================ */

.auth-modal, .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.auth-modal.show, .modal-overlay.show {
    display: flex;
}

.auth-form, .modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInScale 0.3s ease-out;
    position: relative;
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
    transform: rotate(90deg);
}

/* Enhanced Modal Post Type Selection */
.auth-modal .post-type {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.auth-modal .post-type label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    flex: 1;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.auth-modal .post-type input[type="radio"] {
    display: none;
}

.auth-modal .post-type input[type="radio"]:checked + span {
    color: var(--primary);
    font-weight: bold;
}

.auth-modal .post-type label:has(input[type="radio"]:checked) {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

/* Photo Upload Styles */
.photo-upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.02);
    transition: var(--transition);
}

.photo-upload-section:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.photo-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
    transition: var(--transition);
}

.photo-upload-buttons {
    display: flex;
    gap: 0.5rem;
}

.photo-upload-area {
    position: relative;
    transition: all 0.3s ease;
}

.photo-upload-area:hover #profilePreview {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.3);
}

#profilePreview {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* ============================================
   CUSTOMIZATION SYSTEM
   ============================================ */

.village-customizer {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    margin-top: 2rem;
}

.customizer-section {
    margin-bottom: 1.5rem;
}

.customizer-section h5 {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.color-option {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.color-option:hover {
    transform: scale(1.15) rotate(3deg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.color-option.active {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px var(--primary), 0 4px 20px rgba(0, 0, 0, 0.2);
}

.color-option .theme-name {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.effect-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.effect-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.effect-toggle:hover {
    background: var(--primary-light);
}

.effect-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.layout-options {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.layout-option {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--border);
}

.layout-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.layout-option.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.layout-preview {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    color: var(--primary);
}

/* ============================================
   THEME VARIATIONS
   ============================================ */

/* Warm Theme */
body.theme-warm {
    --primary: #ff6b6b;
    --primary-dark: #fa5252;
    --secondary: #feca57;
}

/* Cool Theme */
body.theme-cool {
    --primary: #4ecdc4;
    --primary-dark: #38bdb6;
    --secondary: #45b7d1;
}

/* Ocean Theme */
body.theme-ocean {
    --primary: #45b7d1;
    --primary-dark: #3498db;
    --secondary: #2980b9;
}

/* Nature Theme */
body.theme-nature {
    --primary: #96ceb4;
    --primary-dark: #88c999;
    --secondary: #dcedc8;
}

/* Sunset Theme */
body.theme-sunset {
    --primary: #feca57;
    --primary-dark: #ff9ff3;
    --secondary: #ff6b6b;
}

/* Twilight Theme */
body.theme-twilight {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --secondary: #a389d4;
    --bg: #fafafe;
    --card-bg: #ffffff;
}

/* Festival Theme */
body.theme-festival {
    --primary: #f093fb;
    --primary-dark: #f5576c;
    --secondary: #fa709a;
}

/* Coastal Theme */
body.theme-coastal {
    --primary: #4facfe;
    --primary-dark: #00f2fe;
    --secondary: #43e97b;
}

/* Sunrise Theme */
body.theme-sunrise {
    --primary: #fa709a;
    --primary-dark: #fee140;
    --secondary: #feca57;
}

/* Aurora Theme */
body.theme-aurora {
    --primary: #30cfd0;
    --primary-dark: #330867;
    --secondary: #5f72bd;
    --bg: #f0f3f7;
}

/* Pastel Theme */
body.theme-pastel {
    --primary: #a8edea;
    --primary-dark: #fed6e3;
    --secondary: #ffd3e1;
    --text: #5a5a5a;
}

/* Lavender Theme */
body.theme-lavender {
    --primary: #d299c2;
    --primary-dark: #cd84b5;
    --secondary: #fef9d7;
}

/* Tropical Theme */
body.theme-tropical {
    --primary: #fdbb2d;
    --primary-dark: #22c1c3;
    --secondary: #1abc9c;
}

/* Cherry Theme */
body.theme-cherry {
    --primary: #ff9a9e;
    --primary-dark: #fecfef;
    --secondary: #fecfef;
}

/* Winter Theme */
body.theme-winter {
    --primary: #a1c4fd;
    --primary-dark: #c2e9fb;
    --secondary: #d1e7ff;
    --bg: #f8fafe;
}

/* Harvest Theme */
body.theme-harvest {
    --primary: #fddb92;
    --primary-dark: #feca57;
    --secondary: #f6d365;
}

/* Mystic Theme */
body.theme-mystic {
    --primary: #6a11cb;
    --primary-dark: #2575fc;
    --secondary: #4c63d2;
    --bg: #f5f7fa;
}

/* Enchanted Theme */
body.theme-enchanted {
    --primary: #c471f5;
    --primary-dark: #fa71cd;
    --secondary: #f5a9e1;
}

/* Emerald Theme */
body.theme-emerald {
    --primary: #0ba360;
    --primary-dark: #3cba92;
    --secondary: #2ecc71;
}

/* Nebula Theme */
body.theme-nebula {
    --primary: #fc466b;
    --primary-dark: #3f5efb;
    --secondary: #8b5cf6;
}

/* Rustic Theme */
body.theme-rustic {
    --primary: #8b7355;
    --primary-dark: #d4a574;
    --secondary: #c19a6b;
    --bg: #faf8f5;
}

/* Meadow Theme */
body.theme-meadow {
    --primary: #649173;
    --primary-dark: #a8e890;
    --secondary: #81c784;
}

/* Royal Theme */
body.theme-royal {
    --primary: #764ba2;
    --primary-dark: #f1c40f;
    --secondary: #9b59b6;
}

/* Rose Theme */
body.theme-rose {
    --primary: #ee9ca7;
    --primary-dark: #ffdde1;
    --secondary: #ffb6c1;
    --bg: #fffafe;
}

/* ============================================
   SPECIAL EFFECTS
   ============================================ */

/* Particle Effect */
body.effects-particles {
    position: relative;
}

body.effects-particles::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: floatUp 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes floatUp {
    from { transform: translateY(100vh); }
    to { transform: translateY(-100vh); }
}

/* Glow Effect */
body.effects-glow .avatar,
body.effects-glow .btn-primary,
body.effects-glow .village-node {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* ============================================
   LAYOUT VARIATIONS
   ============================================ */

/* Spacious Layout */
body.layout-spacious .container {
    max-width: 1400px;
}

body.layout-spacious .post-form,
body.layout-spacious .post {
    padding: 3rem;
}

/* Compact Layout */
body.layout-compact .container {
    max-width: 1000px;
}

body.layout-compact .post-form,
body.layout-compact .post {
    padding: 1.5rem;
}

/* ============================================
   INTERACTIVE ELEMENTS
   ============================================ */

.interactive-badge {
    display: inline-block;
    background: var(--warning);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

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

.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
}

.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    cursor: pointer;
    transition: var(--transition);
    z-index: 100;
    border: none;
    outline: none;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.5);
}

/* ============================================
   NOTIFICATION SYSTEM
   ============================================ */

.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    max-width: 300px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1100;
}

.notification.show {
    transform: translateX(0);
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.notification-icon {
    width: 30px;
    height: 30px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* ============================================
   FOOTER
   ============================================ */

footer {
    background: var(--card-bg);
    padding: 3rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
}

/* ============================================
   KEY ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .profile-actions {
        justify-content: center;
        flex-direction: column;
        align-items: stretch;
    }
    
    .profile-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal-content, .auth-form {
        width: 95%;
        padding: 1.5rem;
    }
    
    .profile-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .profile-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .profile-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .feed-layout {
        grid-template-columns: 1fr;
    }
    
    .messaging-container {
        height: calc(100vh - 80px);
    }
    
    .messaging-sidebar {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .hero {
        padding: 120px 0 80px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .feature-card {
        padding: 2rem;
    }
    
    .dashboard-header {
        padding: 2rem;
    }
    
    .village-count {
        font-size: 3rem;
    }
    
    .post, .post-card, .post-form {
        padding: 1.5rem;
    }
    
    .messaging-sidebar {
        width: 100%;
        position: absolute;
        height: 100%;
        z-index: 10;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .messaging-sidebar.show {
        transform: translateX(0);
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus states for keyboard navigation */
.btn:focus,
.nav-link:focus,
.form-control:focus,
.profile-tab:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border: #000000;
        --text-muted: #333333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .navbar,
    .sidebar,
    .fab,
    .notification {
        display: none !important;
    }
    
    .dashboard,
    .profile-container {
        padding-top: 0 !important;
    }
    
    * {
        box-shadow: none !important;
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.select-none { user-select: none; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

/* Color utilities */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-success { background-color: var(--success); }
.bg-danger { background-color: var(--danger); }
.bg-warning { background-color: var(--warning); }

/* Border utilities */
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-l { border-left: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 16px; }
.rounded-xl { border-radius: 20px; }
.rounded-full { border-radius: 50%; }

/* Shadow utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* ============================================
   COMPONENT-SPECIFIC ENHANCEMENTS
   ============================================ */

/* Enhanced tab buttons */
.tab-btn {
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tab-btn:hover {
    transform: translateY(-1px);
}

/* Enhanced typography */
.profile-container h1,
.profile-container h2,
.profile-container h3 {
    font-weight: 600;
    color: var(--text);
}

/* Smooth transitions for all elements */
* {
    transition: color 0.3s ease, 
                background-color 0.3s ease, 
                border-color 0.3s ease, 
                transform 0.3s ease, 
                box-shadow 0.3s ease;
}

/* Enhanced button interactions */
.btn:active {
    transform: translateY(0) scale(0.98);
}

/* Enhanced form interactions */
textarea {
    font-family: inherit;
    resize: vertical;
}

/* Enhanced card interactions */
.card {
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Enhanced list interactions */
.list-item {
    transition: var(--transition);
    cursor: pointer;
}

.list-item:hover {
    background: var(--primary-light);
    transform: translateX(3px);
}

/* Enhanced avatar interactions */
.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

/* Enhanced status indicators */
.status-online {
    color: var(--success);
}

.status-busy {
    color: var(--warning);
}

.status-offline {
    color: var(--text-muted);
}

/* Enhanced badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* Enhanced dividers */
.divider {
    height: 1px;
    background: var(--border);
    margin: 1rem 0;
}

.divider-vertical {
    width: 1px;
    background: var(--border);
    margin: 0 1rem;
}

/* ============================================
   FINAL OPTIMIZATION
   ============================================ */

/* Performance optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Improved scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection styling */
::selection {
    background: var(--primary-light);
    color: var(--primary);
}

::-moz-selection {
    background: var(--primary-light);
    color: var(--primary);
}

/* Placeholder styling */
::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

::-moz-placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Focus ring styling */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================
   MAIN FEED & FARMERS MARKET STYLES
   ============================================ */

/* Feed Filters */
.feed-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
    overflow-x: auto;
}

.filter-tab, .category-chip {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 25px;
    background: #f8f9fa;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
    border: 2px solid transparent;
}

.filter-tab:hover, .category-chip:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.filter-tab.active, .category-chip.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Community Stats */
.community-stats h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.mini-stat {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.mini-stat:hover {
    transform: translateY(-2px);
    background: #e9ecef;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Trending Topics */
.trending-topics h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.topic-item {
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 15px;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topic-item:hover {
    background: var(--primary);
    color: white;
    transform: translateX(5px);
}

/* Market Categories */
.market-categories {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.market-categories::-webkit-scrollbar {
    height: 4px;
}

.market-categories::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.market-categories::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

/* Market Grid */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.market-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.market-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.market-item-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    position: relative;
}

.market-item-price {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-weight: bold;
}

.market-item-content {
    padding: 1.25rem;
}

.market-item-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.market-item-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.market-item-seller {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.seller-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

.seller-info {
    flex: 1;
}

.seller-name {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.seller-rating {
    color: #666;
    font-size: 0.8rem;
}

.market-item-actions {
    display: flex;
    gap: 0.5rem;
}

/* Feed Sidebar */
.feed-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feed-sidebar h4 {
    margin: 0;
    font-size: 1.1rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-buttons .btn {
    justify-content: flex-start;
    padding: 0.75rem;
    font-size: 0.9rem;
}

/* Media Upload Styles */
.media-upload-zone {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.media-upload-zone:hover {
    border-color: var(--primary);
    background: #f8f9ff;
}

.media-upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-subtext {
    color: #666;
    font-size: 0.9rem;
}

.media-preview {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.media-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Village Feed Post Styles */
.village-post {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.village-post-header {
    padding: 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.village-post-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.village-post-info {
    flex: 1;
}

.village-post-author {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.village-post-time {
    color: #666;
    font-size: 0.85rem;
}

.village-post-content {
    padding: 1.25rem;
}

.village-post-text {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text);
}

.village-post-media {
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.village-post-media img,
.village-post-media video {
    width: 100%;
    height: auto;
    display: block;
}

.village-post-actions {
    padding: 1rem 1.25rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 1rem;
}

.post-action-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.post-action-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.post-action-btn.liked {
    background: #ffebee;
    color: #e91e63;
}

/* Responsive Design for Feed */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .feed-sidebar {
        order: -1;
    }
    
    .market-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .feed-filters,
    .market-categories {
        gap: 0.5rem;
    }
    
    .filter-tab,
    .category-chip {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   END OF INTEGRATED CSS
   ============================================ */