.no-contacts .material-icons { font-size: 4rem; color: var(--text-muted); margin-bottom: 1rem; }
.no-contacts h4 { margin: 0 0 0.5rem 0; color: var(--text-primary); font-weight: var(--font-weight-medium); }
.no-contacts p { margin: 0; font-size: 0.9rem; }
.chat-area { flex-grow: 1; display: flex; flex-direction: column; background: var(--bg-primary); position: relative; overflow: hidden; }
.chat-welcome { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-secondary); text-align: center; padding: 2rem; }
.chat-welcome .material-icons { font-size: 5rem; color: var(--text-muted); margin-bottom: 1rem; }
.chat-welcome h3 { margin: 0 0 0.5rem 0; color: var(--text-primary); font-weight: var(--font-weight-normal); font-size: 1.2rem; }
.chat-welcome p { margin: 0; font-size: 0.9rem; }
.active-chat { display: flex; flex-direction: column; height: 100%; }
.chat-header { background: var(--surface); color: var(--text-primary); padding: 0.75rem 1rem; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--border); backdrop-filter: blur(20px); z-index: 10; flex-shrink: 0; }
.back-btn { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: none; align-items: center; justify-content: center; transition: var(--transition); }
.back-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.chat-contact-info { display: flex; align-items: center; gap: 0.75rem; flex-grow: 1; }
#activeChatAvatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-weight: var(--font-weight-medium); overflow: hidden; }
#activeChatAvatar img { width: 100%; height: 100%; object-fit: cover; }
.contact-details h4 { margin: 0 0 0.125rem 0; font-size: 1rem; font-weight: var(--font-weight-medium); color: var(--text-primary); }
.contact-status { font-size: 0.8rem; color: var(--text-secondary); margin: 0; }
.chat-actions { display: flex; gap: 0.5rem; align-items: center; }
.chat-action-btn { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.chat-action-btn:hover { background: var(--surface-hover); color: var(--text-primary); transform: scale(1.1); }
.chat-messages { flex-grow: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; background: var(--bg-primary); scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.message-bubble { max-width: 70%; padding: 0.5rem 0.75rem 0.5rem 0.75rem; border-radius: 18px; position: relative; margin-bottom: 0.25rem; word-wrap: break-word; animation: messageSlideIn 0.2s ease; background: var(--surface); border: none; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; gap: 0.25rem; }
@keyframes messageSlideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.message-sent { background: #dcf8c6; color: #000000; align-self: flex-end; border-radius: 18px 6px 18px 18px; margin-left: 20%; }
.message-received { background: #ffffff; color: #000000; align-self: flex-start; border-radius: 6px 18px 18px 18px; border: 1px solid #e0e0e0; margin-right: 20%; }
:root:not([data-theme="light"]) .message-sent { background: #005c4b; color: #ffffff; }
:root:not([data-theme="light"]) .message-received { background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); }
.message-content { display: flex; align-items: flex-end; gap: 0.5rem; min-width: 0; }
.message-text { font-size: 0.9rem; line-height: 1.4; margin: 0; word-break: break-word; flex-grow: 1; min-width: 0; }
.message-time { font-size: 0.7rem; margin: 0; opacity: 0.6; flex-shrink: 0; align-self: flex-end; margin-left: 0.5rem; margin-top: 0.25rem; }
.message-sent .message-time { color: #000000; }
.message-received .message-time { color: #666666; }
:root:not([data-theme="light"]) .message-sent .message-time { color: rgba(255, 255, 255, 0.7); }
:root:not([data-theme="light"]) .message-received .message-time { color: var(--text-muted); }
.date-divider { align-self: center; background: var(--surface); color: var(--text-secondary); padding: 0.25rem 0.75rem; border-radius: 12px; font-size: 0.75rem; margin: 0.5rem 0; border: 1px solid var(--border); backdrop-filter: blur(20px); }
.chat-input-area { background: var(--bg-secondary); padding: 0.75rem 1rem; border-top: 1px solid var(--border); flex-shrink: 0; }
#collaborativeMessageInput { flex-grow: 1; background: transparent; border: none; outline: none; padding: 0.25rem 0.5rem; font-size: 0.9rem; color: var(--text-primary); resize: none; max-height: 100px; min-height: 20px; line-height: 1.4; font-family: var(--font-primary); }
#collaborativeMessageInput::placeholder { color: var(--text-muted); }
.send-message-btn { background: var(--accent); border: none; color: var(--bg-primary); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); flex-shrink: 0; }
.send-message-btn:hover { transform: scale(1.1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.send-message-btn:disabled { background: var(--text-muted); cursor: not-allowed; transform: none; }
.typing-indicator { align-self: flex-start; background: var(--surface); color: var(--text-secondary); padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.85rem; font-style: italic; border: 1px solid var(--border); position: relative; display: flex; align-items: center; gap: 0.5rem; animation: messageSlideIn 0.2s ease; backdrop-filter: blur(20px); max-width: 70%; }
.typing-dots { display: flex; gap: 2px; }
.typing-dot { width: 4px; height: 4px; background: var(--text-muted); border-radius: 50%; animation: typingDot 1.4s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-6px); opacity: 1; } }

/* ===== CALL MODALS ===== */
.call-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.9); z-index: 3000; display: none; align-items: center; justify-content: center; }
.call-modal.active { display: flex; }
.call-modal-content { background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 2rem; text-align: center; max-width: 400px; width: 90%; border: 1px solid var(--border); }
.call-modal-content.incoming { background: var(--accent); color: var(--bg-primary); }
.call-contact-info, .incoming-call-info { margin-bottom: 2rem; }
.call-avatar, .incoming-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem auto; overflow: hidden; }
.call-modal-content.incoming .call-avatar, .call-modal-content.incoming .incoming-avatar { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.3); }
.call-avatar img, .incoming-avatar img { width: 100%; height: 100%; object-fit: cover; }
.call-controls, .incoming-call-controls { display: flex; justify-content: center; gap: 2rem; margin-top: 2rem; }
.call-control-btn { width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.2s ease; }
.call-control-btn:hover { transform: scale(1.1); }
.call-control-btn .material-icons { font-size: 24px; }
.call-control-btn.accept { background: #4caf50; color: white; }
.call-control-btn.decline, .call-control-btn.end-call { background: #f44336; color: white; }
.call-control-btn:not(.accept):not(.decline):not(.end-call) { background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); }
.call-video-area { position: relative; width: 100%; height: 300px; background: #000; border-radius: var(--radius); overflow: hidden; margin: 1rem 0; }
#remoteVideo { width: 100%; height: 100%; object-fit: cover; }
#localVideo { position: absolute; bottom: 10px; right: 10px; width: 80px; height: 60px; border-radius: var(--radius-sm); object-fit: cover; border: 2px solid white; }
.contact-avatar.online::after { content: ''; position: absolute; bottom: 2px; right: 2px; width: 12px; height: 12px; background: #4caf50; border: 2px solid var(--bg-secondary); border-radius: 50%; }
.message-bubble { width: fit-content; max-width: 70%; min-width: 120px; box-sizing: border-box; }
.message-text { word-wrap: break-word; word-break: break-word; overflow-wrap: break-word; hyphens: auto; }
.message-content { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; }
.message-text { flex: 1; min-width: 0; }
.message-time { flex-shrink: 0; align-self: flex-end; }

/* ===== ADDITIONAL CHAT COMPONENTS ===== */
.madmium-response { background: rgba(128, 128, 128, 0.1) !important; backdrop-filter: blur(20px) !important; border: 1px solid var(--border) !important; border-left: none !important; border-radius: var(--radius-lg) !important; height: auto !important; max-height: none !important; min-height: auto !important; overflow: visible !important; flex: none !important; position: static !important; transform: none !important; left: auto !important; width: 70% !important; max-width: 70% !important; margin: var(--spacing-lg) auto !important; display: block !important; word-wrap: break-word !important; box-sizing: border-box !important; padding: 0 !important; }
#queryText { color: var(--text-primary) !important; font-size: 0.95rem !important; line-height: 1.6 !important; word-wrap: break-word !important; padding: 1rem 1.5rem !important; border-bottom: 1px solid var(--border) !important; margin-bottom: 0 !important; height: auto !important; width: 100% !important; box-sizing: border-box !important; display: flex !important; align-items: flex-start !important; gap: 1rem !important; background: rgba(128, 128, 128, 0.05) !important; }
.query-profile-image { width: 32px !important; height: 32px !important; border-radius: 50% !important; overflow: hidden !important; flex-shrink: 0 !important; border: 1px solid var(--border) !important; background: var(--surface) !important; display: flex !important; align-items: center !important; justify-content: center !important; }
.query-profile-image img { width: 100% !important; height: 100% !important; object-fit: cover !important; }
.query-profile-image .material-icons { font-size: 18px !important; color: var(--text-secondary) !important; }
.query-text-content { flex-grow: 1 !important; min-width: 0 !important; word-wrap: break-word !important; }
#madmiumAIResponse { color: var(--text-primary) !important; word-wrap: break-word !important; height: auto !important; min-height: auto !important; max-height: none !important; overflow: visible !important; width: 100% !important; box-sizing: border-box !important; line-height: 1.6 !important; padding: 1.5rem !important; margin: 0 !important; flex: none !important; }
body[data-theme="light"] .madmium-response { background: rgba(128, 128, 128, 0.08) !important; backdrop-filter: blur(20px) !important; border: 1px solid rgba(0, 0, 0, 0.1) !important; }
body[data-theme="light"] #queryText { background: rgba(128, 128, 128, 0.12) !important; }
body[data-theme="light"] .query-profile-image { border: 1px solid rgba(0, 0, 0, 0.15) !important; background: #f8f8f8 !important; }
#searchTabIndicator { position: absolute; bottom: 0; height: 2px; background: var(--primary); border-radius: 1px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.search-tab { position: relative; transition: all 0.3s ease; }
.search-tab.active { background: rgb(255, 255, 255); backdrop-filter: blur(10px); }

/* ===== MOBILE RESPONSIVE CHAT ===== */
@media (max-width: 768px) {
    .collaboration-layout { position: relative; margin-top: 70px; height: calc(100vh - 70px); }
    .chat-sidebar { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; transform: translateX(-100%); transition: transform 0.3s ease; }
    .chat-sidebar.mobile-open { transform: translateX(0); }
    .chat-area { width: 100%; }
    .back-btn { display: flex; }
    .message-bubble { max-width: 85%; padding: 0.4rem 0.6rem; margin-bottom: 0.2rem; }
    .message-sent { margin-left: 15%; }
    .message-received { margin-right: 15%; }
    .contact-item { padding: 1rem; }
    .contact-avatar { width: 50px; height: 50px; }
    .chat-header { padding: 1rem; }
    #activeChatAvatar { width: 36px; height: 36px; }
    #collaborationPage .chat-area { display: none; }
    #collaborationPage .chat-sidebar { position: static !important; width: 100% !important; height: 100% !important; transform: translateX(0) !important; z-index: auto !important; }
    #collaborationPage .chat-sidebar.mobile-hidden { display: none !important; }
    #collaborationPage .chat-area.mobile-active { display: flex !important; width: 100% !important; }
    #collaborationPage .chat-area.mobile-active .back-btn { display: flex !important; }
    #collaborationPage .chat-contact-info { flex-grow: 1 !important; min-width: 0 !important; overflow: hidden !important; }
    #collaborationPage .contact-details { min-width: 0 !important; overflow: hidden !important; }
    #collaborationPage .contact-details h4 { white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; margin: 0 !important; font-size: 0.9rem !important; }
    #collaborationPage .chat-actions { flex-shrink: 0 !important; }
    .chat-input-wrapper { display: flex; align-items: flex-end; gap: 0.5rem; background: var(--surface); border-radius: 20px; padding: 0.5rem; border: 1px solid var(--border); backdrop-filter: blur(20px); }
    .madmium-response { width: 90% !important; max-width: 90% !important; margin: 1rem auto !important; }
    #queryText { padding: 0.75rem 1rem !important; gap: 0.75rem !important; }
    #madmiumAIResponse { padding: 1rem !important; }
    .query-profile-image { width: 28px !important; height: 28px !important; }
    .query-profile-image .material-icons { font-size: 16px !important; }
}

@media (max-width: 480px) {
    .collaboration-layout { height: calc(100vh - 60px); margin-top: 60px; }
    .chat-sidebar { width: 100%; }
    .contact-item { padding: 0.75rem; }
    .contact-avatar { width: 44px; height: 44px; font-size: 1rem; }
    .contact-name { font-size: 0.9rem; }
    .contact-last-message { font-size: 0.8rem; }
    .chat-header { padding: 0.75rem; }
    .contact-details h4 { font-size: 0.9rem; }
    .contact-status { font-size: 0.75rem; }
    .message-text { font-size: 0.85rem; }
    .message-time { font-size: 0.65rem; }
    #collaborativeMessageInput { font-size: 0.85rem; }
    .send-message-btn { width: 32px; height: 32px; }
    .chat-action-btn { width: 32px; height: 32px; }
    .message-bubble { max-width: 90%; padding: 0.4rem 0.6rem; margin-bottom: 0.2rem; }
    .message-sent { margin-left: 10%; }
    .message-received { margin-right: 10%; }
    .madmium-response { width: 95% !important; max-width: 95% !important; margin: 0.75rem auto !important; }
    #queryText { padding: 0.5rem 0.75rem !important; gap: 0.5rem !important; font-size: 1rem !important; }
    #madmiumAIResponse { padding: 0.75rem !important; }
    .query-profile-image { width: 24px !important; height: 24px !important; }
    .query-profile-image .material-icons { font-size: 14px !important; }
    .chat-input-row { flex-wrap: wrap; }
    .chat-input { order: -1; width: 100%; margin-bottom: 2px; padding: var(--spacing-sm); }
    .chat-buttons-mobile { width: 100%; display: flex; justify-content: center; gap: var(--spacing-sm); }
    .chat-buttons-mobile .input-btn { margin: 0; width: 44px; height: 44px; }
}

#chatInputContainer .chat-input-wrapper { display: block !important; }
#chatInputContainer .chat-input-row { display: flex !important; align-items: center !important; }
#chatInputContainer .chat-buttons-wrapper { width: 100% !important; display: flex !important; justify-content: space-between !important; margin-top: 1px !important; }
#chatInputContainer .input-btn { width: 44px !important; height: 44px !important; flex-shrink: 0 !important; }
#madmiumTypingIndicator { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }

/* ===== UTILITY RESPONSIVE OVERRIDES ===== */
@media (max-width: 768px) {
    .calendar-container { padding: 0.75rem; margin: 0; }
    .calendar-grid { width: 100%; max-width: 100%; overflow: hidden; }
    .weekday { padding: 0.4rem 0.1rem; font-size: 0.65rem; letter-spacing: 0.01em; }
    .calendar-day { min-height: 70px; padding: 0.2rem; }
    .day-number { font-size: 0.75rem; margin-bottom: 0.15rem; }
    .day-event { font-size: 0.55rem; padding: 1px 2px; margin-bottom: 1px; }
    .more-events { font-size: 0.5rem; margin-top: 1px; }
    .settings-container { margin: 0 1rem; }
    .settings-group { margin-bottom: 1.5rem; }
    .settings-group h3 { padding: 0.75rem 1rem; font-size: 0.8rem; }
    .setting-item { padding: 0.75rem 1rem; gap: 0.75rem; }
    .setting-item .material-icons:first-child { font-size: 18px; }
    .setting-item span:nth-child(2) { font-size: 0.9rem; }
    .setting-item .material-icons:last-child { font-size: 16px; }
    .profile-image-container { width: 100px; height: 100px; }
    .profile-info-row { flex-direction: column; gap: 1rem; text-align: center; }
    .profile-stats { gap: 1.5rem; }
    .posts-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
    .profile-modal-content { margin: 1rem; max-height: calc(100vh - 2rem); }
    .modal-header { padding: 1rem; }
    .modal-body { padding: 1rem; }
    .search-tabs-container { margin: 1rem 0; padding: 0.375rem; }
    .search-tab { padding: 0.5rem 0.75rem; font-size: 0.8rem; min-height: 40px; flex-direction: column; gap: 0.25rem; }
    .search-tab .material-icons { font-size: 16px; }
    .search-tab-count { font-size: 0.65rem; padding: 0.1rem 0.3rem; min-width: 16px; height: 16px; }
    .search-tab span:not(.material-icons):not(.search-tab-count) { font-size: 0.7rem; }
    .post-result-card { flex-direction: column; gap: 0.75rem; padding: 0.75rem; }
    .post-thumbnail { width: 100%; height: 120px; align-self: center; }
    .post-meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .post-title { font-size: 0.9rem; }
    .post-description { font-size: 0.8rem; }
    .search-container { margin: 1.5rem auto 2rem auto; }
} 
    .setting-item { padding: 0.75rem 1rem; gap: 0.75rem; }
    .setting-item .material-icons:first-child { font-size: 18px; }
    .setting-item span:nth-child(2) { font-size: 0.9rem; }
    .setting-item .material-icons:last-child { font-size: 16px; }
    .profile-image-container { width: 100px; height: 100px; }
    .profile-info-row { flex-direction: column; gap: 1rem; text-align: center; }
    .profile-stats { gap: 1.5rem; }
    .posts-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
    .profile-modal-content { margin: 1rem; max-height: calc(100vh - 2rem); }
    .modal-header { padding: 1rem; }
    .modal-body { padding: 1rem; }
    .search-tabs-container { margin: 1rem 0; padding: 0.375rem; }
    .search-tab { padding: 0.5rem 0.75rem; font-size: 0.8rem; min-height: 40px; flex-direction: column; gap: 0.25rem; }
    .search-tab .material-icons { font-size: 16px; }
    .search-tab-count { font-size: 0.65rem; padding: 0.1rem 0.3rem; min-width: 16px; height: 16px; }
    .search-tab span:not(.material-icons):not(.search-tab-count) { font-size: 0.7rem; }
    .post-result-card { flex-direction: column; gap: 0.75rem; padding: 0.75rem; }
    .post-thumbnail { width: 100%; height: 120px; align-self: center; }
    .post-meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .post-title { font-size: 0.9rem; }
    .post-description { font-size: 0.8rem; }


@media (max-width: 480px) {
    .calendar-container { padding: 0.5rem; border-radius: var(--radius); }
    .weekday { padding: 0.3rem 0.05rem; font-size: 0.6rem; letter-spacing: 0; }
    .calendar-day { min-height: 60px; padding: 0.15rem; }
    .day-number { font-size: 0.7rem; margin-bottom: 0.1rem; }
    .day-event { font-size: 0.5rem; padding: 0.5px 1px; border-radius: 1px; line-height: 1.1; }
    .more-events { font-size: 0.45rem; }
    .day-events { gap: 0.5px; }
    .calendar-header { margin-bottom: 0.75rem; }
    .calendar-header h3 { font-size: 1rem; }
    .calendar-nav-btn { width: 32px; height: 32px; }
    .calendar-nav-btn .material-icons { font-size: 18px; }
    .events-section { padding: 0.75rem; }
    .event-item { padding: 0.5rem; }
    .event-header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
    .event-title { font-size: 0.85rem; }
    .event-time { font-size: 0.7rem; }
    .event-description { font-size: 0.75rem; }
    .event-meta { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
    .settings-container { margin: 0 0.5rem; }
    .settings-group h3 { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
    .setting-item { padding: 0.5rem 0.75rem; gap: 0.5rem; }
    .profile-image-container { width: 80px; height: 80px; }
    .profile-username-section h2 { font-size: 1.2rem; }
    .posts-header { flex-direction: column; gap: 1rem; align-items: stretch; }
    .posts-tabs { justify-content: center; }
    .search-tab { padding: 0.375rem 0.5rem; gap: 0.125rem; }
    .search-tab .material-icons { font-size: 14px; }
    .search-tab span:not(.material-icons):not(.search-tab-count) { font-size: 0.65rem; display: none; }
    .search-tab-count { font-size: 0.6rem; min-width: 14px; height: 14px; }
    .post-result-card { padding: 0.5rem; }
    .post-thumbnail { height: 100px; }
    .post-title { font-size: 0.85rem; -webkit-line-clamp: 1; }
    .post-description { font-size: 0.75rem; -webkit-line-clamp: 1; }
    .post-meta small { font-size: 0.65rem; }
}

@media (max-width: 320px) {
    .weekday { padding: 0.25rem 0.02rem; font-size: 0.55rem; }
    .calendar-day { min-height: 50px; padding: 0.1rem; }
    .day-number { font-size: 0.65rem; margin-bottom: 0.05rem; }
    .day-event { font-size: 0.45rem; padding: 0.5px; line-height: 1; }
}

/* ===== LIGHT THEME ADDITIONAL OVERRIDES ===== */
body[data-theme="light"] .profile-modal { background: rgba(255, 255, 255, 0.95); }
body[data-theme="light"] .profile-modal-content { background: #ffffff; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15); }
body[data-theme="light"] .post-grid-overlay { background: rgba(255, 255, 255, 0.9); }
body[data-theme="light"] .post-grid-overlay .post-grid-info { color: #333333; }
body[data-theme="light"] .settings-group { background: #ffffff; border: 1px solid rgba(0, 0, 0, 0.1); }
body[data-theme="light"] .settings-group h3 { background: #f8f8f8; border-bottom: 1px solid rgba(0, 0, 0, 0.1); color: #333333; }
body[data-theme="light"] .setting-item { color: #333333; border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
body[data-theme="light"] .setting-item:hover { background: #f5f5f5; }

:root {
    --bg-primary: #2a2a2a; --bg-secondary: #1f1f1f; --surface: rgba(255, 255, 255, 0.02);
    --surface-hover: rgba(255, 255, 255, 0.05); --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15); --text-primary: #ffffff;
    --text-secondary: #999999; --text-muted: #666666; --accent: #ffffff;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500;
    --font-weight-semibold: 600; --font-weight-bold: 700; --radius-sm: 4px;
    --radius: 8px; --radius-lg: 16px; --spacing-xs: 0.5rem; --spacing-sm: 1rem;
    --spacing-md: 1.5rem; --spacing-lg: 2rem; --spacing-xl: 3rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); --transition-fast: all 0.15s ease;
}

:root[data-theme="light"] {
    --bg-primary: #ffffff; --bg-secondary: #f8f8f8; --surface: rgba(0, 0, 0, 0.02);
    --surface-hover: rgba(0, 0, 0, 0.05); --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15); --text-primary: #1a1a1a;
    --text-secondary: #666666; --text-muted: #999999; --accent: #1a1a1a; --code-bg: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; }

body {
    font-family: var(--font-primary); background: var(--bg-primary); color: var(--text-primary);
    line-height: 1.6; font-weight: var(--font-weight-normal); -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
}

/* ===== LIGHT THEME OVERRIDES ===== */
body[data-theme="light"] { background: #ffffff; }
.header[data-theme="light"] { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
body[data-theme="light"] .ai-code-container { background: var(--code-bg); border: 1px solid rgba(0, 0, 0, 0.1); }
body[data-theme="light"] .ai-code-header { background: rgba(0, 0, 0, 0.02); border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
body[data-theme="light"] .token.keyword { color: #0066cc !important; } body[data-theme="light"] .token.string { color: #008000 !important; }
body[data-theme="light"] .token.function { color: #795548 !important; } body[data-theme="light"] .token.comment { color: #666666 !important; }
body[data-theme="light"] .token.number { color: #1976d2 !important; } body[data-theme="light"] .token.operator { color: #f57c00 !important; }
body[data-theme="light"] .token.punctuation { color: #333333 !important; } body[data-theme="light"] .token.property { color: #333333 !important; }
body[data-theme="light"] .token.boolean { color: #1976d2 !important; } body[data-theme="light"] .token.builtin { color: #0066cc !important; }
body[data-theme="light"] .token.class-name { color: #795548 !important; }
body[data-theme="light"] .chat-input-wrapper { background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(0, 0, 0, 0.1); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); }
body[data-theme="light"] .btn-primary { border: 1px solid rgba(0, 0, 0, 0.2); color: var(--text-primary); }
body[data-theme="light"] .btn-primary:hover { background: rgba(0, 0, 0, 0.05); }
body[data-theme="light"] .response-card, body[data-theme="light"] div[style*="background: var(--surface)"] { background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.1) !important; }
body[data-theme="light"] [id^="response-"] { background: #ffffff !important; }
body[data-theme="light"] .header-logo, body[data-theme="light"] .auth-logo { filter: invert(1) hue-rotate(180deg) brightness(1) contrast(0.5); }
body[data-theme="light"] .startup-logo, body[data-theme="light"] .loading-gif, body[data-theme="light"] .loading-gif-small { filter: brightness(0.3); }
body[data-theme="light"] .content-card { background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.1) !important; }
body[data-theme="light"] .card-id-header { background: #f8f8f8 !important; border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important; }
body[data-theme="light"] .card-content { background: #ffffff !important; }
body[data-theme="light"] .card-footer { background: #ffffff !important; border-top: 1px solid rgba(0, 0, 0, 0.1) !important; }
body[data-theme="light"] .btn-fab { background: #1a1a1a !important; color: #ffffff !important; }
body[data-theme="light"] .form-container { background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.1) !important; }
body[data-theme="light"] .premium-form textarea, body[data-theme="light"] .premium-form input { background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.2) !important; color: #1a1a1a !important; }
body[data-theme="light"] .image-upload-area { background: #f8f8f8 !important; border: 2px dashed rgba(0, 0, 0, 0.2) !important; }
body[data-theme="light"] .btn-primary, body[data-theme="light"] .btn-secondary { background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.2) !important; color: #1a1a1a !important; }
body[data-theme="light"] .user-menu { background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.15) !important; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important; }
body[data-theme="light"] .user-menu .menu-item { color: #666666 !important; }
body[data-theme="light"] .user-menu .menu-item:hover { background: #f8f8f8 !important; color: #1a1a1a !important; }
body[data-theme="light"] .user-menu .menu-item.active { background: #f0f0f0 !important; color: #1a1a1a !important; border-left: 3px solid #1a1a1a !important; }

/* ===== STARTUP OVERLAY ===== */
.startup-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg-primary);
    z-index: 10000; display: flex; align-items: center; justify-content: center; opacity: 1; transition: opacity 0.8s ease;
}
.startup-overlay.fade-out { opacity: 0; pointer-events: none; }
.startup-content { text-align: center; animation: fadeInUp 0.8s ease; }
.startup-logo { width: 150px; height: 150px; object-fit: contain; margin-bottom: var(--spacing-xs); }
:root:not([data-theme="light"]) .startup-logo { filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.1)); }
.startup-text { font-size: 2rem; font-weight: var(--font-weight-light); letter-spacing: 0.2em; color: var(--text-primary); margin-bottom: var(--spacing-xs); text-transform: uppercase; }
.startup-subtitle { font-size: 0.9rem; color: var(--text-secondary); letter-spacing: 0.1em; text-transform: uppercase; font-weight: var(--font-weight-medium); }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* ===== AUTHENTICATION ===== */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--spacing-lg); background: var(--bg-primary); }
.auth-page { display: none; width: 100%; max-width: 400px; animation: slideIn 0.5s ease; }
.auth-page.active { display: block; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--spacing-xl); backdrop-filter: blur(20px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.auth-header { text-align: center; margin-bottom: var(--spacing-xl); }
.auth-logo { width: 60px; height: 60px; object-fit: contain; margin-bottom: var(--spacing-md); filter: drop-shadow(0 4px 20px rgb(53, 53, 53)); }
.auth-header h1 { font-size: 1.8rem; font-weight: var(--font-weight-light); letter-spacing: -0.02em; margin-bottom: var(--spacing-xs); color: var(--text-primary); }
.auth-header p { color: var(--text-secondary); font-size: 0.9rem; font-weight: var(--font-weight-normal); }
.auth-form { margin-bottom: var(--spacing-lg); }
.form-group { margin-bottom: var(--spacing-lg); }
.form-group label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: var(--spacing-xs); text-transform: uppercase; letter-spacing: 0.1em; font-weight: var(--font-weight-medium); }
.form-group input { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border); padding: var(--spacing-md) 0; font-size: 1rem; color: var(--text-primary); font-family: var(--font-primary); font-weight: var(--font-weight-normal); transition: var(--transition); outline: none; }
.form-group input:focus { border-bottom-color: var(--border-hover); }
.form-group input::placeholder { color: var(--text-muted); font-weight: var(--font-weight-normal); }
.auth-btn { width: 100%; background: transparent; color: var(--text-primary); border: 1px solid var(--border-hover); padding: var(--spacing-md) var(--spacing-lg); border-radius: var(--radius); font-size: 0.9rem; font-weight: var(--font-weight-medium); letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: var(--spacing-xs); font-family: var(--font-primary); min-height: 50px; }
.auth-btn:hover { background: var(--surface-hover); transform: translateY(-1px); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-footer { text-align: center; }
.auth-footer p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: var(--spacing-xs); }
.auth-footer a { color: var(--text-primary); text-decoration: none; font-weight: var(--font-weight-medium); transition: var(--transition); }
.auth-footer a:hover { opacity: 0.8; }

/* ===== MAIN APPLICATION ===== */
.main-container { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-primary); display: block; }
.header { background: rgba(42, 42, 42, 0.95); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); padding: 0 var(--spacing-xl); height: 80px; display: flex; align-items: center; justify-content: space-between; position: fixed; top: 0; left: 0; right: 0; z-index: 1000; }
.header-left { display: flex; align-items: center; gap: var(--spacing-md); }
.header-logo { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.1)); }
.header-brand { display: flex; flex-direction: column; }
.brand-name { font-size: 1.2rem; font-weight: var(--font-weight-light); letter-spacing: 0.1em; color: var(--text-primary); line-height: 1; }
.brand-subtitle { font-size: 0.7rem; color: var(--text-secondary); letter-spacing: 0.03em; text-transform: uppercase; font-weight: var(--font-weight-medium); }
.header-right { position: relative; }
.user-info { display: flex; align-items: center; gap: var(--spacing-sm); }
.user-email { font-size: 0.9rem; color: var(--text-secondary); font-weight: var(--font-weight-normal); }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); overflow: hidden; position: relative; }
.user-avatar:hover { background: var(--surface-hover); transform: scale(1.05); border-color: var(--border-hover); }
.user-avatar .material-icons { color: var(--text-secondary); font-size: 24px; transition: var(--transition); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; transition: var(--transition); display: block; }
.user-avatar img:hover { transform: scale(1.1); }
.user-avatar.loading { background: var(--surface); border: 2px solid transparent; background-clip: padding-box; animation: avatarPulse 1.5s ease-in-out infinite; }
@keyframes avatarPulse { 0%, 100% { background: var(--surface); transform: scale(1); } 50% { background: var(--surface-hover); transform: scale(1.02); } }
.user-avatar img.error { display: none; }
.user-avatar.has-image { border: 2px solid var(--border-hover); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.user-avatar.has-image:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); transform: scale(1.08); }
body[data-theme="light"] .user-avatar.has-image { border: 2px solid rgba(0, 0, 0, 0.15); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); }
body[data-theme="light"] .user-avatar.has-image:hover { border-color: #1a1a1a; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.user-avatar::after { content: ''; position: absolute; bottom: 2px; right: 2px; width: 8px; height: 8px; background: #4caf50; border: 2px solid var(--bg-primary); border-radius: 50%; opacity: 0; transition: var(--transition); }
.user-avatar.online::after { opacity: 1; }
.user-avatar img { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
body[data-theme="light"] .user-avatar img { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05); }
.user-avatar img[src=""], .user-avatar img:not([src]) { display: none; }
.user-avatar:not(.has-image) .material-icons { display: block; }
.user-avatar.has-image .material-icons { display: none; }
.user-avatar.loading::before { content: ''; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid var(--border); border-top: 2px solid var(--accent); border-radius: 50%; animation: spin 1s linear infinite; z-index: 1; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.user-menu { position: absolute; top: 50px; right: 0; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--spacing-xs); min-width: 200px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); backdrop-filter: blur(20px); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: var(--transition); }
.user-menu.active { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu .menu-item { display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-sm); border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); color: var(--text-secondary); font-size: 0.9rem; font-weight: var(--font-weight-normal); }
.user-menu .menu-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.user-menu .menu-item .material-icons { font-size: 20px; }

.page { display: none; }
.page.active { display: block; }
.page-content { padding: var(--spacing-xl); padding-top: 120px; max-width: 1400px; margin: 0 auto; padding-bottom: 200px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--spacing-xl); padding-bottom: var(--spacing-lg); border-bottom: 1px solid var(--border); }
.page-header h2 { font-size: 2rem; font-weight: var(--font-weight-light); letter-spacing: -0.02em; color: var(--text-primary); text-transform: uppercase; }

/* ===== BUTTONS ===== */
.btn-primary { background: transparent; color: var(--text-primary); border: 1px solid var(--border-hover); padding: var(--spacing-md) var(--spacing-lg); border-radius: var(--radius); font-size: 0.9rem; font-weight: var(--font-weight-medium); letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: var(--spacing-xs); font-family: var(--font-primary); }
.btn-primary:hover { background: var(--surface-hover); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); padding: var(--spacing-sm) var(--spacing-md); border-radius: var(--radius); font-size: 0.8rem; font-weight: var(--font-weight-medium); letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: var(--spacing-xs); font-family: var(--font-primary); }
.btn-secondary:hover { background: var(--surface-hover); color: var(--text-primary); border-color: var(--border-hover); }
.btn-fab { background: var(--accent); color: var(--bg-primary); border: none; width: 60px; height: 60px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); transition: var(--transition); }
.btn-fab:hover { transform: scale(1.1); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4); }
.btn-fab .material-icons { font-size: 24px; }

/* ===== CHAT ===== */
.empty-state { text-align: center; padding: var(--spacing-xl) var(--spacing-lg); color: var(--text-secondary); max-width: 600px; margin: var(--spacing-xl) auto; }
.empty-icon { margin-bottom: var(--spacing-lg); }
.empty-icon .material-icons { font-size: 4rem; color: var(--text-muted); opacity: 0.7; }
.empty-state h3 { color: var(--text-primary); font-size: 1.5rem; font-weight: var(--font-weight-light); margin-bottom: var(--spacing-sm); letter-spacing: -0.01em; }
.empty-state p { font-size: 1rem; line-height: 1.6; font-weight: var(--font-weight-normal); }
.response-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--spacing-xl); margin-bottom: var(--spacing-lg); backdrop-filter: blur(20px); animation: slideIn 0.4s ease; max-width: 800px; margin-left: auto; margin-right: auto; }
.query-section { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--spacing-lg); margin-bottom: var(--spacing-lg); border-left: 4px solid var(--accent); }
.query-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: var(--font-weight-medium); margin-bottom: var(--spacing-sm); }
.query-text { color: var(--text-primary); font-size: 1rem; line-height: 1.6; font-weight: var(--font-weight-normal); }
.response-section { color: var(--text-primary); }
.response-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: var(--font-weight-medium); margin-bottom: var(--spacing-sm); }
.response-content { font-size: 1rem; line-height: 1.7; font-weight: var(--font-weight-normal); }

/* ===== CHAT INPUT ===== */
.chat-input-container { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: calc(100% - 4rem); max-width: 800px; z-index: 1000; }
.chat-input-wrapper { background: var(--surface); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 3px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); margin-bottom: 3px; }
.chat-input-row { display: flex; flex-wrap: wrap; align-items: center; }
.input-btn { background: transparent; border: none; color: var(--text-secondary); width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); flex-shrink: 0; }
.input-btn:hover { background: var(--surface-hover); color: var(--text-primary); transform: scale(1.1); }
.send-btn { color: var(--accent); }
.send-btn:hover { color: var(--accent); }
.chat-input { flex-grow: 1; flex-shrink: 1; flex-basis: 100%; background: transparent; border: none; padding: var(--spacing-sm); font-size: 1rem; color: var(--text-primary); font-family: var(--font-primary); font-weight: var(--font-weight-normal); resize: none; outline: none; transition: var(--transition); min-height: 60px; max-height: 120px; height: 60px; line-height: 1.5; overflow-y: hidden; box-sizing: border-box; }
.chat-input::placeholder { color: var(--text-muted); font-weight: var(--font-weight-normal); }
.chat-images-preview { display: flex; gap: var(--spacing-sm); margin-bottom: var(--spacing-sm); overflow-x: auto; white-space: nowrap; -ms-overflow-style: none; scrollbar-width: none; }
.chat-images-preview::-webkit-scrollbar { display: none; }
.chat-images-preview:empty { display: none; }
.chat-image-preview { position: relative; width: 60px; height: 60px; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; }
.chat-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.chat-image-remove { position: absolute; top: 2px; right: 2px; background: var(--accent); color: var(--bg-primary); border: none; border-radius: 50%; width: 16px; height: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: bold; transition: var(--transition); }
.chat-image-remove:hover { transform: scale(1.1); }
.chat-buttons-wrapper { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 1px; }

/* ===== CONTENT GRID ===== */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: var(--spacing-lg); margin-top: var(--spacing-lg); }
.content-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); backdrop-filter: blur(20px); }
.content-card:hover { transform: translateY(-5px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); border-color: var(--border-hover); }
.card-header { padding: var(--spacing-lg); border-bottom: 1px solid var(--border); }
.card-images { display: flex; gap: var(--spacing-xs); overflow-x: auto; padding-bottom: var(--spacing-xs); }
.card-image { width: 80px; height: 80px; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--border); cursor: pointer; transition: var(--transition); flex-shrink: 0; }
.card-image:hover { transform: scale(1.05); border-color: var(--border-hover); }
.no-images-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--spacing-lg); color: var(--text-muted); font-size: 0.9rem; font-style: italic; min-height: 100px; }
.no-images-placeholder .material-icons { font-size: 2rem; margin-bottom: var(--spacing-xs); opacity: 0.5; }
.card-content { padding: var(--spacing-lg); color: var(--text-primary); line-height: 1.6; white-space: pre-wrap; font-size: 0.95rem; font-weight: var(--font-weight-normal); }
.card-footer { padding: var(--spacing-lg); border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-actions { display: flex; gap: var(--spacing-xs); }
.card-engagement { display: flex; gap: var(--spacing-sm); }
.engagement-btn { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); padding: var(--spacing-xs) var(--spacing-sm); border-radius: 20px; cursor: pointer; display: flex; align-items: center; gap: var(--spacing-xs); transition: var(--transition); font-size: 0.8rem; font-weight: var(--font-weight-medium); }
.engagement-btn:hover { background: var(--surface-hover); color: var(--text-primary); transform: translateY(-1px); }
.engagement-btn .material-icons { font-size: 18px; }
.engagement-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(255, 255, 255, 0.05); }
.action-btn { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); width: 36px; height: 36px; border-radius: var(--radius); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.action-btn:hover { background: var(--surface-hover); color: var(--text-primary); transform: translateY(-1px); }
.action-btn.delete:hover { background: rgba(244, 67, 54, 0.2); color: #f44336; border-color: #f44336; }
.action-btn .material-icons { font-size: 18px; }

/* ===== FORMS ===== */
.form-container { max-width: 800px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--spacing-xl); backdrop-filter: blur(20px); }
.premium-form .form-group { margin-bottom: var(--spacing-xl); }
.premium-form label { display: block; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: var(--spacing-sm); font-weight: var(--font-weight-medium); text-transform: uppercase; letter-spacing: 0.05em; }
.premium-form textarea { width: 100%; background: transparent; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--spacing-lg); font-size: 1rem; color: var(--text-primary); font-family: var(--font-primary); font-weight: var(--font-weight-normal); resize: vertical; min-height: 200px; outline: none; transition: var(--transition); line-height: 1.6; }
.premium-form textarea:focus { border-color: var(--border-hover); background: var(--surface-hover); }
.premium-form textarea::placeholder { color: var(--text-muted); font-weight: var(--font-weight-normal); }
.image-upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: var(--spacing-xl); text-align: center; cursor: pointer; transition: var(--transition); background: var(--surface); }
.image-upload-area:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.image-upload-area .material-icons { font-size: 3rem; color: var(--text-muted); margin-bottom: var(--spacing-sm); }
.upload-text { color: var(--text-secondary); font-size: 1rem; font-weight: var(--font-weight-normal); }
.upload-text small { display: block; margin-top: var(--spacing-xs); font-size: 0.8rem; color: var(--text-muted); }
.image-preview { display: flex; flex-wrap: wrap; gap: var(--spacing-sm); margin-top: var(--spacing-md); }
.image-preview-item { position: relative; width: 100px; height: 100px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.remove-image { position: absolute; top: 4px; right: 4px; background: rgba(244, 67, 54, 0.9); color: white; border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; transition: var(--transition); }
.remove-image:hover { transform: scale(1.1); }
.form-actions { display: flex; gap: var(--spacing-md); justify-content: flex-end; margin-top: var(--spacing-xl); padding-top: var(--spacing-lg); border-top: 1px solid var(--border); }

/* ===== MODAL ===== */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.9); backdrop-filter: blur(10px); z-index: 2000; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
#modalImage { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.modal-close { position: absolute; top: 20px; right: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text-primary); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); z-index: 2001; backdrop-filter: blur(20px); }
.modal-close:hover { background: var(--surface-hover); transform: scale(1.1); }
.modal-navigation { position: absolute; top: 50%; transform: translateY(-50%); display: flex; justify-content: space-between; width: 100%; padding: 0 20px; pointer-events: none; }
.modal-nav { background: var(--surface); border: 1px solid var(--border); color: var(--text-primary); width: 50px; height: 50px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); backdrop-filter: blur(20px); pointer-events: auto; }
.modal-nav:hover { background: var(--surface-hover); transform: scale(1.1); }
.modal-nav:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
.modal-nav .material-icons { font-size: 24px; }
.modal-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); color: var(--text-primary); padding: var(--spacing-xs) var(--spacing-sm); border-radius: 20px; font-size: 0.9rem; font-weight: var(--font-weight-medium); backdrop-filter: blur(20px); }

/* ===== LOADING STATES ===== */
.btn-loading { display: flex; align-items: center; justify-content: center; }
.loading-gif-small { width: 45px; height: 30px; border-radius: 50%; }
.loading-state { text-align: center; padding: var(--spacing-xl) var(--spacing-lg); color: var(--text-secondary); max-width: 600px; margin: var(--spacing-xl) auto; }
.loading-content { display: flex; flex-direction: column; align-items: center; gap: var(--spacing-md); }
.loading-gif { width: 60px; height: 60px; object-fit: contain; filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.1)); }
.loading-text { font-size: 1.1rem; color: var(--text-secondary); font-weight: var(--font-weight-medium); letter-spacing: 0.05em; }

/* ===== ANIMATIONS ===== */
@keyframes slideIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.typing-indicator { display: flex; align-items: center; gap: var(--spacing-xs); color: var(--text-secondary); font-style: italic; font-size: 0.9rem; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--spacing-md); }
    .page-content { padding: var(--spacing-lg); padding-top: 80px; padding-bottom: 180px; }
}

@media (max-width: 768px) {
    .header { padding: 0 var(--spacing-lg); height: 70px; }
    .header-logo { width: 32px; height: 32px; }
    .brand-name { font-size: 1rem; }
    .brand-subtitle { font-size: 0.65rem; letter-spacing: 0.01rem; }
    .user-email { display: none; }
    .page { min-height: calc(100vh - 140px); }
    .page-content { padding: var(--spacing-md); padding-top: 100px; padding-bottom: 160px; }
    .page-header { flex-direction: column; gap: var(--spacing-md); align-items: flex-start; }
    .page-header h2 { font-size: 1.5rem; }
    .content-grid { grid-template-columns: 1fr; gap: var(--spacing-md); }
    .chat-input-container { width: calc(100% - 2rem); bottom: 0; }
    .chat-input-wrapper { padding: 3px; margin-bottom: 3px; }
    .form-container { padding: var(--spacing-lg); }
    .form-actions { flex-direction: column; }
    .auth-container { padding: var(--spacing-md); }
    .auth-card { padding: var(--spacing-lg); }
    .modal-navigation { padding: 0 10px; }
    .modal-nav { width: 40px; height: 40px; }
    .modal-nav .material-icons { font-size: 20px; }
    .user-avatar { width: 36px; height: 36px; }
    .user-avatar .material-icons { font-size: 20px; }
}

@media (max-width: 480px) {
    .chat-input-row { flex-wrap: wrap; }
    .chat-input { order: -1; width: 100%; margin-bottom: 2px; padding: var(--spacing-sm); }
    .chat-input-wrapper { padding: 3px; margin-bottom: 0; }
    .chat-buttons-mobile { width: 100%; display: flex; justify-content: center; gap: var(--spacing-sm); }
    .chat-buttons-mobile .input-btn { margin: 0; width: 44px; height: 44px; }
    .header { padding: 0 var(--spacing-md); height: 60px; }
    .page { min-height: calc(100vh - 120px); }
    .page-content { padding: var(--spacing-sm); padding-top: 60px; padding-bottom: 140px; }
    .brand-subtitle { font-size: 0.6rem; letter-spacing: 0.01em; }
    .page-header h2 { font-size: 1.3rem; }
    .chat-input-container { width: calc(100% - 1rem); bottom: 0; }
    .chat-buttons-wrapper { margin-top: 1px; }
    .user-avatar { width: 32px; height: 32px; }
    .user-avatar .material-icons { font-size: 18px; }
    .user-avatar:hover { transform: scale(1.03); }
    .user-avatar.has-image:hover { transform: scale(1.05); }
}

/* ===== SPECIAL COMPONENTS ===== */
.user-menu .menu-item.active { background: var(--surface-hover); color: var(--text-primary); border-left: 3px solid var(--accent); padding-left: calc(var(--spacing-sm) - 3px); }
.response-card, [id^="response-"] { overflow-x: auto; overflow-y: visible; word-wrap: break-word; word-break: break-word; white-space: pre-wrap; }
.response-card pre, [id^="response-"] pre { overflow-x: auto; white-space: pre; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--spacing-sm); margin: var(--spacing-sm) 0; }
.response-card code, [id^="response-"] code { word-break: break-all; white-space: pre-wrap; }
.response-card table, [id^="response-"] table { width: 100%; border-collapse: collapse; margin: var(--spacing-md) 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.response-card th, [id^="response-"] th { background: var(--bg-secondary); color: var(--text-primary); font-weight: var(--font-weight-semibold); padding: var(--spacing-sm) var(--spacing-md); text-align: left; border-bottom: 2px solid var(--border-hover); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
.response-card td, [id^="response-"] td { padding: var(--spacing-sm) var(--spacing-md); border-bottom: 1px solid var(--border); color: var(--text-primary); vertical-align: top; line-height: 1.5; }
.response-card tr:nth-child(even), [id^="response-"] tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.response-card tr:hover, [id^="response-"] tr:hover { background: var(--surface-hover); }
.response-card tr:last-child td, [id^="response-"] tr:last-child td { border-bottom: none; }

.ai-code-container { margin: var(--spacing-md) 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-secondary); }
.ai-code-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 0.75rem; height: 32px; flex-shrink: 0; }
.ai-code-language { color: var(--text-secondary); font-weight: var(--font-weight-medium); text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--font-primary); margin: 0; }
.ai-code-copy { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; padding: 0; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; transition: var(--transition); width: 24px; height: 24px; margin: 0; }
.ai-code-copy:hover { background: var(--surface-hover); color: var(--text-primary); transform: scale(1.1); }
.ai-code-copy .material-icons { font-size: 16px; margin: 0; padding: 0; }
.ai-code-content { background: transparent !important; border: none !important; outline: none !important; border-radius: 0; padding: 12px !important; margin: 0 !important; overflow-x: auto; overflow-y: visible; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; font-size: 0.85rem; line-height: 1.4; white-space: pre; color: var(--text-primary); display: block; box-sizing: border-box; }
.ai-inline-code { background: var(--surface); color: var(--text-primary); padding: 1px 4px; border-radius: var(--radius-sm); font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; font-size: 0.8em; border: 1px solid var(--border); word-break: break-all; margin: 0; }

* { -webkit-tap-highlight-color: transparent; }

.scroll-down-button { position: fixed; bottom: 100px; right: 30px; width: 44px; height: 44px; background: var(--surface); backdrop-filter: blur(20px); border: 1px solid var(--border-hover); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 999; opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.8); pointer-events: none; }
.scroll-down-button.visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }
.scroll-down-button:hover { background: var(--surface-hover); transform: translateY(-2px) scale(1.05); box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4); }
.scroll-down-button:active { transform: translateY(0) scale(0.95); }
.scroll-down-button .material-icons { color: var(--text-primary); font-size: 24px; transition: var(--transition); }
.scroll-down-button:hover .material-icons { color: var(--accent); }

@media (max-width: 768px) {
    .response-card table, [id^="response-"] table { font-size: 0.8rem; overflow-x: auto; display: block; white-space: nowrap; }
    .response-card th, [id^="response-"] th, .response-card td, [id^="response-"] td { padding: var(--spacing-xs) var(--spacing-sm); }
    .ai-code-header { padding: 4px 8px; font-size: 0.7rem; height: 28px; }
    .ai-code-copy { width: 20px; height: 20px; }
    .ai-code-copy .material-icons { font-size: 14px; }
    .ai-code-content { font-size: 0.75rem; padding: 8px; line-height: 1.3; }
    .scroll-down-button { bottom: 140px; right: 20px; width: 44px; height: 44px; background: rgba(42, 42, 42, 0.95); border: 2px solid var(--border-hover); }
    .scroll-down-button .material-icons { font-size: 22px; }
}

@media (max-width: 480px) {
    .scroll-down-button { bottom: 140px; right: 20px; width: 46px; height: 46px; background: rgba(42, 42, 42, 0.98); border: 2px solid rgba(255, 255, 255, 0.3); box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5); }
    .scroll-down-button .material-icons { font-size: 24px; color: #ffffff; }
    .scroll-down-button:hover .material-icons { color: #ffffff; }
}

@media (min-width: 480px) {
    .response-card table, [id^="response-"] table { display: block; overflow-x: auto; white-space: nowrap; -ms-overflow-style: none; scrollbar-width: none; }
    .response-card table::-webkit-scrollbar, [id^="response-"] table::-webkit-scrollbar { display: none; }
    .response-card th, [id^="response-"] th, .response-card td, [id^="response-"] td { white-space: nowrap; }
    .ai-code-content { overflow-x: auto; white-space: pre; word-wrap: normal; word-break: normal; }
}

.ai-code-content code[class*="language-"], .ai-code-content pre[class*="language-"] { background: transparent !important; background-color: transparent !important; margin: 0 !important; padding: 0 !important; border: none !important; border-radius: 0 !important; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important; font-size: 0.85rem !important; line-height: 1.4 !important; white-space: pre !important; color: var(--text-primary) !important; text-shadow: none !important; overflow: visible !important; }
.ai-code-container { margin: var(--spacing-md) 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-secondary); }
.ai-code-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 0.75rem; height: 32px; flex-shrink: 0; margin: 0 !important; }
.ai-code-content { background: transparent !important; border: none !important; outline: none !important; border-radius: 0 !important; padding: 12px !important; margin: 0 !important; overflow-x: auto; overflow-y: visible; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; font-size: 0.85rem; line-height: 1.4; white-space: pre; color: var(--text-primary); display: block; box-sizing: border-box; }
.token.keyword { color: #66d9ef !important; } .token.string { color: #e6db74 !important; } .token.function { color: #a6e22e !important; } .token.comment { color: #75715e !important; } .token.number { color: #ae81ff !important; } .token.operator { color: #f92672 !important; } .token.punctuation { color: #f8f8f2 !important; } .token.property { color: #f8f8f2 !important; } .token.boolean { color: #ae81ff !important; } .token.builtin { color: #66d9ef !important; } .token.class-name { color: #a6e22e !important; }
pre[class*="language-"]:before, pre[class*="language-"]:after, code[class*="language-"]:before, code[class*="language-"]:after { display: none !important; }

.input-btn .material-icons { background: rgb(0, 170, 255); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-size: 20px; transition: var(--transition); }
.input-btn { background: transparent; border: none; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); flex-shrink: 0; }
.input-btn:hover { background: var(--surface-hover); transform: scale(1.1); }

/* ===== HEADER NAVIGATION ===== */
.header-nav-scroll { display: flex; gap: 0.25rem; align-items: center; padding: 0.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 25px; backdrop-filter: blur(20px); overflow: visible; width: fit-content; }
.nav-item { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; opacity: 0.5; filter: blur(0.5px); flex-shrink: 0; }
.nav-item.active { background: var(--accent); opacity: 1; filter: none; transform: scale(1.1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
.nav-item:hover:not(.active) { opacity: 0.8; filter: none; transform: scale(1.05); background: var(--surface-hover); }
.nav-item .material-icons { font-size: 20px; color: var(--text-primary); transition: var(--transition); }
.nav-item.active .material-icons { color: var(--bg-primary); }
.user-avatar-nav { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); }
.user-avatar-nav img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar-nav .material-icons { font-size: 18px; color: var(--text-secondary); }

@media (max-width: 768px) {
    .header-right { position: absolute; right: 17%; transform: translateX(50%); }
    .header-nav-scroll { width: 200px; height: 50px; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; background: transparent; border: none; border-radius: 0; backdrop-filter: none; padding: 0; gap: 0; scroll-snap-type: x mandatory; position: relative; }
    .header-nav-scroll::-webkit-scrollbar { display: none; }
    .nav-items-wrapper { display: flex; align-items: center; padding: 0 60px; }
    .nav-item { width: 40px; height: 40px; margin: 0 15px; flex-shrink: 0; transition: all 0.3s ease; cursor: pointer; filter: blur(1.5px); opacity: 0.4; transform: scale(0.7); user-select: none; scroll-snap-align: center; background: transparent; }
    .nav-item.active { filter: blur(0); opacity: 1; transform: scale(1.1); background: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
    .nav-item .material-icons { font-size: 18px; transition: all 0.3s ease; }
    .nav-item.active .material-icons { color: var(--bg-primary); }
    .user-avatar-nav { width: 28px; height: 28px; }
    .user-avatar-nav .material-icons { font-size: 16px; }
}

@media (max-width: 480px) {
    .header-nav-scroll { width: 150px; height: 46px; }
    .nav-items-wrapper { padding: 0 30px; }
    .nav-item { width: 36px; height: 36px; margin: 0 12px; }
    .nav-item .material-icons { font-size: 16px; }
    .user-avatar-nav { width: 24px; height: 24px; }
    .user-avatar-nav .material-icons { font-size: 14px; }
}

body[data-theme="light"] .header-nav-scroll { background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(0, 0, 0, 0.1); }
body[data-theme="light"] .nav-item.active { background: #1a1a1a; }
body[data-theme="light"] .nav-item.active .material-icons { color: #ffffff; }
@media (max-width: 768px) { body[data-theme="light"] .header-nav-scroll { background: transparent; border: none; } }

@media (min-width: 769px) {
    .header-right { position: static; transform: none; right: auto; }
    .header-nav-scroll { display: flex !important; flex-direction: row !important; align-items: center !important; }
    .nav-items-wrapper { display: flex !important; flex-direction: row !important; align-items: center !important; gap: 10px; }
}

/* ===== PROFILE STYLES ===== */
.profile-header { display: flex; flex-direction: column; align-items: center; padding: 2rem 0; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.profile-image-large { margin-bottom: 1.5rem; }
.profile-image-container { width: 120px; height: 120px; border-radius: 50%; border: 3px solid var(--border); overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--surface); transition: var(--transition); }
.profile-image-container:hover { border-color: var(--border-hover); transform: scale(1.05); }
.profile-image-container img { width: 100%; height: 100%; object-fit: cover; }
.profile-image-container .default-avatar { font-size: 3rem; color: var(--text-muted); }
.profile-info-row { display: flex; align-items: center; gap: 2rem; margin-bottom: 1rem; width: 100%; max-width: 600px; justify-content: center; }
.profile-username-section { text-align: center; }
.profile-username-section h2 { margin: 0; font-size: 1.5rem; font-weight: var(--font-weight-light); color: var(--text-primary); }
.profile-username-section p { margin: 0.25rem 0 0 0; color: var(--text-secondary); font-size: 1rem; }
.edit-profile-btn { background: transparent; border: 1px solid var(--border-hover); color: var(--text-primary); padding: 0.5rem 1rem; border-radius: var(--radius); cursor: pointer; display: flex; align-items: center; gap: 0.5rem; transition: var(--transition); font-family: var(--font-primary); }
.edit-profile-btn:hover { background: var(--surface-hover); transform: translateY(-1px); }
.profile-bio-section { text-align: center; margin-bottom: 1.5rem; max-width: 600px; }
.profile-bio-section p { margin: 0; color: var(--text-secondary); line-height: 1.6; }
.profile-stats { display: flex; gap: 2rem; text-align: center; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-number { font-size: 1.2rem; font-weight: var(--font-weight-semibold); color: var(--text-primary); }
.stat-label { font-size: 0.9rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.profile-posts-section { width: 100%; max-width: 800px; margin: 0 auto; }
.posts-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.posts-tabs { display: flex; gap: 1rem; }
.posts-tab { background: transparent; border: none; color: var(--text-secondary); padding: 0.5rem 1rem; border-radius: var(--radius); cursor: pointer; display: flex; align-items: center; gap: 0.5rem; transition: var(--transition); font-family: var(--font-primary); }
.posts-tab.active { color: var(--text-primary); background: var(--surface-hover); }
.posts-tab:hover { background: var(--surface-hover); }
.create-post-btn { background: var(--accent); color: var(--bg-primary); border: none; padding: 0.5rem 1rem; border-radius: var(--radius); cursor: pointer; display: flex; align-items: center; gap: 0.5rem; transition: var(--transition); font-family: var(--font-primary); font-weight: var(--font-weight-medium); }
.create-post-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.post-grid-item { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: var(--transition); position: relative; background: var(--surface); border: 1px solid var(--border); }
.post-grid-item:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); }
.post-grid-item img { width: 100%; height: 100%; object-fit: cover; }
.post-grid-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; opacity: 0; transition: var(--transition); backdrop-filter: blur(2px); }
.post-grid-item:hover .post-grid-overlay { opacity: 1; }
.post-grid-info { color: white; text-align: center; font-size: 0.9rem; font-weight: var(--font-weight-medium); }
.profile-loading { display: flex; flex-direction: column; align-items: center; padding: 3rem; color: var(--text-secondary); }
.profile-loading img { width: 40px; height: 40px; margin-bottom: 1rem; }
.profile-empty-state { text-align: center; padding: 3rem; color: var(--text-secondary); }
.profile-empty-state .material-icons { font-size: 4rem; color: var(--text-muted); margin-bottom: 1rem; }
.profile-empty-state h3 { margin: 0 0 0.5rem 0; color: var(--text-primary); font-weight: var(--font-weight-light); }
.profile-empty-state p { margin: 0 0 1.5rem 0; color: var(--text-secondary); }
.profile-modal { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(10px); z-index: 2000; align-items: center; justify-content: center; padding: 2rem; box-sizing: border-box; }
.profile-modal.active { display: flex; }
.profile-modal-content { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); max-width: 600px; width: 100%; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.profile-modal-content.large { max-width: 900px; }
.modal-header { padding: 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.modal-header h3 { margin: 0; color: var(--text-primary); font-size: 1.2rem; font-weight: var(--font-weight-medium); }
.modal-header-actions { display: flex; gap: 0.5rem; align-items: center; }
.modal-action-btn { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); width: 36px; height: 36px; border-radius: var(--radius); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-action-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.modal-action-btn.delete:hover { background: rgba(244, 67, 54, 0.2); color: #f44336; border-color: #f44336; }
.modal-body { padding: 1.5rem; overflow-y: auto; flex-grow: 1; }

/* ===== SETTINGS ===== */
.settings-container { max-width: 600px; margin: 0 auto; }
.settings-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 2rem; overflow: hidden; backdrop-filter: blur(20px); }
.settings-group h3 { margin: 0; padding: 1rem 1.5rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border); color: var(--text-primary); font-size: 0.9rem; font-weight: var(--font-weight-medium); text-transform: uppercase; letter-spacing: 0.05em; }
.setting-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; cursor: pointer; transition: var(--transition); border-bottom: 1px solid var(--border); color: var(--text-primary); }
.setting-item:last-child { border-bottom: none; }
.setting-item:hover { background: var(--surface-hover); }
.setting-item .material-icons:first-child { color: var(--text-secondary); font-size: 20px; transition: var(--transition); }
.setting-item:hover .material-icons:first-child { color: var(--text-primary); }
.setting-item span:nth-child(2) { flex-grow: 1; color: var(--text-primary); font-weight: var(--font-weight-normal); font-size: 1rem; }
.setting-item .material-icons:last-child { color: var(--text-muted); font-size: 18px; transition: var(--transition); }
.setting-item:hover .material-icons:last-child { color: var(--text-secondary); }
.logout-item { color: var(--text-primary); }
.logout-item:hover { background: rgba(244, 67, 54, 0.1); }
.logout-item:hover .material-icons:first-child { color: #f44336; }
.logout-item:hover span:nth-child(2) { color: #f44336; }

/* ===== SEARCH ===== */
.search-container { max-width: 600px; margin: 2rem auto 2rem auto; }
.search-input-wrapper { display: flex; gap: 0.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.5rem; }
.search-input-wrapper input { flex-grow: 1; background: transparent; border: none; padding: 0.75rem; color: var(--text-primary); font-size: 1rem; outline: none; }
.search-btn { background: transparent; color: var(--text-secondary); border: none; border-radius: 50%; width: 44px; height: 44px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.search-btn:hover { background: var(--surface-hover); }
.search-btn .material-icons { font-size: 20px; }
.search-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; cursor: pointer; transition: var(--transition); }
.profile-card:hover { transform: translateY(-2px); border-color: var(--border-hover); }
.profile-image { width: 60px; height: 60px; border-radius: 50%; overflow: hidden; margin: 0 auto 1rem auto; }
.profile-image img { width: 100%; height: 100%; object-fit: cover; }
.no-profile-image { width: 100%; height: 100%; background: var(--surface-hover); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.profile-info h4 { margin: 0; color: var(--text-primary); font-size: 1rem; }
.profile-name { color: var(--text-secondary); font-size: 0.9rem; margin: 0.25rem 0; }
.profile-about { color: var(--text-secondary); font-size: 0.8rem; margin: 0.5rem 0 0 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-tabs-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.5rem; margin: 1.5rem 0; position: relative; display: flex; gap: 0.25rem; backdrop-filter: blur(20px); }
.search-tab { background: transparent; border: none; color: var(--text-secondary); padding: 0.75rem 1.5rem; border-radius: var(--radius); cursor: pointer; font-size: 0.9rem; font-weight: var(--font-weight-medium); text-transform: uppercase; letter-spacing: 0.05em; transition: color 0.3s ease; position: relative; z-index: 2; flex: 1; text-align: center; font-family: var(--font-primary); display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; }
.search-tab:hover { color: var(--text-primary); }
.search-tab.active { color: var(--text-primary); }
.search-tab-indicator { position: absolute; top: 0.5rem; left: 0.5rem; bottom: 0.5rem; background: var(--accent); border-radius: var(--radius); transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); width: 0px; }
.search-tab .material-icons { font-size: 18px; }
.search-tab.active .material-icons { color: var(--bg-primary); }
.search-tab-count { background: var(--surface-hover); color: var(--text-secondary); padding: 0.125rem 0.375rem; border-radius: 10px; font-size: 0.7rem; font-weight: var(--font-weight-semibold); min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; }
.search-tab.active .search-tab-count { background: rgba(42, 42, 42, 0.3); color: var(--bg-primary); }
.search-results-section { display: none; animation: searchSectionFadeIn 0.4s ease; }
.search-results-section.active { display: block; }
@keyframes searchSectionFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.search-empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); }
.search-empty-state .material-icons { font-size: 3rem; color: var(--text-muted); margin-bottom: 1rem; opacity: 0.7; }
.search-empty-state h4 { margin: 0 0 0.5rem 0; color: var(--text-primary); font-weight: var(--font-weight-light); }
.search-empty-state p { margin: 0; font-size: 0.9rem; }
.post-result-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: var(--transition); display: flex; gap: 1rem; padding: 1rem; margin-bottom: 1rem; backdrop-filter: blur(20px); }
.post-result-card:hover { transform: translateY(-2px); border-color: var(--border-hover); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); }
.post-thumbnail { position: relative; width: 80px; height: 80px; flex-shrink: 0; border-radius: var(--radius); overflow: hidden; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; }
.post-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.no-post-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.no-post-image .material-icons { font-size: 2rem; opacity: 0.5; }
.post-info { flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.post-title { margin: 0 0 0.5rem 0; font-size: 1rem; font-weight: var(--font-weight-medium); color: var(--text-primary); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.post-description { margin: 0 0 0.75rem 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.post-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: auto; }
.post-meta small { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#postsResultsGrid { display: flex; flex-direction: column; gap: 0; }

/* ===== CALENDAR ===== */
.calendar-controls { display: flex; align-items: center; gap: 1rem; }
.privacy-toggle { display: flex; align-items: center; gap: 0.5rem; }
.toggle-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; color: var(--text-secondary); }
.toggle-label input[type="checkbox"] { display: none; }
.toggle-slider { position: relative; width: 44px; height: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: var(--transition); cursor: pointer; }
.toggle-slider:before { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: var(--text-muted); border-radius: 50%; transition: var(--transition); }
.toggle-label input[type="checkbox"]:checked + .toggle-slider { background: #4caf50; border-color: #4caf50; }
.toggle-label input[type="checkbox"]:checked + .toggle-slider:before { transform: translateX(20px); background: white; }
.toggle-text { font-weight: var(--font-weight-medium); min-width: 60px; }
.calendar-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem; backdrop-filter: blur(20px); }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.calendar-header h3 { margin: 0; color: var(--text-primary); font-size: 1.2rem; font-weight: var(--font-weight-medium); }
.calendar-nav-btn { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.calendar-nav-btn:hover { background: var(--surface-hover); color: var(--text-primary); transform: scale(1.1); }
.calendar-grid { width: 100%; overflow: hidden; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin-bottom: 1px; }
.weekday { padding: 0.75rem; text-align: center; font-size: 0.8rem; font-weight: var(--font-weight-semibold); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; background: var(--bg-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); }
.calendar-day { background: var(--surface); min-height: 100px; padding: 0.5rem; border: none; cursor: pointer; transition: var(--transition); position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.calendar-day:hover { background: var(--surface-hover); }
.calendar-day.other-month { background: var(--bg-secondary); color: var(--text-muted); }
.calendar-day.today { background: rgba(33, 150, 243, 0.1); border: 2px solid #2196f3; }
.calendar-day.has-events { background: rgba(76, 175, 80, 0.1); border: 1px solid rgba(76, 175, 80, 0.3); }
.day-number { font-size: 0.9rem; font-weight: var(--font-weight-medium); color: var(--text-primary); margin-bottom: 0.25rem; text-align: center; }
.day-events { flex-grow: 1; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.day-event { background: var(--accent); color: var(--bg-primary); padding: 1px 3px; border-radius: 2px; font-size: 0.6rem; font-weight: var(--font-weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; transition: var(--transition); width: 100%; box-sizing: border-box; max-width: 100%; }
.day-event:hover { transform: scale(1.05); }
.day-event.appointment { background: #2196f3; }
.day-event.meeting { background: #ff9800; }
.day-event.consultation { background: #4caf50; }
.day-event.break { background: #9c27b0; }
.day-event.personal { background: #e91e63; }
.day-event.other { background: #607d8b; }
.more-events { font-size: 0.5rem; color: var(--text-muted); text-align: center; margin-top: 1px; }
.events-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; backdrop-filter: blur(20px); }
.events-section h3 { margin: 0 0 1rem 0; color: var(--text-primary); font-size: 1.1rem; font-weight: var(--font-weight-medium); }
.events-list { display: flex; flex-direction: column; gap: 0.75rem; }
.event-item { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; cursor: pointer; transition: var(--transition); position: relative; }
.event-item:hover { background: var(--surface-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.event-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: var(--radius) 0 0 var(--radius); }
.event-item.appointment::before { background: #2196f3; }
.event-item.meeting::before { background: #ff9800; }
.event-item.consultation::before { background: #4caf50; }
.event-item.break::before { background: #9c27b0; }
.event-item.personal::before { background: #e91e63; }
.event-item.other::before { background: #607d8b; }
.event-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.event-title { font-size: 1rem; font-weight: var(--font-weight-medium); color: var(--text-primary); margin: 0; }
.event-time { font-size: 0.8rem; color: var(--text-secondary); font-weight: var(--font-weight-medium); }
.event-description { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.4; margin: 0; }
.event-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.event-type { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: var(--font-weight-medium); }
.event-date { font-size: 0.8rem; color: var(--text-secondary); }
.premium-form select { width: 100%; background: transparent; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--spacing-sm); font-size: 1rem; color: var(--text-primary); font-family: var(--font-primary); outline: none; transition: var(--transition); }
.premium-form select:focus { border-color: var(--border-hover); background: var(--surface-hover); }
.premium-form input[type="date"], .premium-form input[type="time"] { width: 100%; background: transparent; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--spacing-sm); font-size: 1rem; color: var(--text-primary); font-family: var(--font-primary); outline: none; transition: var(--transition); }
.premium-form input[type="date"]:focus, .premium-form input[type="time"]:focus { border-color: var(--border-hover); background: var(--surface-hover); }

/* ===== COLLABORATIVE CHAT ===== */
.collaboration-layout { display: flex; height: 100%; overflow: hidden; background: var(--bg-primary); position: relative; margin-top: 0; }
#collaborationPage { height: 100vh; overflow: hidden; box-sizing: border-box; }
@media (min-width: 769px) { #collaborationPage { padding-top: 80px; } }
@media (max-width: 768px) { #collaborationPage { padding-top: 60px; } }
@media (max-width: 480px) { #collaborationPage { padding-top: 55px; } }
#collaborationPage .page-content { padding: 0 !important; max-width: none !important; margin: 0 !important; height: calc(100vh - 80px); margin-top: 0 !important; padding-top: 0 !important; }
.chat-sidebar { width: 350px; background: var(--bg-secondary); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; }
.chat-sidebar-header { background: var(--surface); color: var(--text-primary); padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); backdrop-filter: blur(20px); }
.chat-sidebar-header h3 { margin: 0; font-size: 1.1rem; font-weight: var(--font-weight-medium); }
.add-contact-btn { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.add-contact-btn:hover { background: var(--surface-hover); color: var(--text-primary); transform: scale(1.1); }
.contact-search { padding: 0.75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.contact-search input { width: 100%; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 20px; padding: 0.5rem 1rem; font-size: 0.9rem; color: var(--text-primary); outline: none; transition: var(--transition); font-family: var(--font-primary); }
.contact-search input:focus { border-color: var(--border-hover); background: var(--surface-hover); }
.contact-search input::placeholder { color: var(--text-muted); }
.contacts-list { flex-grow: 1; overflow-y: auto; background: var(--bg-secondary); }
.contact-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; cursor: pointer; border-bottom: 1px solid var(--border); transition: var(--transition); position: relative; }
.contact-item:hover { background: var(--surface-hover); }
.contact-item.active { background: var(--surface-hover); border-left: 4px solid var(--accent); }
.contact-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-weight: var(--font-weight-medium); font-size: 1.1rem; flex-shrink: 0; overflow: hidden; }
.contact-avatar img { width: 100%; height: 100%; object-fit: cover; }
.contact-info { flex-grow: 1; min-width: 0; }
.contact-name { font-size: 1rem; font-weight: var(--font-weight-medium); color: var(--text-primary); margin: 0 0 0.25rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-last-message { font-size: 0.85rem; color: var(--text-secondary); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; flex-shrink: 0; }
.contact-time { font-size: 0.75rem; color: var(--text-muted); }
.unread-count { background: var(--accent); color: var(--bg-primary); font-size: 0.7rem; font-weight: var(--font-weight-semibold); padding: 0.125rem 0.375rem; border-radius: 10px; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.no-contacts { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; color: var(--text-secondary); text-align: center; }