/* VYRECRYPT Mobile Optimization Styles */

/* Global Mobile Fixes */
* {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-touch-callout: none;
}

html, body {
    overflow-x: hidden;
    touch-action: manipulation;
}

/* Login/Register Mobile Optimization */
.login-container, .register-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card, .register-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.login-header, .register-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 16px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 0.25rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s ease;
}

.auth-tab.active {
    background: #007bff;
    color: white;
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    /* Hide desktop navbar */
    .navbar {
        display: none !important;
    }
    
    /* Mobile Header */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: #212529;
        color: white;
        padding: 1rem;
        z-index: 1050;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .mobile-header-brand {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 1.1rem;
        font-weight: bold;
        color: white;
        text-decoration: none;
    }
    
    .mobile-header-brand img {
        height: 32px;
        width: 32px;
        object-fit: cover;
        border-radius: 6px;
    }
    
    /* Content spacing for mobile header */
    .main-content {
        margin-top: 70px;
        padding-bottom: 160px; /* Extra space for footer */
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    /* Enhanced Touch Targets */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        min-height: 38px;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Card Improvements for Mobile */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* List Group Mobile Optimization */
    .list-group-item {
        padding: 1rem 0.75rem;
        border-radius: 8px !important;
        margin-bottom: 0.5rem;
        border: 1px solid rgba(255,255,255,0.1) !important;
    }
    
    /* Chat Interface Mobile */
    .chat-messages {
        height: calc(100vh - 280px) !important;
        padding: 0.5rem;
    }
    
    .message-bubble {
        max-width: 85% !important;
        padding: 0.75rem 1rem;
        border-radius: 18px;
        margin-bottom: 0.5rem;
        word-wrap: break-word;
    }
    
    .message-bubble.sent {
        background: linear-gradient(135deg, #007bff, #0056b3);
        margin-left: auto;
        border-bottom-right-radius: 6px;
    }
    
    .message-bubble.received {
        background: rgba(255,255,255,0.1);
        border-bottom-left-radius: 6px;
    }
    
    /* Form Improvements */
    .form-control {
        min-height: 44px;
        font-size: 1rem;
        border-radius: 8px;
        border: 2px solid rgba(255,255,255,0.2);
    }
    
    .form-control:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    }
    
    /* Modal Mobile Optimization */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 1rem 1.25rem 0.5rem;
    }
    
    .modal-body {
        padding: 1rem 1.25rem;
    }
    
    /* Dropdown Mobile Fixes */
    .dropdown {
        position: relative;
        z-index: 1060;
    }
    
    .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        z-index: 9999 !important;
        transform: none !important;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.2);
        background: #2a2f32 !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.5);
        min-width: 200px;
        margin-top: 0.5rem;
        will-change: transform;
    }
    
    .dropdown-menu.show {
        display: block !important;
    }
    
    .dropdown-item {
        color: white !important;
        padding: 0.75rem 1rem !important;
    }
    
    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: rgba(0,123,255,0.2) !important;
        color: white !important;
    }
    
    /* Mobile Header Dropdown */
    .mobile-header .dropdown-menu {
        background: #1a1d29 !important;
        border: 1px solid rgba(255,255,255,0.1);
        margin-top: 0.25rem;
    }
    
    /* PWA Install Banner Mobile Optimizations */
    #installBanner {
        font-size: 0.9rem;
    }
    
    #installBanner .container-fluid {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #installBanner .d-flex:first-child {
        justify-content: center;
    }
    
    #installBanner .d-flex:last-child {
        justify-content: center;
    }
    
    /* Mobile Footer Optimization */
    footer {
        position: relative !important;
        margin-top: 2rem !important;
        z-index: 1 !important;
        padding: 1.5rem 0 !important;
    }
    
    footer .container {
        padding: 0 1rem !important;
    }
    
    footer .d-flex {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    footer .btn-sm {
        font-size: 0.8rem !important;
        padding: 0.5rem 1rem !important;
    }
    
    .dropdown-menu.show {
        display: block !important;
        opacity: 1;
        transform: translateY(0) !important;
        visibility: visible;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 6px;
        margin: 0.25rem 0.5rem;
        color: white !important;
        background: transparent;
        border: none;
        transition: all 0.2s ease;
    }
    
    .dropdown-item:hover,
    .dropdown-item:focus {
        background: rgba(0,123,255,0.2) !important;
        color: white !important;
    }
    
    .dropdown-item:active {
        background: rgba(0,123,255,0.3) !important;
        color: white !important;
    }
    
    .dropdown-item i {
        margin-right: 0.5rem;
        width: 16px;
        text-align: center;
    }
    
    /* Fix dropdown positioning in list items */
    .list-group-item {
        position: relative;
        overflow: visible !important;
    }
    
    .list-group-item .dropdown {
        position: static;
    }
    
    .list-group-item .dropdown-menu {
        position: fixed !important;
        z-index: 10000 !important;
    }
    
    /* Additional mobile dropdown enhancements */
    @media (max-width: 768px) {
        .dropdown-menu {
            background: #2a2f32 !important;
            border: 1px solid rgba(255,255,255,0.2) !important;
            border-radius: 8px !important;
            box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
            min-width: 180px !important;
            max-width: 250px !important;
            margin: 0 !important;
            transform: none !important;
            z-index: 99999 !important;
        }
        
        .dropdown-menu.show {
            display: block !important;
            position: fixed !important;
            z-index: 99999 !important;
        }
        
        /* Ensure dropdown containers have proper stacking */
        .dropdown {
            z-index: 99998 !important;
            position: relative !important;
        }
        
        .dropdown-toggle {
            z-index: 99997 !important;
            position: relative !important;
        }
        
        .dropdown-item {
            color: white !important;
            padding: 0.75rem 1rem !important;
            border-radius: 4px !important;
            margin: 0.25rem 0.5rem !important;
            transition: background 0.2s ease !important;
        }
        
        .dropdown-item:hover,
        .dropdown-item:focus {
            background: rgba(0,123,255,0.2) !important;
            color: white !important;
        }
        
        .dropdown-divider {
            border-color: rgba(255,255,255,0.2) !important;
            margin: 0.5rem 0 !important;
        }
        
        .dropdown-toggle::after {
            display: none !important;
        }
    }
    }
    
    /* Social Feed Mobile */
    .post-card {
        margin-bottom: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    
    .post-image {
        border-radius: 8px;
        max-height: 400px;
        width: 100%;
        object-fit: cover;
        cursor: pointer;
    }
    
    .reaction-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }
    
    .reaction-btn {
        min-width: 50px;
        min-height: 44px;
        border-radius: 25px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        border: 1px solid rgba(255,255,255,0.2);
        background: rgba(255,255,255,0.05);
        transition: all 0.3s ease;
    }
    
    .reaction-btn.active {
        background: rgba(0,123,255,0.2);
        border-color: #007bff;
        transform: scale(1.1);
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .post-header {
        display: flex;
        align-items: center;
        margin-bottom: 1rem;
        padding: 0.75rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .post-author {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .post-author .emoji {
        font-size: 2rem;
    }
    
    .post-text {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .post-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .comment-section {
        max-height: 300px;
        overflow-y: auto;
        padding: 1rem;
        background: rgba(255,255,255,0.02);
        border-radius: 8px;
        margin-top: 1rem;
    }
    
    .comment-item {
        margin-bottom: 0.75rem;
        padding: 0.5rem;
        background: rgba(255,255,255,0.05);
        border-radius: 8px;
    }
    
    .comment-form {
        margin-top: 1rem;
    }
    
    .comment-input {
        border-radius: 25px;
        min-height: 44px;
        padding: 0.75rem 1rem;
        border: 1px solid rgba(255,255,255,0.2);
    }
    
    .create-post-form {
        background: rgba(255,255,255,0.05);
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 2rem;
    }
    
    .create-post-textarea {
        min-height: 100px;
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,0.2);
        padding: 1rem;
        resize: vertical;
    }
    
    .image-upload-preview {
        max-width: 100%;
        max-height: 200px;
        border-radius: 8px;
        margin-top: 0.5rem;
        object-fit: cover;
    }
    
    /* File Upload Mobile */
    .file-upload-area {
        padding: 2rem 1rem;
        border: 2px dashed rgba(255,255,255,0.3);
        border-radius: 12px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .file-upload-area:hover {
        border-color: #007bff;
        background: rgba(0,123,255,0.1);
    }
    
    /* Voice Call Mobile Interface */
    .voice-call-controls {
        position: fixed;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 1rem;
        z-index: 1000;
    }
    
    .voice-btn {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    
    /* Group Chat Mobile */
    .group-members-list {
        max-height: 300px;
        overflow-y: auto;
    }
    
    .member-item {
        padding: 0.75rem;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        background: rgba(255,255,255,0.05);
    }
    
    /* Admin Controls Mobile */
    .admin-controls {
        position: sticky;
        top: 0;
        background: var(--bs-dark);
        padding: 1rem;
        border-radius: 0 0 12px 12px;
        z-index: 100;
    }
    
    /* Bottom Navigation for Mobile */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #212529;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding: 0.5rem 0;
        z-index: 1000;
        display: flex;
        justify-content: space-around;
        height: 70px;
    }
    
    .mobile-nav-item {
        flex: 1;
        text-align: center;
        padding: 0.5rem;
        color: rgba(255,255,255,0.7);
        text-decoration: none;
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    .mobile-nav-item.active,
    .mobile-nav-item:hover {
        color: #007bff !important;
        text-decoration: none;
    }
    
    .mobile-nav-item i {
        font-size: 1.2rem;
        margin-bottom: 0.2rem;
        line-height: 1;
    }
    
    .mobile-nav-item span {
        font-size: 0.7rem;
        line-height: 1;
        white-space: nowrap;
    }
    
    /* Content padding for bottom nav */
    .main-content {
        padding-bottom: 85px;
    }
    
    /* Chat interface mobile fixes */
    .messenger-pro-container {
        height: 100vh;
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1100;
        background: #1a1d23;
    }
    
    .messenger-pro-header {
        position: sticky;
        top: 0;
        z-index: 1001;
        background: linear-gradient(135deg, #128C7E, #075E54);
        padding: 1rem;
        color: white;
    }
    
    .messenger-pro-messages {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
        padding-bottom: 120px;
        background: #1a1d23;
    }
    
    .messenger-pro-input-area {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #212529;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding: 1rem;
        z-index: 1002;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .messenger-pro-input-area .input-actions-left {
        display: flex;
        gap: 0.5rem;
    }
    
    .messenger-pro-input-area .message-input-wrapper {
        flex: 1;
        position: relative;
    }
    
    .messenger-pro-input-area .message-input-field {
        width: 100%;
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 20px;
        padding: 0.75rem 1rem;
        color: white;
        resize: none;
        max-height: 100px;
        min-height: 44px;
    }
    
    .messenger-pro-input-area .message-input-field:focus {
        outline: none;
        border-color: #007bff;
    }
    
    .messenger-pro-input-area .send-btn,
    .messenger-pro-input-area .input-action-btn {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: none;
        background: #007bff;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .messenger-pro-input-area .input-action-btn {
        background: rgba(255,255,255,0.1);
    }
    
    /* Hide navigation when in chat */
    body:has(.messenger-pro-container) .mobile-bottom-nav,
    body:has(.messenger-pro-container) .mobile-header {
        display: none !important;
    }
    
    /* List and Card Mobile Enhancements */
    .list-group-item {
        padding: 1rem;
        border-radius: 12px !important;
        margin-bottom: 0.75rem;
        border: 1px solid rgba(255,255,255,0.1) !important;
        background: rgba(255,255,255,0.05);
        transition: all 0.2s ease;
    }
    
    .list-group-item:hover,
    .list-group-item:active {
        background: rgba(0,123,255,0.1);
        transform: translateY(-1px);
    }
    
    /* Enhanced Chats List */
    .chat-item {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
        border-radius: 12px;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        margin-bottom: 0.75rem;
        text-decoration: none;
        color: inherit;
        transition: all 0.2s ease;
    }
    
    .chat-item:hover,
    .chat-item:active {
        background: rgba(0,123,255,0.1);
        color: white;
        text-decoration: none;
        transform: translateY(-1px);
    }
    
    .chat-avatar {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        background: linear-gradient(135deg, #007bff, #0056b3);
        flex-shrink: 0;
    }
    
    .chat-info {
        flex: 1;
        min-width: 0;
    }
    
    .chat-name {
        font-weight: 600;
        margin-bottom: 0.25rem;
        color: white;
    }
    
    .chat-preview {
        font-size: 0.9rem;
        opacity: 0.7;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .chat-meta {
        text-align: right;
        flex-shrink: 0;
    }
    
    .chat-time {
        font-size: 0.8rem;
        opacity: 0.6;
        margin-bottom: 0.25rem;
    }
    
    .chat-unread {
        background: #007bff;
        color: white;
        border-radius: 50%;
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
        min-width: 20px;
        text-align: center;
    }
    
    /* Header mobile optimization */
    .messenger-pro-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: linear-gradient(135deg, #128C7E, #075E54);
        padding: 1rem;
    }
    
    /* Message bubbles mobile optimization */
    .messenger-pro-message {
        margin-bottom: 0.5rem;
        max-width: 85%;
    }
    
    .messenger-pro-message.sent {
        margin-left: auto;
    }
    
    .messenger-pro-message.received {
        margin-right: auto;
    }
    
    /* Scroll to bottom button mobile */
    .scroll-to-bottom {
        position: fixed;
        bottom: 100px;
        right: 1rem;
        z-index: 998;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: #007bff;
        border: none;
        color: white;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    
    .scroll-to-bottom:hover {
        transform: scale(1.1);
    }
    
    /* Modal Enhancements */
    .modal-content {
        background: #212529;
        border: 1px solid rgba(255,255,255,0.1);
        color: white;
    }
    
    .modal-header {
        border-bottom: 1px solid rgba(255,255,255,0.1);
        background: rgba(0,0,0,0.1);
    }
    
    .modal-footer {
        border-top: 1px solid rgba(255,255,255,0.1);
        background: rgba(0,0,0,0.1);
    }
    
    .btn-close {
        filter: invert(1);
    }
    
    /* Loading States */
    .loading-spinner {
        display: inline-block;
        width: 20px;
        height: 20px;
        border: 2px solid rgba(255,255,255,0.3);
        border-radius: 50%;
        border-top-color: #007bff;
        animation: spin 1s ease-in-out infinite;
    }
    
    @keyframes spin {
        to { transform: rotate(360deg); }
    }
    
    /* Improved Touch Feedback */
    .btn:active,
    .list-group-item:active,
    .card:active {
        transform: scale(0.98);
    }
    
    /* Better Scrolling */
    .chat-messages,
    .messenger-pro-messages {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Improved Input Focus */
    input:focus,
    textarea:focus,
    select:focus {
        transform: scale(1.02);
        transition: transform 0.2s ease;
    }
    
    /* Enhanced Button Styles */
    .btn-primary {
        background: linear-gradient(135deg, #007bff, #0056b3);
        border: none;
        box-shadow: 0 2px 8px rgba(0,123,255,0.3);
    }
    
    .btn-primary:hover,
    .btn-primary:active {
        background: linear-gradient(135deg, #0056b3, #004085);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0,123,255,0.4);
    }
    
    .btn-success {
        background: linear-gradient(135deg, #28a745, #1e7e34);
        border: none;
        box-shadow: 0 2px 8px rgba(40,167,69,0.3);
    }
    
    .btn-danger {
        background: linear-gradient(135deg, #dc3545, #c82333);
        border: none;
        box-shadow: 0 2px 8px rgba(220,53,69,0.3);
    }
    
    /* Dashboard Mobile Optimization */
    .dashboard-hero {
        padding: 1.5rem 1rem;
        text-align: center;
        background: linear-gradient(135deg, #212529, #495057);
        margin: -1rem -1rem 1rem;
        border-radius: 0 0 20px 20px;
    }
    
    .dashboard-hero h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        color: white;
    }
    
    .dashboard-hero .subtitle {
        font-size: 0.9rem;
        opacity: 0.8;
        margin-bottom: 1rem;
        color: white;
    }
    
    .stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .stat-card {
        text-align: center;
        padding: 1.25rem 1rem;
        border-radius: 16px;
        background: rgba(0,123,255,0.1);
        border: 1px solid rgba(0,123,255,0.2);
        transition: transform 0.2s ease;
    }
    
    .stat-card:active {
        transform: scale(0.98);
    }
    
    .stat-icon {
        font-size: 1.5rem;
        color: #007bff;
        margin-bottom: 0.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
        font-weight: bold;
        color: #007bff;
        margin-bottom: 0.25rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
        opacity: 0.9;
        color: rgba(255,255,255,0.9);
    }
    
    /* Quick Actions Mobile */
    .quick-actions {
        margin-bottom: 2rem;
    }
    
    .quick-actions h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        color: white;
    }
    
    .action-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .action-btn {
        padding: 1rem;
        border-radius: 12px;
        background: rgba(255,255,255,0.1);
        color: white;
        text-decoration: none;
        text-align: center;
        transition: all 0.2s ease;
        border: 1px solid rgba(255,255,255,0.2);
    }
    
    .action-btn:hover,
    .action-btn:active {
        background: rgba(0,123,255,0.2);
        transform: translateY(-2px);
        color: white;
        text-decoration: none;
    }
    
    .action-btn i {
        display: block;
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .action-btn span {
        font-size: 0.9rem;
        font-weight: 500;
    }
    
    /* Social Feed Mobile Enhancements */
    .post-card {
        border-radius: 16px;
        margin-bottom: 1.5rem;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        overflow: hidden;
    }
    
    .post-header {
        padding: 1rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .post-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, #007bff, #0056b3);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        color: white;
    }
    
    .post-user-info h6 {
        margin: 0;
        font-weight: 600;
        color: white;
    }
    
    .post-time {
        font-size: 0.8rem;
        opacity: 0.6;
        margin: 0;
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .post-text {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1rem;
        color: white;
    }
    
    .post-image {
        width: 100%;
        max-height: 300px;
        object-fit: cover;
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    .post-actions {
        padding: 0.75rem 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid rgba(255,255,255,0.1);
        background: rgba(0,0,0,0.1);
    }
    
    .post-reactions {
        display: flex;
        gap: 0.5rem;
    }
    
    .reaction-btn {
        background: none;
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 20px;
        padding: 0.5rem 0.75rem;
        color: rgba(255,255,255,0.7);
        font-size: 0.9rem;
        transition: all 0.2s ease;
    }
    
    .reaction-btn:hover,
    .reaction-btn.active {
        background: rgba(0,123,255,0.2);
        border-color: #007bff;
        color: #007bff;
    }
    
    .create-post-form {
        background: rgba(255,255,255,0.05);
        border-radius: 16px;
        padding: 1rem;
        margin-bottom: 2rem;
        border: 1px solid rgba(255,255,255,0.1);
    }
    
    .create-post-textarea {
        min-height: 80px;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.2);
        background: rgba(255,255,255,0.1);
        color: white;
        padding: 0.75rem;
        resize: vertical;
        width: 100%;
    }
    
    .create-post-textarea:focus {
        outline: none;
        border-color: #007bff;
        background: rgba(255,255,255,0.15);
    }
    
    .create-post-textarea::placeholder {
        color: rgba(255,255,255,0.5);
    }
    
    /* Friends List Mobile */
    .friends-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .friend-card {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 12px;
        padding: 1rem;
        display: flex;
        align-items: center;
        gap: 1rem;
        transition: all 0.2s ease;
    }
    
    .friend-card:hover {
        background: rgba(0,123,255,0.1);
        transform: translateY(-1px);
    }
    
    .friend-avatar {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: linear-gradient(135deg, #007bff, #0056b3);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: white;
        flex-shrink: 0;
    }
    
    .friend-info {
        flex: 1;
        min-width: 0;
    }
    
    .friend-name {
        font-weight: 600;
        margin-bottom: 0.25rem;
        color: white;
    }
    
    .friend-status {
        font-size: 0.9rem;
        opacity: 0.7;
        color: #28a745;
    }
    
    .friend-actions {
        display: flex;
        gap: 0.5rem;
    }
    
    .friend-action-btn {
        padding: 0.5rem;
        border-radius: 50%;
        border: 1px solid rgba(255,255,255,0.2);
        background: rgba(255,255,255,0.1);
        color: white;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    
    .friend-action-btn:hover {
        background: rgba(0,123,255,0.2);
        border-color: #007bff;
    }
    
    /* Enhanced Form Elements */
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: white;
        display: block;
    }
    
    .form-control,
    .form-select {
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 8px;
        color: white;
        padding: 0.75rem;
        font-size: 1rem;
        width: 100%;
    }
    
    .form-control:focus,
    .form-select:focus {
        background: rgba(255,255,255,0.15);
        border-color: #007bff;
        outline: none;
        box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    }
    
    .form-control::placeholder {
        color: rgba(255,255,255,0.5);
    }
    
    /* Alert Messages Mobile */
    .alert {
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        border: none;
    }
    
    .alert-success {
        background: rgba(40,167,69,0.2);
        color: #28a745;
        border: 1px solid rgba(40,167,69,0.3);
    }
    
    .alert-danger {
        background: rgba(220,53,69,0.2);
        color: #dc3545;
        border: 1px solid rgba(220,53,69,0.3);
    }
    
    .alert-info {
        background: rgba(0,123,255,0.2);
        color: #007bff;
        border: 1px solid rgba(0,123,255,0.3);
    }
    
    .quick-action-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .quick-action-btn {
        aspect-ratio: 1;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.2);
        background: rgba(255,255,255,0.05);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: inherit;
        transition: all 0.3s ease;
        padding: 1rem;
    }
    
    .quick-action-btn:hover {
        background: rgba(0,123,255,0.1);
        border-color: #007bff;
        transform: translateY(-2px);
        color: inherit;
    }
    
    .quick-action-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
        color: #007bff;
    }
    
    .quick-action-text {
        font-size: 0.9rem;
        text-align: center;
        font-weight: 500;
    }
    
    /* Friends List Mobile */
    .friend-item {
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        background: rgba(255,255,255,0.05);
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .friend-avatar {
        font-size: 2rem;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0,123,255,0.2);
        border-radius: 50%;
    }
    
    .friend-info {
        flex: 1;
    }
    
    .friend-name {
        font-weight: 500;
        margin-bottom: 0.25rem;
    }
    
    .friend-status {
        font-size: 0.8rem;
        opacity: 0.7;
    }
    
    .friend-actions {
        display: flex;
        gap: 0.5rem;
    }
    
    .friend-actions .btn {
        padding: 0.5rem;
        min-width: 44px;
        border-radius: 8px;
    }
}

/* Tablet Portrait */
@media (min-width: 768px) and (max-width: 1024px) {
    .container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .chat-messages {
        height: calc(100vh - 250px);
    }
    
    .message-bubble {
        max-width: 70%;
    }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .btn:hover {
        transform: none;
    }
    
    /* Larger touch targets */
    .dropdown-toggle {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Better touch feedback */
    .btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .list-group-item:active {
        background: rgba(255,255,255,0.1) !important;
    }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        padding: 0.25rem 1rem;
    }
    
    .chat-messages {
        height: calc(100vh - 180px);
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .vyrecrypt-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark theme mobile adjustments */
.theme-dark {
    --mobile-bg: #121212;
    --mobile-surface: #1e1e1e;
    --mobile-border: rgba(255,255,255,0.1);
}

.theme-light {
    --mobile-bg: #ffffff;
    --mobile-surface: #f8f9fa;
    --mobile-border: rgba(0,0,0,0.1);
}

/* Mobile-specific animations */
@keyframes mobileSlideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-slide-in {
    animation: mobileSlideIn 0.3s ease-out;
}

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