/* Code Ora Vanilla CSS - RTL & Dark Mode Design System */

:root {
    /* Light Theme */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #f59e0b;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

.dark-mode {
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --secondary-color: #fbbf24;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --border-color: #334155;
    --nav-bg: rgba(30, 41, 59, 0.9);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px;
    box-sizing: border-box;
}

/* Navigation */
.navbar {
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
}

.logo-code { color: var(--text-main); }
.logo-ora { color: var(--primary-color); }

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-main);
    font-weight: 600;
    position: relative;
}

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

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover { border-color:#fff; color:#fff; background-color: var(--primary-hover); }

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}

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

.btn-lg {
    padding: 12px 30px;
    font-size: 18px;
}

.theme-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

/* Hero Section */
.hero-section {
    padding: 100px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--surface-color) 100%);
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-content .highlight {
    color: var(--primary-color);
}

.hero-content .lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Features Grid */
.features-section {
    padding: 80px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* About Page */
.page-content {
    padding: 60px 20px;
    min-height: 60vh;
}

.about-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    color: var(--primary-color);
}

.about-card {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.about-card h3 {
    margin-bottom: 15px;
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

/* Footer */
.footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 10px;
    max-width: 400px;
}

.footer-links h3 {
    margin-bottom: 15px;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
}
.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* --- Enhanced Responsive Design System --- */

/* Mobile First Base Adjustments */
html, body {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

img, video, iframe, canvas {
    max-width: 100%;
    height: auto;
}

pre, code {
    max-width: 100%;
    overflow-x: auto;
    word-wrap: normal;
}

/* Navbar Responsive Fixes */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
}

@media (max-width: 992px) {
    .container, .page-content {
        max-width: 100%;
        width: 100%;
        padding: 0 12px;
        box-sizing: border-box;
    }
    
    .navbar .container {
        padding: 0 12px;
    }
    
    .navbar {
        height: 55px !important;
    }

    .mobile-nav-toggle {
        display: block;
        padding: 5px;
    }
    
    .nav-links {
        position: fixed;
        right: -100%;
        top: 55px; /* Match slim nav */
        flex-direction: column;
        background: var(--surface-color);
        width: 80%;
        height: calc(100vh - 55px);
        padding: 25px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.4s ease;
        z-index: 999;
        gap: 20px;
        border-left: 1px solid var(--border-color);
        overflow-y: auto;
    }
    
    .nav-links.active {
        right: 0;
    }

    .hidden-desktop {
        display: flex !important;
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        font-size: 18px;
    }
}

/* Community Grid Stacking Logic */
@media (max-width: 1200px) {
    .community-grid {
        grid-template-columns: 280px 1fr;
    }
    .community-sidebar:last-child {
        display: none; /* Hide trending/groups on medium tablets */
    }
}

@media (max-width: 992px) {
    .community-grid {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }
    
    .community-sidebar {
        display: none; /* Hide all sidebars on mobile */
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
}

/* Post and Feed Spacing for Mobile */
@media (max-width: 576px) {
    .container {
        padding: 0 8px;
    }
    
    .post-card {
        padding: 12px 0px !important;
        margin-bottom: 12px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .post-header, .post-body, .post-footer {
        padding: 8px 12px !important;
    }

    .community-nav {
        height: 50px !important;
    }
    
    .post-content {
        font-size: 0.95rem;
    }
    
    .user-avatar {
        width: 38px;
        height: 38px;
    }
    
    .create-post-card {
        padding: 12px;
        margin-bottom: 20px;
        border-radius: 0;
    }
    
    .about-card {
        padding: 15px;
        border-radius: 0;
    }
}

/* Interaction Buttons (Global - needed on all screen sizes) */
.interaction-btn {
    background: transparent !important;
    border: none !important;
    color: var(--text-muted);
    font-size: 13px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    border-radius: 8px;
    cursor: pointer;
}

.interaction-btn:hover {
    background: rgba(var(--primary-rgb), 0.1) !important;
    color: var(--primary-color);
}

.post-options-btn {
    background: transparent !important;
    border: none !important;
    color: var(--text-muted);
    font-size: 16px;
    padding: 5px;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s;
}

.post-options-btn:hover {
    opacity: 1;
    color: var(--primary-color);
}



/* Utilities */
.hidden-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }
}

/* Navbar Icon Buttons (Desktop/All) */
.nav-icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    font-size: 18px;
    text-decoration: none;
}

.nav-icon-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.logout-btn:hover {
    background: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Modern Glassmorphism Bottom Nav */
.mobile-bottom-nav {
    position: fixed;
    bottom: 15px;
    left: 15px;
    right: 15px;
    height: 65px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    display: none;
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

[data-theme="dark"] .mobile-bottom-nav {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    transition: all 0.3s ease;
    gap: 4px;
    flex: 1;
}

.bottom-nav-item i {
    font-size: 1.2rem;
}

.bottom-nav-item.active {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-plus-btn {
    background: var(--primary-color);
    color: white !important;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -35px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    border: 4px solid var(--bg-color);
}

/* Dashboard & Fluid Components */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover { 
    transform: translateY(-5px); 
    border-color: var(--primary-color);
}
.stat-card .icon { font-size: 2rem; margin-bottom: 10px; }
.stat-card h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 5px; }
.stat-card .value { font-size: 1.5rem; font-weight: 800; color: var(--text-main); }

.card-box {
    background: var(--surface-color);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.profile-card-header {
    background: var(--surface-color);
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.cover-photo {
    height: 180px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

.cover-photo img { width: 100%; height: 100%; object-fit: cover; }

.profile-strip {
    padding: 0 30px 20px;
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-top: -50px;
}

.avatar-large {
    width: 110px;
    height: 110px;
    border-radius: 28px;
    border: 4px solid var(--surface-color);
    background: var(--bg-color);
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

.user-meta h2 { font-size: 1.4rem; margin-bottom: 2px; }
.user-meta p { color: var(--text-muted); font-size: 0.9rem; }

@media (max-width: 768px) {
    .mobile-bottom-nav { display: flex; }
    
    .profile-strip {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-bottom: 30px;
    }
    
    .dash-grid { grid-template-columns: 1fr; }
    
    .cover-photo { height: 140px; }
    
    .avatar-large {
        width: 90px;
        height: 90px;
    }
}

/* Global Community Polish */
.comment-text {
    color: var(--text-main) !important;
    line-height: 1.6;
    font-size: 0.95rem;
}

[data-theme="dark"] .comment-text {
    color: #e5e7eb !important;
}

.notif-item { position: relative; }
@media (max-width: 576px) {
    .groups-header h1 { font-size: 22px; }
    .notif-avatar { width: 40px; height: 40px; }
    .notif-message { font-size: 13px !important; }
    .group-banner { height: 100px; }
    .section-title { font-size: 18px; }
}

/* Fix for overlapping elements */
.main-content {
    min-height: calc(100vh - 150px);
}
