/* Mobile-specific CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #222;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.loading-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loading-text {
    color: white;
    font-size: 18px;
    font-weight: 500;
    animation: pulse 2s infinite;
}

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

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

/* Mobile Header */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
}

.mobile-logo {
    height: 45px;
    width: 45px;
    cursor: pointer;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

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

.mobile-title {
    flex: 1;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 15px;
}

.mobile-hamburger {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    color: #333;
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-hamburger:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    overflow-y: auto;
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu-header {
    padding: 60px 25px 25px;
    color: white;
}

.mobile-menu-header h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.mobile-menu-header p {
    opacity: 0.9;
    font-size: 14px;
}

.mobile-menu-content {
    padding: 25px;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-item:hover {
    color: #667eea;
}

.mobile-menu-item .material-symbols-outlined {
    font-size: 24px;
    color: #666;
}

.mobile-menu-item:hover .material-symbols-outlined {
    color: #667eea;
}

.mobile-logout-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.mobile-logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Main Content */
.mobile-main {
    padding-top: 80px;
    min-height: 100vh;
}

/* Mobile Auth Screen */
.mobile-auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 20px;
}

.mobile-auth-container {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 35px 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-auth-header {
    text-align: center;
    margin-bottom: 35px;
}

.mobile-auth-logo {
    width: 90px;
    height: 90px;
    margin-bottom: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.mobile-auth-header h1 {
    font-size: 26px;
    margin-bottom: 10px;
    color: #333;
    font-weight: 700;
}

.mobile-auth-header p {
    color: #666;
    font-size: 15px;
    line-height: 1.5;
}

/* Mobile Auth Forms */
.mobile-auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.mobile-auth-form input,
.mobile-auth-form textarea,
.mobile-auth-form select {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 16px;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    font-family: inherit;
}

.mobile-auth-form input:focus,
.mobile-auth-form textarea:focus,
.mobile-auth-form select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.mobile-primary-btn {
    width: 100%;
    padding: 16px;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mobile-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.mobile-secondary-btn {
    width: 100%;
    padding: 16px;
    background: transparent;
    color: #666;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mobile-secondary-btn:hover {
    background: rgba(102, 126, 234, 0.05);
    border-color: #667eea;
    color: #667eea;
}

.mobile-switch-auth {
    text-align: center;
    margin-top: 25px;
    color: #666;
    font-size: 15px;
}

.mobile-switch-auth a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Mobile Form Groups */
.mobile-form-group {
    margin-bottom: 20px;
}

.mobile-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

/* Mobile Upload Button */
.mobile-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mobile-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.mobile-logo-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 15px;
    border: 3px solid #f0f0f0;
    margin: 0 auto;
    display: block;
}

.mobile-logo-text {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
}

/* Mobile Feed */
.mobile-feed {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Mobile Post Creation */
.mobile-post-create {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-post-create h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.mobile-post-form textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    font-size: 16px;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    transition: all 0.3s ease;
}

.mobile-post-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mobile-post-options {
    margin-bottom: 20px;
}

.mobile-post-options select {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    font-size: 16px;
    background: white;
    margin-bottom: 12px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.mobile-post-options select:focus {
    outline: none;
    border-color: #667eea;
}

.mobile-post-actions {
    display: flex;
    justify-content: flex-end;
}

.mobile-post-btn {
    padding: 14px 28px;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mobile-post-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Mobile Posts Feed */
.mobile-posts-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Mobile Post Item */
.mobile-post {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease;
}

.mobile-post:hover {
    transform: translateY(-2px);
}

.mobile-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.mobile-post-avatar {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 15px;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.mobile-post-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 16px;
}

.mobile-post-time {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

.mobile-post-content {
    color: #333;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 15px;
}

.mobile-post-actions {
    display: flex;
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.mobile-post-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: none;
    border: none;
    border-radius: 25px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mobile-post-action:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.mobile-post-action.liked {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.mobile-post-action .material-symbols-outlined {
    font-size: 20px;
}

/* Mobile Status Bar */
.mobile-status-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.mobile-status-bar h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 18px;
}

.mobile-status-bar p {
    color: #666;
    font-size: 14px;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 0;
    z-index: 999;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
}

.mobile-bottom-nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.mobile-nav-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.mobile-nav-item:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.mobile-nav-item .material-symbols-outlined {
    font-size: 24px;
}

.mobile-nav-item span:last-child {
    font-size: 11px;
    font-weight: 500;
}

/* Mobile Floating Action Button */
.mobile-fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
}

/* Mobile Pull to Refresh */
.mobile-pull-refresh {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

.mobile-pull-refresh.active {
    color: #667eea;
}

/* Mobile Empty State */
.mobile-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.mobile-empty-state .material-symbols-outlined {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.mobile-empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.mobile-empty-state p {
    font-size: 14px;
    line-height: 1.6;
}

/* Mobile Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.mobile-post {
    animation: slideInUp 0.5s ease;
}

.mobile-auth-container {
    animation: fadeIn 0.5s ease;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .mobile-auth-container {
        padding: 25px 20px;
        margin: 15px;
        border-radius: 20px;
    }
    
    .mobile-feed {
        padding: 15px;
    }
    
    .mobile-post-create,
    .mobile-post {
        padding: 20px;
        border-radius: 15px;
    }
    
    .mobile-header {
        padding: 10px 15px;
    }
    
    .mobile-title {
        font-size: 18px;
    }
    
    .mobile-menu {
        width: 90%;
    }
}

@media (max-width: 360px) {
    .mobile-auth-container {
        padding: 20px 15px;
        margin: 10px;
    }
    
    .mobile-feed {
        padding: 10px;
    }
    
    .mobile-post-create,
    .mobile-post {
        padding: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .mobile-header {
        background: rgba(44, 62, 80, 0.95);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-title {
        color: #ecf0f1;
    }
    
    .mobile-hamburger {
        color: #ecf0f1;
    }
    
    .mobile-auth-container,
    .mobile-post-create,
    .mobile-post {
        background: rgba(52, 73, 94, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-auth-header h1,
    .mobile-auth-form h2,
    .mobile-post-create h3,
    .mobile-post-name {
        color: #ecf0f1;
    }
    
    .mobile-auth-header p,
    .mobile-post-content {
        color: #bdc3c7;
    }
    
    .mobile-auth-form input,
    .mobile-auth-form textarea,
    .mobile-auth-form select,
    .mobile-post-form textarea {
        background: rgba(44, 62, 80, 0.8);
        border-color: rgba(255, 255, 255, 0.2);
        color: #ecf0f1;
    }
    
    .mobile-auth-form input::placeholder,
    .mobile-auth-form textarea::placeholder,
    .mobile-post-form textarea::placeholder {
        color: #95a5a6;
    }
}

/* Hide elements on mobile */
.hidden {
    display: none !important;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Touch improvements */
.mobile-post-action,
.mobile-nav-item,
.mobile-hamburger,
.mobile-logo {
    -webkit-tap-highlight-color: transparent;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .mobile-main {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .mobile-bottom-nav {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}
