:root {
    --primary-white: #ffffff;
    --secondary-white: #f8f9fa;
    --deep-purple: #6d28d9;
    --dark-violet: #4c1d95;
    --light-purple: #8b5cf6;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --gray-light: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

[data-theme="dark"] {
    --primary-white: #121212;
    --secondary-white: #1e1e1e;
    --text-dark: #f3f4f6;
    --text-light: #d1d5db;
    --gray-light: #374151;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--primary-white);
    color: var(--text-dark);
    transition: background-color var(--transition-normal);
    overflow-x: hidden;
    touch-action: manipulation;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-white);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--deep-purple);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-violet);
}

/* Loading Animation */
.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-light);
    border-top: 4px solid var(--deep-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Authentication Pages */
.auth-page {
    display: none;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--deep-purple), var(--dark-violet));
    padding: 1rem;
}

.auth-page.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    background: var(--primary-white);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease;
}

.auth-logo {
    width: 80px;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

.auth-title {
    color: var(--deep-purple);
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.auth-subtitle {
    color: var(--text-light);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Password input container */
.password-container {
    position: relative;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 2;
}

.toggle-password:hover {
    color: var(--deep-purple);
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-white);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    transition: all var(--transition-normal);
    transform: translateY(0);
    animation: slideDown 0.5s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.nav-hidden {
    transform: translateY(-100%);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    height: 35px;
    transition: transform var(--transition-fast);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 1rem;
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.8rem;
    border: 2px solid var(--gray-light);
    border-radius: 20px;
    background: var(--secondary-white);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    -webkit-appearance: none;
}

.search-bar:focus {
    outline: none;
    border-color: var(--deep-purple);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    border: 1px solid var(--gray-light);
}

.search-results.active {
    display: block;
    animation: dropdownAppear 0.3s ease;
}

@keyframes dropdownAppear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--gray-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(109, 40, 217, 0.1);
}

.search-result-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.search-result-item div {
    flex: 1;
    min-width: 0;
}

.search-result-item h4 {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item p {
    color: var(--text-light);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Search Icon */
.mobile-search-icon {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1rem;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: var(--secondary-white);
}

/* Mobile Search Modal */
.mobile-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-white);
    z-index: 2000;
    padding: 1rem;
    flex-direction: column;
    overflow: hidden;
}

.mobile-search-modal.active {
    display: flex;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.mobile-search-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
    flex-shrink: 0;
}

.mobile-search-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--secondary-white);
}

.mobile-search-results {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-icons {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.nav-icon {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-white);
    color: var(--text-dark);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    -webkit-appearance: none;
}

.nav-icon:hover {
    background: var(--deep-purple);
    color: white;
    transform: translateY(-2px);
}

.notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Dropdown Menus */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--primary-white);
    min-width: 250px;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    z-index: 1000;
    animation: dropdownAppear 0.3s ease;
    margin-top: 8px;
    border: 1px solid var(--gray-light);
    max-height: 400px;
    overflow-y: auto;
}

.dropdown.active .dropdown-content {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--gray-light);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(109, 40, 217, 0.1);
    color: var(--deep-purple);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* Notification items */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--gray-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: rgba(109, 40, 217, 0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.notification-icon.like {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.notification-icon.comment {
    background: linear-gradient(135deg, #10b981, #059669);
}

.notification-icon.follow {
    background: linear-gradient(135deg, var(--deep-purple), var(--dark-violet));
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.2rem;
}

.notification-time {
    color: var(--text-light);
    font-size: 0.75rem;
}

.notification-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-light);
}

.notification-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Chat Modal */
.chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2001;
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chat-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-white);
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    height: 80vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--gray-light);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--gray-light);
    background: var(--primary-white);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.chat-header-info img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: var(--secondary-white);
    -webkit-overflow-scrolling: touch;
}

.message {
    max-width: 70%;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.sent {
    background: var(--deep-purple);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.received {
    background: var(--gray-light);
    color: var(--text-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.3rem;
    text-align: right;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--gray-light);
    background: var(--primary-white);
}

.chat-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 25px;
    font-size: 0.95rem;
    background: var(--secondary-white);
}

.chat-input:focus {
    outline: none;
    border-color: var(--deep-purple);
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--deep-purple);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-send-btn:hover {
    transform: scale(1.05);
    background: var(--dark-violet);
}

/* Group Chat Modal */
.group-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2002;
    display: none;
    animation: fadeIn 0.3s ease;
}

.group-chat-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-white);
    border-radius: 15px;
    width: 95%;
    max-width: 600px;
    height: 85vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--gray-light);
}

.group-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--gray-light);
    background: var(--primary-white);
}

.group-chat-members {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
    max-height: 120px;
    overflow-y: auto;
    background: var(--secondary-white);
}

.member-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.member-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(109, 40, 217, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.member-badge img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    padding: 0.6rem 0;
    animation: slideUp 0.5s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: 15px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    min-width: 60px;
    -webkit-tap-highlight-color: transparent;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(109, 40, 217, 0.1), transparent);
    transition: left 0.7s;
}

.nav-item:hover::before {
    left: 100%;
}

.nav-item.active {
    color: var(--deep-purple);
    background: rgba(109, 40, 217, 0.1);
}

.nav-item i {
    font-size: 1.2rem;
    transition: transform var(--transition-fast);
}

.nav-item:hover i {
    transform: scale(1.2);
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 70px auto 70px;
    padding: 1rem;
    animation: fadeInContent 0.5s ease;
    width: 100%;
    scroll-behavior: smooth;
}

@keyframes fadeInContent {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-content {
    display: none;
    width: 100%;
}

.page-content.active {
    display: block;
}

/* Card Animations */
.card {
    background: var(--primary-white);
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    transition: all var(--transition-normal);
    opacity: 0;
    transform: translateY(20px);
    animation: cardAppear 0.5s ease forwards;
    border: 1px solid var(--gray-light);
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Post Animations */
.post {
    animation: slideInRight 0.3s ease;
}

.like-animation {
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.1); }
}

/* Button Animations */
.btn {
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, var(--deep-purple), var(--dark-violet));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(109, 40, 217, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--deep-purple);
    color: var(--deep-purple);
}

.btn-outline:hover {
    background: rgba(109, 40, 217, 0.1);
}

.follow-btn {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: 20px;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    font-family: inherit;
    white-space: nowrap;
}

.follow-btn.following {
    background: var(--deep-purple);
    color: white;
}

.follow-btn.not-following {
    background: rgba(109, 40, 217, 0.1);
    color: var(--deep-purple);
}

.follow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.2);
}

/* Form Animations */
.form-input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    background: var(--primary-white);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    color: var(--text-dark);
}

.form-input:focus {
    outline: none;
    border-color: var(--deep-purple);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
}

/* Select dropdown styling */
select.form-input {
    color: var(--text-dark);
    background-color: var(--primary-white);
}

select.form-input option {
    background-color: var(--primary-white);
    color: var(--text-dark);
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 0.3rem;
    margin: 1.5rem 0 1rem;
    border-bottom: 2px solid var(--gray-light);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar {
    display: none;
}

.profile-tab {
    padding: 0.7rem 1rem;
    background: none;
    border: none;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    white-space: nowrap;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.profile-tab.active {
    color: var(--deep-purple);
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--deep-purple);
    animation: tabUnderline 0.3s ease;
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
}

@keyframes tabUnderline {
    from { width: 0; }
    to { width: 100%; }
}

/* Grid Layout for Profile Posts */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin-top: 1rem;
    background-color: var(--gray-light);
}

.grid-item {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--primary-white);
    overflow: hidden;
    min-height: 120px;
}

.grid-item:hover {
    transform: scale(1.02);
    z-index: 1;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.grid-item:hover img {
    transform: scale(1.05);
}

/* Instagram-like post modal */
.post-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.post-modal-content {
    background: var(--primary-white);
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.post-modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.post-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.post-modal-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: var(--secondary-white);
}

.post-modal-info {
    padding: 1rem;
}

/* Text-only posts in grid */
.text-post {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(109, 40, 217, 0.1);
    color: var(--text-dark);
    font-size: 0.8rem;
    text-align: center;
    overflow: hidden;
    word-wrap: break-word;
}

/* File Upload */
.file-upload-container {
    margin: 1rem 0;
}

.upload-buttons {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(109, 40, 217, 0.1);
    color: var(--deep-purple);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.upload-btn:hover {
    background: rgba(109, 40, 217, 0.2);
}

.upload-btn input[type="file"] {
    display: none;
}

.file-preview {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.file-preview-item {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--secondary-white);
}

.file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-item .remove-file {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-preview-item .remove-file:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-white);
    border-radius: 15px;
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalAppear 0.3s ease;
    border: 1px solid var(--gray-light);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--gray-light);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--deep-purple);
    transform: rotate(90deg);
}

/* User Profile Card */
.user-profile-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--primary-white);
    border: 1px solid var(--gray-light);
    margin-bottom: 1rem;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.user-profile-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--deep-purple);
}

.user-profile-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.user-profile-info {
    flex: 1;
    min-width: 0;
}

.user-profile-info h3 {
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-profile-info p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.user-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-stat span:first-child {
    font-weight: 600;
    color: var(--deep-purple);
    font-size: 0.9rem;
}

/* Profile Cover Image */
.profile-cover-container {
    position: relative;
    height: 200px;
    border-radius: 15px 15px 0 0;
    overflow: hidden;
    margin: -1.2rem -1.2rem 0 -1.2rem;
    background: linear-gradient(135deg, var(--deep-purple), var(--dark-violet));
}

.profile-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-upload-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.cover-upload-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Image Cropper Modal - Instagram/LinkedIn Style */
.crop-modal .modal-content {
    max-width: 500px;
    width: 95%;
    max-height: 80vh;
}

.crop-container {
    width: 100%;
    height: 300px;
    margin: 1rem 0;
    overflow: hidden;
    background: var(--secondary-white);
}

.crop-container img {
    max-width: 100%;
    display: block;
}

.crop-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 1rem auto;
    border: 3px solid var(--deep-purple);
    background: var(--secondary-white);
}

.crop-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crop-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.crop-controls button {
    flex: 1;
    min-width: 120px;
}

.crop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--gray-light);
}

.crop-title {
    color: var(--deep-purple);
    font-size: 1.2rem;
    font-weight: 600;
}

/* Post Actions Dropdown */
.post-actions-dropdown {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.post-actions-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    z-index: 11;
    position: relative;
}

.post-actions-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--primary-white);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 1000;
    display: none;
    border: 1px solid var(--gray-light);
}

.post-actions-menu.show {
    display: block;
    animation: dropdownAppear 0.3s ease;
}

.post-action-item {
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--gray-light);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: var(--text-dark);
}

.post-action-item:last-child {
    border-bottom: none;
}

.post-action-item:hover {
    background: rgba(109, 40, 217, 0.1);
}

.post-action-item.delete {
    color: #ef4444;
}

.post-action-item.delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

.likes-modal .modal-content {
    max-width: 400px;
}

.likes-list {
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Certificate preview styles */
.certificate-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(109, 40, 217, 0.1);
    color: var(--text-dark);
    font-size: 0.8rem;
    text-align: center;
    overflow: hidden;
    word-wrap: break-word;
}

.certificate-preview i {
    font-size: 2rem;
    color: var(--deep-purple);
    margin-bottom: 0.5rem;
}

.file-name {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90%;
}

/* Profile tab specific styles */
.works-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.work-card {
    background: var(--primary-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 1px solid var(--gray-light);
}

.work-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.work-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--secondary-white);
}

.work-card-content {
    padding: 1rem;
}

.work-card-title {
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.work-card-text {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.work-card-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Certificates container */
.certificates-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.certificate-card {
    background: var(--primary-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 1px solid var(--gray-light);
    height: 300px;
    display: flex;
    flex-direction: column;
}

.certificate-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.certificate-preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(109, 40, 217, 0.05);
    padding: 1rem;
}

.certificate-card-content {
    padding: 1rem;
    border-top: 1px solid var(--gray-light);
}

.certificate-card-title {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.certificate-card-meta {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Comments Section */
.comments-section {
    margin-top: 1rem;
    border-top: 1px solid var(--gray-light);
    padding-top: 1rem;
}

.comment-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.comment-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 20px;
    font-size: 0.9rem;
    background: var(--secondary-white);
}

.comment-input:focus {
    outline: none;
    border-color: var(--deep-purple);
}

.comment-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--deep-purple);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.comments-list {
    max-height: 200px;
    overflow-y: auto;
}

.comment {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--gray-light);
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.comment-user {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.85rem;
}

.comment-time {
    color: var(--text-light);
    font-size: 0.75rem;
}

.comment-text {
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.7rem 0.8rem;
    }
    
    .search-container {
        display: none;
    }
    
    .mobile-search-icon {
        display: flex;
    }
    
    .main-content {
        margin: 65px auto 65px;
        padding: 0.8rem;
    }
    
    .nav-icons {
        gap: 0.6rem;
    }
    
    .nav-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
    
    .profile-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1px;
    }
    
    .post-modal-content {
        width: 95%;
        max-width: 95%;
        max-height: 95vh;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.2rem;
        max-width: 350px;
    }
    
    .auth-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .upload-buttons {
        gap: 0.5rem;
    }
    
    .upload-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .chat-modal-content {
        width: 95%;
        height: 85vh;
    }
    
    .message {
        max-width: 85%;
    }
    
    .profile-cover-container {
        height: 150px;
    }
    
    .post-actions-dropdown {
        top: 5px;
        right: 5px;
    }
    
    .works-container,
    .certificates-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .bottom-nav-container {
        padding: 0 0.3rem;
    }
    
    .nav-item {
        padding: 0.4rem 0.6rem;
        min-width: 55px;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
    
    .profile-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .file-preview-item {
        width: 60px;
        height: 60px;
    }
    
    .dropdown-content {
        min-width: 220px;
        right: -10px;
    }
    
    .modal-content {
        width: 98%;
        padding: 1rem;
    }
    
    .form-input {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    p { font-size: 0.9rem; }
    
    .profile-cover-container {
        height: 120px;
    }
    
    .post-modal-body {
        flex-direction: column;
    }
    
    .post-modal-image {
        max-height: 300px;
    }
    
    .post-actions-btn {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .nav-icons {
        gap: 0.4rem;
    }
    
    .nav-icon {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
    
    .bottom-nav-container {
        padding: 0 0.2rem;
    }
    
    .nav-item {
        padding: 0.3rem 0.4rem;
        min-width: 50px;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
    
    .nav-item span {
        font-size: 0.65rem;
    }
    
    .post-actions-menu {
        min-width: 130px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover::before {
        left: -100%;
    }
    
    .card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
    
    .btn:hover {
        transform: none;
    }
    
    .nav-icon:hover {
        transform: none;
        background: var(--secondary-white);
        color: var(--text-dark);
    }
    
    .nav-icon:active {
        background: var(--deep-purple);
        color: white;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .user-profile-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
    
    .post-actions-btn:active {
        background: var(--deep-purple);
    }
}

/* Prevent text selection on buttons */
button {
    user-select: none;
    -webkit-user-select: none;
}

/* Improve form elements on iOS */
input, textarea, select {
    -webkit-appearance: none;
    border-radius: 0;
}

/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Notification styling */
.notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: var(--primary-white);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
    max-width: 90%;
    text-align: center;
    border: 1px solid var(--gray-light);
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.info {
    border-left: 4px solid var(--deep-purple);
}

/* Default profile picture - Instagram style */
.default-profile-pic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin: 0 auto;
}

/* Text-only post styling */
.text-only-post {
    background: var(--primary-white);
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    transition: all var(--transition-normal);
    opacity: 0;
    transform: translateY(20px);
    animation: cardAppear 0.5s ease forwards;
    border: 1px solid var(--gray-light);
}

.text-only-post:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Profile picture upload button */
.profile-pic-upload-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--deep-purple);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.profile-pic-upload-btn:hover {
    background: var(--dark-violet);
    transform: translateY(-2px);
}

.profile-pic-upload-btn i {
    font-size: 1rem;
}

/* Instagram/LinkedIn style profile upload */
.profile-pic-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-pic-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--deep-purple);
    background: var(--secondary-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-pic-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-pic-preview i {
    font-size: 3rem;
    color: var(--text-light);
}

/* Signup profile picture upload styling */
.signup-profile-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.signup-profile-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--deep-purple);
    background: var(--secondary-white);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.signup-profile-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.signup-profile-preview i {
    font-size: 3rem;
    color: var(--text-light);
}

.signup-profile-upload-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--deep-purple);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.signup-profile-upload-btn:hover {
    background: var(--dark-violet);
    transform: translateY(-2px);
}

.signup-profile-preview .change-photo-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.signup-profile-preview .change-photo-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.signup-profile-preview .remove-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(239, 68, 68, 0.7);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.signup-profile-preview .remove-photo-btn:hover {
    background: rgba(239, 68, 68, 0.9);
}

.signup-profile-uploaded-text {
    color: var(--deep-purple);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: -0.5rem;
}

/* Signup crop button styles */
.signup-crop-btn-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.signup-crop-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.signup-crop-btn.cancel {
    background: var(--gray-light);
    color: var(--text-dark);
}

.signup-crop-btn.save {
    background: var(--deep-purple);
    color: white;
}

.signup-crop-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}