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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff;
    color: #1f2937;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Variables */
:root {
    --primary-red: #DC2626;
    --primary-red-hover: #B91C1C;
    --primary-red-light: #FEE2E2;
    --background-white: #ffffff;
    --background-gray: #f9fafb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--background-white);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    max-width: 600px;
    margin: 0 auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.messages-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.messages-btn:hover {
    background: var(--background-gray);
    color: var(--primary-red);
}

.messages-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary-red);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(145deg, #DC2626, #B91C1C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    letter-spacing: -0.5px;
    position: relative;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    text-transform: none;
}

.logo-text::after {
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.logo::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.logo:hover::before {
    opacity: 1;
}

.logo-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Profile Section Styles */
.profile-section {
    background: var(--background-white);
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.profile-header-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.back-btn {
    background: none;
    border: none;
    color: var(--primary-red);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background: var(--background-gray);
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 12px;
}

.logout-btn:hover {
    background: #c82333;
}

/* Comments Section Styles */
.comments-section {
    border-top: 1px solid var(--border-color);
    background: var(--background-gray);
}

.comments-content {
    padding: 16px;
}

.comments-list {
    margin-bottom: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

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

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.comment-text {
    font-size: 14px;
    color: var(--text-primary);
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.comment-like-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-like-btn:hover {
    background: var(--background-gray);
}

.comment-like-btn.liked {
    color: var(--primary-red);
}

.comment-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.comment-input-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    outline: none;
    font-size: 14px;
}

.comment-input:focus {
    border-color: var(--primary-red);
}

.comment-send-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.comment-send-btn:hover {
    background: var(--primary-red-hover);
}

/* Main Content */
.main-content {
    margin-top: 60px;
    margin-bottom: 80px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px;
}

/* Gems/Stories Section */
.gems-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.gems-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.gems-container::-webkit-scrollbar {
    display: none;
}

.gem-story {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 70px;
    cursor: pointer;
}

.gem-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.gem-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.add-gem .gem-avatar {
    background: var(--primary-red-light);
    border-color: var(--primary-red);
}

.add-icon {
    color: var(--primary-red);
    font-size: 24px;
    font-weight: bold;
}

.gem-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Create Post Section */
.create-post {
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

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

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

.post-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: var(--background-gray);
    padding: 12px 16px;
    border-radius: 20px;
    cursor: pointer;
}

.create-post-actions {
    display: flex;
    justify-content: space-around;
    gap: 8px;
}

.post-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    color: var(--text-secondary);
}

.post-action-btn:hover {
    background: var(--background-gray);
}

/* Feed Section */
.feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post {
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

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

.post-username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.post-time {
    color: var(--text-secondary);
    font-size: 12px;
}

.post-menu-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 16px;
}

.post-menu-btn:hover {
    background: var(--background-gray);
}

.post-content {
    padding: 0 16px 16px;
}

.post-text {
    margin-bottom: 12px;
    line-height: 1.5;
}

.post-media {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

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

.post-actions {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.post-action {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--text-secondary);
}

.post-action:hover {
    background: var(--background-gray);
}

.post-action.liked {
    color: var(--primary-red);
}

.post-action.liked:hover {
    background: var(--primary-red-light);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background-white);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: color 0.2s;
    color: var(--text-secondary);
    font-size: 12px;
}

.nav-btn.active {
    color: var(--primary-red);
}

.nav-btn span:first-child {
    font-size: 20px;
}

.add-post-icon {
    background: var(--primary-red);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.nav-btn {
    position: relative;
}

.nav-btn .notification-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: var(--primary-red);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--background-white);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--background-gray);
}

/* Chat Modal */
.chat-list {
    padding: 16px 0;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-item:hover {
    background: var(--background-gray);
}

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

.chat-info {
    flex: 1;
}

.chat-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-preview {
    color: var(--text-secondary);
    font-size: 14px;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.chat-time {
    color: var(--text-secondary);
    font-size: 12px;
}

.unread-badge {
    background: var(--primary-red);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Post Modal */
.post-form {
    padding: 20px;
}

.post-user {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.privacy-select {
    border: none;
    background: var(--background-gray);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.post-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 16px;
    font-family: inherit;
    min-height: 120px;
    margin-bottom: 16px;
}

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

.media-preview {
    position: relative;
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
}

.media-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.remove-media {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-actions-modal {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.modal-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--background-white);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.modal-action-btn:hover {
    background: var(--background-gray);
    border-color: var(--primary-red);
}

.publish-btn {
    width: 100%;
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.publish-btn:hover {
    background: var(--primary-red-hover);
}

.publish-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

/* Empty Feed Styles */
.empty-feed {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-feed-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-feed h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-feed p {
    font-size: 1rem;
    margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .main-content {
        padding: 0 12px;
    }
    
    .create-post-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .post-action-btn {
        justify-content: flex-start;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.slide-up {
    animation: slideUp 0.3s ease-in-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Auth Styles */
.auth-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

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

.auth-logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.auth-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    color: #6b7280;
}

.auth-tab.active {
    background: white;
    color: #DC2626;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-form {
    margin-bottom: 20px;
}

.auth-form.hidden {
    display: none;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: #DC2626;
}

.auth-btn {
    width: 100%;
    background: #DC2626;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 20px;
}

.auth-btn:hover {
    background: #B91C1C;
}

.auth-link {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.auth-link span {
    color: #DC2626;
    cursor: pointer;
    font-weight: 600;
}

.auth-language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.auth-language-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-lang-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.auth-lang-btn.active {
    background: #DC2626;
    color: white;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

.auth-lang-btn:hover:not(.active) {
    background: rgba(220, 38, 38, 0.1);
    color: #DC2626;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
    }
    
    .auth-logo {
        font-size: 2rem;
    }
    
    .auth-language-selector {
        top: 15px;
        right: 15px;
    }
    
    .auth-lang-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}