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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f3f2ef;
    color: #1a1a1a;
    line-height: 1.5;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 600;
    color: #dc3545;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: -0.5px;
}

.logo-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #dc3545;
    border-radius: 4px;
    color: white;
    transition: opacity 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.logo-icon i {
    font-size: 18px;
    position: absolute;
    font-weight: 700;
}

.out-text {
    font-size: 16px;
    font-weight: 900;
    color: white;
    line-height: 1;
    letter-spacing: -0.5px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    text-transform: lowercase;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.logo-gif {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    cursor: pointer;
}

.nav-logo:hover .logo-gif {
    pointer-events: auto;
}

.logo-gif img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.nav-logo:hover .logo-gif {
    opacity: 1;
}

.nav-logo:hover .logo-icon {
    opacity: 0;
}

.logo-gif.show {
    opacity: 1;
}

/* Page load slide-in animation */
@keyframes logoGifSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50%) translateX(-50px);
        scale: 0.5;
    }
    40% {
        opacity: 0.8;
        transform: translateY(-50%) translateX(-10px);
        scale: 0.9;
    }
    70% {
        opacity: 0.4;
        transform: translateY(-50%) translateX(-2px);
        scale: 0.95;
    }
    85% {
        opacity: 0;
        transform: translateY(-50%) translateX(0);
        scale: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) translateX(0);
        scale: 1;
    }
}

/* Logo fade-in animation */
@keyframes logoFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.logo-gif.load-animation {
    animation: logoGifSlideIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.logo-icon.load-animation {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.logo-icon.fade-in {
    animation: logoFadeIn 0.5s ease-in-out forwards;
}

.nav-search {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.nav-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.nav-search input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f3f2ef;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-search input:focus {
    outline: none;
    background: #fff;
    border-color: #0077b5;
    box-shadow: 0 0 0 2px rgba(0, 119, 181, 0.1);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #666;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 60px;
}

.nav-item:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.nav-item.active {
    color: #dc3545;
    border-bottom: 2px solid #dc3545;
}

.nav-item i {
    font-size: 20px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: -0.2px;
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-profile:hover {
    background: rgba(220, 53, 69, 0.05);
}

.nav-profile img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-profile span {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    align-items: start;
}

/* Failures page should not use the three-column grid */
.failures-page {
    display: block !important;
    grid-template-columns: none !important;
}

/* Left Sidebar */
.left-sidebar {
    position: sticky;
    top: 80px;
}

.profile-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.profile-banner {
    height: 60px;
    background: linear-gradient(135deg, #dc3545, #a71e2a);
}

.profile-info {
    padding: 20px;
    text-align: center;
    position: relative;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid #fff;
    object-fit: cover;
    margin-top: -40px;
    margin-bottom: 16px;
}

.profile-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

/* Name + online dot shown side by side */
.profile-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.profile-name-row h3 {
    margin-bottom: 0;
}

.profile-name-row .status-indicator {
    margin-right: 0;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.profile-info p {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #dc3545;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

.sidebar-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sidebar-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a1a;
    letter-spacing: -0.2px;
}

.recent-item, .group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: #666;
    cursor: pointer;
    transition: color 0.2s ease;
}

.recent-item:hover, .group-item:hover {
    color: #dc3545;
}

.recent-item i, .group-item i {
    width: 20px;
    text-align: center;
}

/* Main Feed */
.main-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-composer {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.composer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.composer-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.composer-button {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    background: #fff;
    text-align: left;
    color: #666;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.1px;
}

.composer-button:hover {
    background: #f3f2ef;
    border-color: #dc3545;
}

.composer-actions {
    display: flex;
    justify-content: space-around;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    letter-spacing: -0.1px;
}

.action-btn:hover {
    background: #f3f2ef;
    color: #dc3545;
}

.post {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.post-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.post-author {
    flex: 1;
}

.post-author h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.post-author p {
    font-size: 13px;
    color: #666;
    font-weight: 400;
    letter-spacing: -0.1px;
}

.post-menu {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.post-menu:hover {
    background: #f3f2ef;
    color: #333;
}

.post-content {
    margin-bottom: 16px;
}

.post-content p {
    margin-bottom: 16px;
    line-height: 1.5;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -0.1px;
}

.post-image {
    margin-top: 16px;
    border-radius: 8px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-actions {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}

/* Right Sidebar */
.right-sidebar {
    position: sticky;
    top: 80px;
}

.news-item {
    padding: 16px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.news-item h5 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.news-item p {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.news-source {
    font-size: 12px;
    color: #999;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.suggestion-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.suggestion-info {
    flex: 1;
}

.suggestion-info h5 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.suggestion-info p {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.mutual-connections {
    font-size: 11px;
    color: #999;
}

.connect-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.connect-btn:hover {
    background: #a71e2a;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 250px 1fr 250px;
        gap: 16px;
    }
    
    .nav-search {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .left-sidebar, .right-sidebar {
        position: static;
        order: 2;
    }
    
    .main-feed {
        order: 1;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    .nav-search {
        display: none;
    }
    
    .nav-menu {
        gap: 12px;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-profile span {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 12px;
    }
    
    .nav-menu {
        gap: 8px;
    }
    
    .nav-item {
        min-width: 40px;
        padding: 8px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .post-composer, .post, .sidebar-section {
        padding: 16px;
    }
    
    .composer-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .post-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post, .sidebar-section, .post-composer {
    animation: fadeIn 0.3s ease-out;
}

/* Hover Effects */
.profile-card, .sidebar-section, .post-composer, .post {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-card:hover, .sidebar-section:hover, .post-composer:hover, .post:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Focus States for Accessibility */
button:focus, input:focus, .nav-item:focus {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

/* Failures Page Styles */
.failures-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.failures-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.failures-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.8px;
}

.add-failure-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.add-failure-btn:hover {
    background: #a71e2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc3545, #a71e2a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-info .stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #dc3545;
    line-height: 1;
}

.stat-info .stat-label {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.failures-filters {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.failures-filters h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.filter-btn:hover {
    background: #e9ecef;
    border-color: #dc3545;
    color: #dc3545;
}

.filter-btn.active {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

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

.failure-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    border-left: 4px solid #dc3545;
}

.failure-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.failure-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.failure-category {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(220, 53, 69, 0.1);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: #dc3545;
}

.failure-category i {
    font-size: 14px;
}

.failure-date {
    font-size: 12px;
    color: #999;
}

.failure-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
}

.failure-content p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.failure-stats {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.failure-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.failure-stat i {
    color: #dc3545;
}

/* Responsive Design for Failures Page */
@media (max-width: 768px) {
    .failures-page {
        padding: 16px;
    }
    
    .failures-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .failures-header h1 {
        font-size: 24px;
        text-align: center;
    }
    
    .failures-stats {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .failure-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .failure-stats {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* Dark Mode Support - Disabled for better readability */
/* @media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .navbar, .profile-card, .sidebar-section, .post-composer, .post {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .nav-search input {
        background: #404040;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .composer-button {
        background: #404040;
        border-color: #404040;
        color: #e0e0e0;
    }
} */

/* Profile Dropdown Styles */
.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    display: none;
    margin-top: 8px;
}

.profile-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9em;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item i {
    margin-right: 12px;
    width: 16px;
    color: #666;
}

.dropdown-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 4px 0;
}

/* User Status Indicators */
.user-status {
    display: flex;
    align-items: center;
    margin-top: 12px;
    font-size: 0.85em;
    color: #666;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-indicator.online {
    background-color: #28a745;
}

.status-indicator.anonymous {
    background-color: #6c757d;
}

.status-indicator.offline {
    background-color: #dc3545;
}

/* Notifications Page */
.notifications-page {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
}

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

.notifications-header h1 {
    font-size: 24px;
    color: #1a1a1a;
}

.mark-read-btn {
    background: none;
    border: 1px solid #0a66c2;
    color: #0a66c2;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.mark-read-btn:hover {
    background: #0a66c2;
    color: #fff;
}

.notifications-list {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
    cursor: pointer;
}

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

.notification-item:hover {
    background: #f3f2ef;
}

.notification-item.unread {
    background: #eaf4ff;
}

.notification-item.unread:hover {
    background: #ddeeff;
}

.notification-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.notification-system-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff3e0;
    color: #fb8c00;
    font-size: 18px;
}

.notification-body {
    flex: 1;
}

.notification-body p {
    margin: 0 0 4px;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.4;
}

.notification-time {
    font-size: 12px;
    color: #888;
}

.notification-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.notification-icon.pity { color: #e0245e; }
.notification-icon.mock { color: #f5a623; }
.notification-icon.connect { color: #0a66c2; }
.notification-icon.relate { color: #17bf63; }
.notification-icon.criticize { color: #794bc4; }
.notification-icon.follow { color: #555; }

/* Navigation Profile Styles */
.nav-profile {
    position: relative;
    cursor: pointer;
}

.nav-profile:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

/* Authentication Styles */
.auth-required {
    display: none;
}

.user-authenticated .auth-required {
    display: block;
}

.user-anonymous .anonymous-features {
    opacity: 0.6;
    pointer-events: none;
}

/* Post Click Functionality */
.post {
    cursor: pointer;
    transition: all 0.2s ease;
}

.post:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.post-actions {
    pointer-events: auto;
}

.post-actions .action-btn {
    pointer-events: auto;
}

/* Network Page Styles */
.network-page {
    display: block !important;
    grid-template-columns: none !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.network-header {
    text-align: center;
    margin-bottom: 30px;
}

.network-header h2 {
    color: #1a1a1a;
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: 700;
}

.network-header p {
    color: #666;
    font-size: 1.1em;
    margin: 0;
}

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

.network-stats .stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s ease;
}

.network-stats .stat-card:hover {
    transform: translateY(-2px);
}

.network-stats .stat-icon {
    width: 50px;
    height: 50px;
    background: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2em;
}

.network-stats .stat-info {
    display: flex;
    flex-direction: column;
}

.network-stats .stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #dc3545;
    line-height: 1;
}

.network-stats .stat-label {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.network-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.network-filters .filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #666;
}

.network-filters .filter-btn:hover,
.network-filters .filter-btn.active {
    border-color: #dc3545;
    background: #dc3545;
    color: white;
}

.network-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.connections-section h3,
.suggestions-section h3 {
    color: #1a1a1a;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

.connections-grid {
    display: grid;
    gap: 15px;
}

.connection-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.connection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.connection-avatar {
    position: relative;
}

.connection-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.connection-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid white;
}

.connection-status.online {
    background: #28a745;
}

.connection-status.offline {
    background: #6c757d;
}

.connection-status.away {
    background: #ffc107;
}

.connection-info {
    flex: 1;
}

.connection-info h4 {
    margin: 0 0 5px 0;
    color: #1a1a1a;
    font-size: 1.1em;
    font-weight: 600;
}

.connection-info p {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 0.9em;
}

.connection-stats {
    display: flex;
    gap: 15px;
    font-size: 0.8em;
}

.mutual-failures {
    color: #dc3545;
    font-weight: 600;
}

.last-active {
    color: #999;
}

.connection-actions {
    display: flex;
    gap: 8px;
}

.connection-actions .action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.connection-actions .action-btn.primary {
    background: #dc3545;
    color: white;
}

.connection-actions .action-btn.secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
}

.connection-actions .action-btn:hover {
    transform: scale(1.1);
}

.suggestions-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

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

.suggestion-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #f0f0f0;
}

.suggestion-card:hover {
    background: #f8f9fa;
    border-color: #dc3545;
}

.suggestion-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.suggestion-info {
    flex: 1;
}

.suggestion-info h5 {
    margin: 0 0 5px 0;
    color: #1a1a1a;
    font-size: 1em;
    font-weight: 600;
}

.suggestion-info p {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 0.85em;
}

.mutual-connections {
    color: #dc3545;
    font-size: 0.8em;
    font-weight: 600;
}

.suggestion-actions .action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: #dc3545;
    color: white;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.suggestion-actions .action-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .network-content {
        grid-template-columns: 1fr;
    }
    
    .network-stats {
        grid-template-columns: 1fr;
    }
    
    .network-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .connection-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .connection-actions {
        justify-content: center;
    }
}

/* ======================= Dark Mode ======================= */
body.dark-mode {
    background-color: #18191a;
    color: #e4e6eb;
}

/* Surfaces: navbar, cards, panels */
body.dark-mode .navbar,
body.dark-mode .profile-card,
body.dark-mode .sidebar-section,
body.dark-mode .post,
body.dark-mode .post-composer,
body.dark-mode .failure-form,
body.dark-mode .failure-item,
body.dark-mode .stat-card,
body.dark-mode .news-item,
body.dark-mode .suggestion-item,
body.dark-mode .suggestion-card,
body.dark-mode .connection-card,
body.dark-mode .notifications-list,
body.dark-mode .profile-dropdown,
body.dark-mode .messaging-container,
body.dark-mode .msg-thread-body,
body.dark-mode .modal-content {
    background-color: #242526 !important;
    border-color: #3a3b3c !important;
    color: #e4e6eb;
}

/* Headings and body text */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode .nav-logo span,
body.dark-mode .profile-info h3,
body.dark-mode .stat-number,
body.dark-mode .notification-body p,
body.dark-mode .post-content p,
body.dark-mode .failure-content h4 {
    color: #e4e6eb !important;
}

body.dark-mode p,
body.dark-mode .profile-info p,
body.dark-mode .stat-label,
body.dark-mode .notification-time,
body.dark-mode .news-source,
body.dark-mode .post-author p,
body.dark-mode .msg-convo-info p {
    color: #b0b3b8 !important;
}

/* Search + inputs */
body.dark-mode .nav-search,
body.dark-mode .msg-compose input,
body.dark-mode textarea,
body.dark-mode input[type="text"] {
    background-color: #3a3b3c !important;
    color: #e4e6eb !important;
    border-color: #4a4b4c !important;
}
body.dark-mode .nav-search input { color: #e4e6eb !important; }
body.dark-mode ::placeholder { color: #8a8d91 !important; }

/* Nav items */
body.dark-mode .nav-item { color: #b0b3b8; }
body.dark-mode .nav-item.active,
body.dark-mode .nav-item:hover { color: #4d9fff; }

/* Hover states */
body.dark-mode .dropdown-item:hover,
body.dark-mode .recent-item:hover,
body.dark-mode .group-item:hover,
body.dark-mode .notification-item:hover,
body.dark-mode .msg-convo:hover {
    background-color: #3a3b3c !important;
}

/* Unread notification + active chat highlight */
body.dark-mode .notification-item.unread { background-color: #2c3a4a !important; }
body.dark-mode .msg-convo.active { background-color: #2c3a4a !important; }

/* Chat bubbles */
body.dark-mode .msg-bubble.them { background-color: #3a3b3c; color: #e4e6eb; }

/* Borders / dividers */
body.dark-mode .dropdown-divider,
body.dark-mode .notification-item,
body.dark-mode .msg-convo,
body.dark-mode .post-header,
body.dark-mode .msg-compose { border-color: #3a3b3c !important; }

/* Banner gradient stays, but soften */
body.dark-mode .profile-banner { opacity: 0.8; }

/* Dark mode: catch-all so no text stays black on dark surfaces */
body.dark-mode :is(h1, h2, h3, h4, h5, h6, p, span, label, li, strong, small, td, th, a) {
    color: #e4e6eb;
}

/* Keep muted/secondary text a softer grey */
body.dark-mode :is(.stat-label, .notification-time, .news-source, .profile-info p,
    .post-author p, .msg-convo-info p, .connection-info p, .suggestion-info p,
    .failure-date, .last-active, .char-count, .mutual-connections) {
    color: #b0b3b8;
}

/* Preserve brand + accent colors */
body.dark-mode .nav-logo span { color: #ff4d5e; }
body.dark-mode .out-text { color: #fff; }
body.dark-mode .nav-item.active span,
body.dark-mode .nav-item:hover span { color: #4d9fff; }
body.dark-mode .connect-btn,
body.dark-mode .submit-btn,
body.dark-mode .add-failure-btn,
body.dark-mode .action-btn.primary,
body.dark-mode .msg-compose button {
    color: #fff;
}
body.dark-mode .mark-read-btn { color: #4d9fff; }
body.dark-mode .mark-read-btn:hover { color: #fff; }

/* Dark mode: section wrappers that had white backgrounds */
body.dark-mode .suggestions-section,
body.dark-mode .connections-section,
body.dark-mode .network-content,
body.dark-mode .left-sidebar,
body.dark-mode .right-sidebar {
    background-color: #242526 !important;
    border-color: #3a3b3c !important;
}
body.dark-mode .suggestion-card { border-color: #3a3b3c !important; }
body.dark-mode .suggestion-card:hover { background-color: #3a3b3c !important; }

/* Dark mode: filter block + filter chips */
body.dark-mode .failures-filters,
body.dark-mode .network-filters {
    background-color: #242526 !important;
    border-color: #3a3b3c !important;
}
body.dark-mode .filter-btn {
    background-color: #3a3b3c !important;
    border-color: #4a4b4c !important;
    color: #e4e6eb !important;
}
body.dark-mode .filter-btn:hover,
body.dark-mode .filter-btn.active {
    background-color: #4d9fff !important;
    border-color: #4d9fff !important;
    color: #fff !important;
}

/* Dark mode: post composer button + generic action buttons */
body.dark-mode .composer-button {
    background-color: #3a3b3c !important;
    border-color: #4a4b4c !important;
    color: #b0b3b8 !important;
}
body.dark-mode .composer-button:hover {
    background-color: #4a4b4c !important;
}
body.dark-mode .action-btn:not(.primary) {
    background-color: transparent !important;
    color: #b0b3b8 !important;
}
