* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FF6B35;
    --secondary: #F7931E;
    --accent: #FCB045;
    --bg: #1A0F0A;
    --surface: #2D1810;
    --card: #3D2418;
    --text: #FFF5E6;
    --text-secondary: #D4A574;
    --border: #5D3A24;
    --white: #FFFFFF;
    --gradient: linear-gradient(135deg, #FF6B35 0%, #F7931E 50%, #FCB045 100%);
    --glass: rgba(255, 255, 255, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(252, 176, 69, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(247, 147, 30, 0.15) 0%, transparent 50%);
}

.screen {
    display: none;
    min-height: 100vh;
    overflow: hidden;
}

.screen.active {
    display: block;
}

/* Auth Screen */
.auth-container {
    max-width: 440px;
    margin: 0 auto;
    padding: 50px 30px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-logo {
    font-size: 90px;
    margin-bottom: 25px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(255, 107, 53, 0.4));
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.auth-container h1 {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    font-size: 2.8em;
    font-weight: 800;
    letter-spacing: -1px;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 50px;
    font-size: 17px;
    font-weight: 500;
}

.auth-form {
    margin-top: 35px;
}

.input-group {
    position: relative;
    margin-bottom: 18px;
}

.input-group svg {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: all 0.3s;
}

.input-group:focus-within svg {
    color: var(--primary);
    opacity: 1;
}

.auth-container input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid rgba(255, 107, 53, 0.2);
    border-radius: 14px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: rgba(45, 24, 16, 0.6);
    color: var(--text);
    backdrop-filter: blur(20px);
    font-weight: 500;
}

.auth-container input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    font-weight: 400;
}

.auth-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15), 0 8px 25px rgba(255, 107, 53, 0.2);
    background: rgba(45, 24, 16, 0.8);
    transform: translateY(-2px);
}

.btn-primary {
    width: 100%;
    padding: 17px;
    background: var(--gradient);
    color: var(--white);
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 10px 35px rgba(255, 107, 53, 0.4);
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 45px rgba(255, 107, 53, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    padding: 17px;
    background: transparent;
    color: var(--text);
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 53, 0.1);
    transform: translateY(-2px);
}

.btn-text {
    width: 100%;
    padding: 12px;
    background: none;
    color: #666;
    border: none;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
}

.loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.auth-note {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 25px;
    font-weight: 500;
    opacity: 0.8;
}

#recaptcha-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Profile Setup */
.profile-setup-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    text-align: center;
}

.profile-photo-upload {
    margin: 20px 0;
}

.profile-photo-upload img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.profile-photo-upload input {
    display: none;
}

.profile-photo-upload label {
    display: inline-block;
    padding: 8px 16px;
    background: var(--secondary);
    color: var(--white);
    border-radius: 6px;
    cursor: pointer;
}

.profile-setup-container input[type="text"] {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
}

.profile-setup-container button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

/* App Screen */
#appScreen {
    padding-bottom: 90px;
}

.bottom-nav {
    position: fixed;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(45, 24, 16, 0.95);
    display: flex;
    justify-content: space-around;
    padding: 10px 5px;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,107,53,0.2);
    z-index: 1000;
    backdrop-filter: blur(20px);
}

.nav-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 18px;
    transition: all 0.3s ease;
    position: relative;
    min-width: 50px;
    min-height: 50px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--gradient);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    transform: scale(1.05);
}

.nav-btn svg {
    transition: all 0.3s ease;
    opacity: 0.6;
}

.nav-btn.active svg {
    opacity: 1;
    stroke: white;
}

.tab-content {
    display: none;
}

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

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h2 {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.header button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    color: var(--white);
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
}

.header button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.4);
}

/* Chats List */
#chatsList {
    padding: 10px 15px;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: var(--white);
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.chat-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.chat-item-info {
    flex: 1;
}

.chat-item-info h4 {
    margin-bottom: 4px;
}

.chat-item-info p {
    color: #666;
    font-size: 14px;
}

/* Chat Screen */
.chat-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.chat-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px;
}

.chat-user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-user-info img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

#messagesContainer {
    height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 15px;
    -webkit-overflow-scrolling: touch;
}

#chatMessages {
    position: relative;
    z-index: 1;
}

.message {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-end;
    gap: 8px;
}

.message.sent {
    justify-content: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--white);
}

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

.message-bubble img {
    max-width: 100%;
    border-radius: 8px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

.message-input {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    display: flex;
    padding: 10px 15px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 90;
}

.message-input button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 5px;
    -webkit-tap-highlight-color: transparent;
    min-width: 60px;
}

.message-input input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    -webkit-appearance: none;
}

/* Reel-style Posts */
.post-reel {
    height: calc(100vh - 140px);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: #000;
    position: relative;
    overflow: hidden;
}

.post-reel-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    padding: 15px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.post-reel-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.post-reel-username {
    color: white;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    letter-spacing: 0.3px;
}

.post-reel-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
}

.post-reel-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.post-reel-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    color: white;
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 100%);
    padding: 20px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.6;
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.post-reel-caption strong {
    font-weight: 700;
    margin-right: 8px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Bottom Nav */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(135deg, rgba(45, 24, 16, 0.98) 0%, rgba(61, 36, 24, 0.98) 100%);
    display: flex;
    justify-content: space-around;
    padding: 12px 8px;
    border-radius: 0 !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,107,53,0.2), inset 0 1px 0 rgba(255,107,53,0.1);
    z-index: 1000;
    backdrop-filter: blur(30px);
}

.nav-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 12px 18px;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 56px;
    min-height: 56px;
}

.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.nav-btn:hover::before {
    opacity: 0.1;
}

.nav-btn.active {
    background: var(--gradient);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: scale(1.08) translateY(-3px);
}

.nav-btn svg {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.nav-btn.active svg {
    opacity: 1;
    stroke: white;
    transform: scale(1.1);
}

/* Enhanced Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(45, 24, 16, 0.98) 0%, rgba(61, 36, 24, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 107, 53, 0.2);
    backdrop-filter: blur(30px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.header h2 {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 24px;
    letter-spacing: 0.5px;
    filter: drop-shadow(0 2px 4px rgba(255, 107, 53, 0.3));
}

.header button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient);
    color: var(--white);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header button:hover {
    transform: scale(1.12) rotate(90deg);
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.6);
}

.header button:active {
    transform: scale(1.05) rotate(90deg);
}

/* Status List */
#statusList {
    padding: 10px;
    display: flex;
    overflow-x: auto;
    gap: 10px;
}

.status-item {
    min-width: 80px;
    text-align: center;
    cursor: pointer;
}

.status-item img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.status-item p {
    font-size: 12px;
    margin-top: 5px;
}

/* Profile */
#profileContent {
    padding: 20px;
    text-align: center;
}

#profileContent img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

#logoutBtn {
    margin: 20px;
    padding: 12px;
    background: #dc3545;
    color: var(--white);
    border: none;
    border-radius: 8px;
    width: calc(100% - 40px);
    cursor: pointer;
}

/* Profile Tab Enhancements */
#editProfileBtn:hover,
#logoutBtn:hover {
    background: var(--card);
    border-color: var(--primary);
    transform: translateY(-1px);
}

#editProfileBtn:active,
#logoutBtn:active {
    transform: translateY(0);
}

.profile-tab:hover {
    background: rgba(255, 107, 53, 0.05);
}

#myPostsGrid > div,
#myReelsGrid > div {
    aspect-ratio: 1;
    background: var(--card);
    border-radius: 0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

#myPostsGrid > div:hover,
#myReelsGrid > div:hover {
    transform: scale(0.98);
    opacity: 0.9;
}

#myPostsGrid > div::after,
#myReelsGrid > div::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.4) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

#myPostsGrid > div:hover::after,
#myReelsGrid > div:hover::after {
    opacity: 1;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.modal-content input,
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
}

.modal-content button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
}

.modal-content .close-modal {
    background: #666;
}

#postImagePreview {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.user-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.user-item:hover {
    background: var(--bg);
}
/* Settings */
#settingsContent {
    padding: 20px;
}

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

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

.setting-item span {
    font-size: 16px;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.setting-item button {
    padding: 8px 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Contacts */
#contactsList {
    padding: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--white);
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
}

.contact-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.contact-item-info {
    flex: 1;
}

.contact-item-info h4 {
    margin-bottom: 4px;
}

.contact-item-info p {
    color: #666;
    font-size: 14px;
}
/* Search Bar */
.search-bar {
    padding: 15px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 25px;
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
    background: var(--surface);
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

/* Search Results User Items */
#searchResults .user-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

#searchResults .user-item:hover {
    background: var(--surface);
}

#searchResults .user-item:active {
    transform: scale(0.98);
    background: var(--card);
}
/* Floating Add Button */
.floating-add-btn {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    z-index: 99;
}

.floating-add-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6);
}
/* Contacts Profile Section */
.profile-section {
    padding: 20px;
}

.profile-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
}

.profile-photo-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.profile-photo-container img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.edit-photo-btn {
    position: absolute;
    bottom: 5px;
    right: calc(50% - 70px);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    border: 3px solid var(--surface);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.edit-photo-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item label {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item input,
.info-item textarea,
.info-item select {
    padding: 12px 16px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s ease;
    resize: none;
}

.info-item input:focus,
.info-item textarea:focus,
.info-item select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
    background: var(--surface);
}

.info-item textarea {
    min-height: 80px;
    font-family: inherit;
}

.save-profile-btn {
    margin-top: 20px;
    padding: 16px;
    background: var(--gradient);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.save-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.4);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .header {
        padding: 12px 15px;
    }
    
    .header h2 {
        font-size: 20px;
    }
    
    .header button {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .bottom-nav {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 8px 5px;
    }
    
    .nav-btn {
        padding: 10px 14px;
        min-width: 52px;
        min-height: 52px;
        border-radius: 18px;
    }
    
    .nav-btn svg {
        width: 26px;
        height: 26px;
    }
}

/* Touch-friendly inputs */
input, textarea, button, select {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button {
    min-height: 44px;
    min-width: 44px;
}

.btn-primary, .btn-secondary {
    min-height: 48px;
    font-size: 16px;
}

/* Smooth scrolling */
#homeFeed {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* Message input mobile */
.message-input input[type="text"] {
    font-size: 16px;
    min-height: 44px;
}

.message-input button {
    min-height: 44px;
    min-width: 70px;
    font-size: 15px;
}

/* Modal mobile */
.upload-modal-content {
    max-width: 95%;
    max-height: 95vh;
}

#uploadCaption {
    font-size: 16px;
    min-height: 100px;
}

#postUploadBtn {
    min-height: 50px;
    font-size: 17px;
}

/* Search mobile */
.search-bar input {
    font-size: 16px;
    min-height: 44px;
}

/* Auth mobile */
.auth-container input {
    font-size: 16px;
    min-height: 48px;
}

/* Prevent zoom on input focus */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    font-size: 16px !important;
}

/* Reel swipe area */
.post-reel {
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

/* Better tap targets */
.chat-item,
.user-item,
.contact-item {
    min-height: 60px;
    padding: 12px 15px;
}

/* Upload modal close button */
.upload-modal-header button {
    min-width: 44px;
    min-height: 44px;
    font-size: 32px;
}

/* ============================================
   MOBILE-FIRST OPTIMIZATIONS
   ============================================ */

/* Base mobile styles */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
}

/* All interactive elements */
button, a, input, textarea, select {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* Prevent zoom on input focus */
input, textarea, select {
    font-size: 16px !important;
}

/* Smooth scrolling */
* {
    -webkit-overflow-scrolling: touch;
}

/* Header mobile */
.header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    padding: 12px 15px !important;
}

.header h2 {
    font-size: 20px !important;
}

.header button {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
}

.header svg {
    width: 26px !important;
    height: 26px !important;
}

/* Bottom nav mobile */
.bottom-nav {
    position: fixed !important;
    bottom: 8px !important;
    left: 8px !important;
    right: 8px !important;
    padding: 8px 6px !important;
    border-radius: 28px !important;
}

.nav-btn {
    min-width: 56px !important;
    min-height: 56px !important;
    padding: 12px 16px !important;
    border-radius: 20px !important;
}

.nav-btn svg {
    width: 28px !important;
    height: 28px !important;
}

/* Chat items mobile */
.chat-item, .user-item, .contact-item {
    min-height: 68px !important;
    padding: 14px !important;
    margin-bottom: 10px !important;
}

.chat-item img,
.user-item img,
.contact-item img {
    width: 52px !important;
    height: 52px !important;
}

/* Message input mobile */
.message-input {
    padding: 10px 15px !important;
    bottom: 70px !important;
    gap: 10px !important;
}

.message-input input {
    font-size: 16px !important;
    padding: 14px !important;
    min-height: 48px !important;
}

.message-input button {
    min-height: 48px !important;
    min-width: 70px !important;
    padding: 14px 18px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
}

/* Chat messages mobile */
#chatMessages {
    padding: 12px !important;
    height: calc(100vh - 190px) !important;
}

.message-bubble {
    max-width: 80% !important;
    padding: 12px 14px !important;
    font-size: 15px !important;
}

/* Search input mobile */
#searchInput {
    font-size: 16px !important;
    padding: 14px 18px !important;
    min-height: 50px !important;
}

#searchBtn {
    min-width: 54px !important;
    min-height: 54px !important;
    padding: 14px !important;
}

/* Auth forms mobile */
.auth-container {
    padding: 20px 15px !important;
}

.auth-container input {
    font-size: 16px !important;
    padding: 16px 16px 16px 52px !important;
    min-height: 54px !important;
}

.btn-primary, .btn-secondary {
    min-height: 54px !important;
    font-size: 17px !important;
    padding: 16px !important;
    font-weight: 600 !important;
}

/* Profile mobile */
.profile-container {
    padding: 15px !important;
}

.profile-header {
    padding: 20px !important;
    gap: 15px !important;
}

.profile-photo {
    width: 100px !important;
    height: 100px !important;
    font-size: 42px !important;
}

.profile-name {
    font-size: 24px !important;
}

.profile-bio {
    padding: 20px !important;
    font-size: 15px !important;
}

.action-btn {
    padding: 16px !important;
    font-size: 16px !important;
    min-height: 52px !important;
    font-weight: 600 !important;
}

.back-btn {
    min-height: 48px !important;
    padding: 12px 20px !important;
    font-size: 17px !important;
}

/* Upload modal mobile */
.upload-modal-content {
    width: 95% !important;
    max-height: 90vh !important;
}

#uploadCaption {
    font-size: 16px !important;
    min-height: 110px !important;
    padding: 16px !important;
}

#postUploadBtn {
    min-height: 54px !important;
    font-size: 17px !important;
    padding: 16px !important;
    font-weight: 600 !important;
}

.upload-modal-header button {
    min-width: 48px !important;
    min-height: 48px !important;
    font-size: 32px !important;
}

/* Requests button mobile */
#requestsTabBtn {
    padding: 10px 14px !important;
    font-size: 13px !important;
    min-height: 40px !important;
    border-radius: 8px !important;
}

/* Post reel mobile */
.post-reel {
    height: calc(100vh - 130px) !important;
}

.post-reel-header {
    padding: 12px !important;
    top: 15px !important;
    left: 12px !important;
    right: 12px !important;
}

.post-reel-avatar {
    width: 38px !important;
    height: 38px !important;
    font-size: 15px !important;
}

.post-reel-username {
    font-size: 15px !important;
}

.post-reel-caption {
    bottom: 15px !important;
    left: 12px !important;
    right: 12px !important;
    padding: 16px !important;
    font-size: 14px !important;
}

/* Home feed mobile */
#homeFeed {
    height: calc(100vh - 130px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    will-change: scroll-position !important;
}

/* Optimize rendering */
.post-card {
    contain: layout style paint !important;
    content-visibility: auto !important;
}

/* Prevent layout shifts */
#homeFeed > div {
    min-height: 500px !important;
}

/* Smooth transitions */
.tab-content {
    transition: none !important;
}

/* Prevent reflow */
img, video {
    max-width: 100% !important;
    height: auto !important;
}

/* GPU acceleration */
.nav-btn,
.header button {
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    perspective: 1000px !important;
}

/* Chats list mobile */
#chatsList {
    padding: 8px 12px !important;
}

/* Search results mobile */
#searchResults {
    max-height: calc(100vh - 260px) !important;
}

/* Profile content mobile */
#profileContent {
    padding: 15px !important;
}

/* Tab content mobile */
.tab-content {
    padding-bottom: 80px !important;
}

/* Chat header mobile */
.chat-header {
    padding: 10px 12px !important;
}

#chatUserPhoto {
    width: 38px !important;
    height: 38px !important;
}

#chatUserName {
    font-size: 15px !important;
}

#chatUserStatus {
    font-size: 11px !important;
}

#backToChats {
    font-size: 22px !important;
    padding: 8px !important;
    min-width: 40px !important;
}

/* Landscape mode adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .bottom-nav {
        bottom: 4px !important;
        padding: 4px 2px !important;
    }
    
    .nav-btn {
        min-height: 40px !important;
        padding: 6px 10px !important;
    }
    
    .header {
        padding: 8px 10px !important;
    }
    
    #chatMessages {
        height: calc(100vh - 150px) !important;
    }
    
    .message-input {
        bottom: 50px !important;
    }
}

/* Small phones (< 375px) */
@media (max-width: 374px) {
    .header h2 {
        font-size: 16px !important;
    }
    
    .nav-btn {
        min-width: 45px !important;
        min-height: 45px !important;
    }
    
    .profile-photo {
        width: 80px !important;
        height: 80px !important;
        font-size: 34px !important;
    }
    
    .action-btn {
        font-size: 14px !important;
        padding: 12px !important;
    }
}

/* Large phones (> 414px) */
@media (min-width: 415px) {
    .header h2 {
        font-size: 20px !important;
    }
    
    .profile-photo {
        width: 100px !important;
        height: 100px !important;
        font-size: 42px !important;
    }
}

/* Tablets */
@media (min-width: 768px) {
    .profile-container,
    .auth-container {
        max-width: 600px !important;
        margin: 0 auto !important;
    }
    
    .bottom-nav {
        max-width: 600px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .header {
        padding-top: max(10px, env(safe-area-inset-top)) !important;
    }
    
    .bottom-nav {
        padding-bottom: max(6px, env(safe-area-inset-bottom)) !important;
        bottom: max(8px, env(safe-area-inset-bottom)) !important;
    }
    
    .message-input {
        padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
    }
}

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

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-primary, .action-btn {
        border: 2px solid white !important;
    }
}

/* ============================================
   ADDITIONAL MOBILE TOUCH OPTIMIZATIONS
   ============================================ */

/* Attach button */
#attachBtn, #voiceBtn {
    min-width: 50px !important;
    min-height: 50px !important;
    padding: 12px !important;
    font-size: 24px !important;
}

/* Send button */
#sendMessageBtn {
    min-width: 80px !important;
    min-height: 52px !important;
    padding: 16px 20px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

/* Profile edit button */
#editProfileBtn {
    min-height: 56px !important;
    padding: 18px !important;
    font-size: 17px !important;
    font-weight: 600 !important;
}

/* Logout button */
#logoutBtn {
    min-height: 56px !important;
    padding: 18px !important;
    font-size: 17px !important;
    font-weight: 600 !important;
}

/* Tab buttons */
#postsTabBtn, #reelsTabBtn {
    min-height: 50px !important;
    padding: 14px !important;
    font-size: 16px !important;
}

/* Chat filter tabs */
.chat-filter-tab {
    min-height: 46px !important;
    padding: 12px 14px !important;
    font-size: 16px !important;
}

/* Upload menu items */
#uploadMenu > div {
    min-height: 54px !important;
    padding: 16px !important;
    font-size: 16px !important;
}

/* Attach menu items */
#attachMenu > div {
    min-height: 54px !important;
    padding: 16px !important;
    font-size: 16px !important;
}

/* Story circles */
.story-circle {
    min-width: 70px !important;
    min-height: 70px !important;
}

/* Profile grid items */
#myPostsGrid > div,
#myReelsGrid > div {
    min-height: 120px !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(255, 107, 53, 0.1) !important;
}

/* Modal close buttons */
.custom-confirm-box button {
    min-height: 44px !important;
    min-width: 80px !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
}

/* Like/comment/share buttons on posts */
svg[style*="cursor: pointer"] {
    padding: 8px !important;
    margin: -8px !important;
}

/* Reel interaction buttons */
.reel-action-btn {
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 10px !important;
}

/* Search button */
.search-btn {
    min-width: 48px !important;
    min-height: 48px !important;
}

/* Back button */
.back-btn, #backToChats {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 10px !important;
}

/* Increase tap target for small icons */
.header svg {
    padding: 10px !important;
    margin: -10px !important;
}

/* Better spacing for touch */
.message-input {
    gap: 10px !important;
}

/* Comfortable input fields */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    padding: 14px 16px !important;
    min-height: 48px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

/* Better button spacing */
button + button {
    margin-left: 8px !important;
}

/* Comfortable list items */
.user-item,
.chat-item,
.contact-item {
    padding: 14px 16px !important;
    min-height: 64px !important;
}

/* Profile stats clickable area */
.profile-stat {
    min-width: 60px !important;
    min-height: 50px !important;
    padding: 8px !important;
}

/* Menu items */
.menu-item {
    min-height: 52px !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
}

/* Prevent accidental zooms */
select {
    font-size: 16px !important;
}

/* Better touch feedback */
button:active,
.nav-btn:active,
.chat-item:active,
.user-item:active {
    opacity: 0.7 !important;
    transform: scale(0.98) !important;
}

/* Smooth transitions */
button,
.nav-btn,
.chat-item,
.user-item {
    transition: all 0.15s ease !important;
}

/* Comfortable modal buttons */
.modal-content button {
    min-height: 48px !important;
    padding: 14px !important;
    font-size: 16px !important;
    margin-top: 12px !important;
}

/* Upload button */
#postUploadBtn,
#uploadPostBtn {
    min-height: 52px !important;
    padding: 16px !important;
    font-size: 17px !important;
    font-weight: 600 !important;
}

/* Close modal button */
#closeUploadModal {
    min-width: 44px !important;
    min-height: 44px !important;
    font-size: 32px !important;
}

/* Story upload button */
.story-upload-btn {
    min-width: 70px !important;
    min-height: 70px !important;
}

/* Follow/Unfollow buttons */
.follow-btn,
.unfollow-btn {
    min-height: 40px !important;
    min-width: 90px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
}

/* Delete menu button */
.delete-menu-btn {
    min-width: 36px !important;
    min-height: 36px !important;
}

/* Comfortable spacing for mobile */
@media (max-width: 768px) {
    /* Increase all gaps */
    .flex-gap {
        gap: 12px !important;
    }
    
    /* Better padding */
    .container {
        padding: 16px !important;
    }
    
    /* Larger touch targets for icons */
    svg {
        min-width: 24px !important;
        min-height: 24px !important;
    }
    
    /* Comfortable margins */
    .mb-1 { margin-bottom: 8px !important; }
    .mb-2 { margin-bottom: 12px !important; }
    .mb-3 { margin-bottom: 16px !important; }
    
    /* Better line height for readability */
    p, span, div {
        line-height: 1.6 !important;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    /* Slightly smaller but still comfortable */
    button {
        min-height: 42px !important;
        font-size: 14px !important;
    }
    
    input, textarea {
        min-height: 44px !important;
        font-size: 15px !important;
    }
    
    .nav-btn {
        min-width: 46px !important;
        min-height: 46px !important;
    }
}

/* Chat Icon Buttons Hover Effect */
.chat-icon-btn:hover {
    background: rgba(255, 107, 53, 0.1) !important;
}

.chat-icon-btn:active {
    transform: scale(0.9);
}

#sendMessageBtn:hover {
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.6);
    transform: scale(1.05);
}

#sendMessageBtn:active {
    transform: scale(0.95);
}

#plusBtn:hover {
    background: rgba(255, 107, 53, 0.1) !important;
}

#micBtn:active {
    transform: scale(1.1);
    transition: transform 0.1s;
}

#messageInput {
    line-height: 20px;
    resize: none;
}
