/* Reset e Variabili CSS */
:root {
    /* Colori principali */
    --primary-color: #0a7ea4;
    --primary-dark: #096a8c;
    --primary-light: #0c9ac9;
    --secondary-color: #667eea;
    --accent-color: #ff6b6b;
    
    /* Colori neutri */
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-primary: #050505;
    --text-secondary: #65676b;
    --text-muted: #8a8d91;
    --border-color: #e4e6eb;
    --hover-color: #f2f3f5;
    
    /* Gradienti */
    --gradient-primary: linear-gradient(90deg, #0a7ea4 0%, #0c9ac9 100%);
    --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-avatar: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    
    /* Spaziature */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
    
    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Ombre */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.15);
    
    /* Transizioni */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.logo-loading {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-md);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-sm) 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    color: white;
    flex-shrink: 0;
}

/* Navigation */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: var(--space-sm);
    list-style: none;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}

/* Search */
.search-container {
    position: relative;
    flex: 0 1 280px;
}

.search-box {
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
    padding-right: 40px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-box::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-box:focus {
    background: rgba(255,255,255,0.25);
}

.search-icon {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
    pointer-events: none;
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: var(--space-xs);
}

.search-result-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.search-result-item:hover {
    background: var(--hover-color);
}

.search-result-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-avatar);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 2px;
}

.search-result-username {
    color: var(--text-secondary);
    font-size: 11px;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.btn {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}

.btn-login {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-login:hover {
    background: white;
    color: var(--primary-color);
}

.btn-register {
    background: white;
    color: var(--primary-color);
}

.btn-register:hover {
    background: var(--hover-color);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: white;
    cursor: pointer;
    position: relative;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 25px;
    transition: var(--transition);
}

.user-menu:hover {
    background: rgba(255,255,255,0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.username {
    font-weight: 500;
    font-size: 14px;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    margin-top: var(--space-sm);
    overflow: hidden;
}

.user-menu:hover .user-dropdown {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    font-size: 14px;
}

.dropdown-item:hover {
    background: var(--hover-color);
}

.dropdown-item.logout {
    color: #e74c3c;
    border-bottom: none;
}

/* Main Content */
.main-container {
    max-width: 1200px;
    margin: var(--space-lg) auto;
    padding: 0 var(--space-md);
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-lg);
    align-items: start;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

/* Create Post */
.create-post-card {
    margin-bottom: var(--space-lg);
}

.create-post-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.post-input-container {
    flex: 1;
}

.post-input {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    background: var(--bg-color);
}

.post-input:focus {
    border-color: var(--primary-color);
    background: white;
}

.post-input-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-xs);
}

.char-count {
    font-size: 12px;
    color: var(--text-muted);
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.post-options {
    display: flex;
    gap: var(--space-sm);
}

.post-option {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    color: var(--text-secondary);
    background: none;
    border: none;
}

.post-option:hover {
    background: var(--hover-color);
}

.btn-post {
    background: var(--primary-color);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-post:hover {
    background: var(--primary-dark);
}

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

/* Media Preview */
.media-preview {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-color);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
    display: none;
}

.media-preview.has-media {
    display: block;
}

.media-preview img,
.media-preview video {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
}

/* Posts Feed */
.posts-feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.loading-posts {
    text-align: center;
    padding: var(--space-xxl);
    color: var(--text-muted);
}

.loading-spinner-small {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-sm);
}

/* Post Styling */
.post {
    position: relative;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.post-user-info {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-avatar);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.post-user-details h3 {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-weight: 600;
}

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

.post-menu {
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

.post-content {
    margin-bottom: var(--space-md);
    line-height: 1.5;
    color: var(--text-primary);
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-media {
    margin-bottom: var(--space-md);
}

.post-media img,
.post-media video {
    max-width: 100%;
    border-radius: var(--radius-md);
}

.post-stats {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
}

.post-interactions {
    display: flex;
    justify-content: space-around;
    padding-top: var(--space-xs);
}

.interaction-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    flex: 1;
    justify-content: center;
}

.interaction-btn:hover {
    background: var(--hover-color);
}

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

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    position: sticky;
    top: 80px;
}

/* Profile Card */
.profile-card .profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 32px;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.profile-username {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: var(--space-xs);
}

.profile-location {
    color: var(--text-muted);
    font-size: 12px;
}

.profile-bio {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-color);
    border-radius: var(--radius-md);
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-md);
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.btn-edit-profile {
    width: 100%;
    background: var(--bg-color);
    color: var(--text-primary);
    padding: var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-edit-profile:hover {
    background: var(--hover-color);
}

/* Online Users */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.online-badge {
    background: #e7f3ff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.tab {
    flex: 1;
    padding: var(--space-sm);
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: none;
}

.tab.active {
    color: white;
    background: var(--primary-color);
}

.online-users-list {
    max-height: 350px;
    overflow-y: auto;
}

.loading-online {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    color: var(--text-muted);
    font-size: 13px;
    justify-content: center;
}

.loading-dots {
    display: flex;
    gap: 2px;
}

.loading-dots::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.loading-dots::after {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out 0.2s;
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.online-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: var(--space-xs);
}

.online-user:hover {
    background: var(--hover-color);
}

.online-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-avatar);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    position: relative;
    flex-shrink: 0;
    font-size: 14px;
}

.online-indicator {
    width: 10px;
    height: 10px;
    background: #31a24c;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

.online-info {
    flex: 1;
    min-width: 0;
}

.online-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 2px;
}

.online-location {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-btns {
    display: flex;
    gap: var(--space-xs);
}

.action-btn-small {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-msg {
    background: #e7f3ff;
    color: var(--primary-color);
}

.btn-msg:hover {
    background: #d0e7f7;
}

.btn-kiss {
    background: #ffe8e8;
    color: #e74c3c;
}

.btn-kiss:hover {
    background: #ffd0d0;
}

/* Trending */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.trending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
}

.trending-item:hover {
    background: var(--hover-color);
}

.trending-tag {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.trending-count {
    color: var(--text-secondary);
    font-size: 11px;
    background: var(--bg-color);
    padding: 2px 6px;
    border-radius: 10px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.quick-action {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border: none;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: var(--text-primary);
    text-align: left;
}

.quick-action:hover {
    background: var(--hover-color);
    transform: translateY(-1px);
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: var(--space-lg);
}

.btn-load-more {
    background: var(--bg-color);
    color: var(--text-primary);
    padding: var(--space-md) var(--space-xl);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-load-more:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    right: var(--space-lg);
    top: var(--space-lg);
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.close:hover {
    color: var(--text-primary);
}

.modal-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.modal-header h2 {
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Auth Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    padding: var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

.form-row {
    display: flex;
    gap: var(--space-md);
}

.form-row .form-group {
    flex: 1;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
}

.checkbox input {
    margin: 0;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

.btn-text {
    transition: opacity 0.3s ease;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-footer {
    text-align: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

.modal-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.modal-footer a:hover {
    text-decoration: underline;
}

/* Password Strength */
.password-strength {
    margin-top: var(--space-xs);
}

.strength-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar::before {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    background: #e74c3c;
    transition: width 0.3s ease;
}

/* Chat Modal */
.chat-modal .modal-content {
    max-width: 500px;
    height: 70vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

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

.chat-user-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.chat-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-avatar);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.chat-user-details h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

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

.chat-actions {
    display: flex;
    gap: var(--space-xs);
}

.chat-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.chat-action-btn:hover {
    background: var(--hover-color);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.chat-welcome {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--space-xl);
}

.chat-message {
    max-width: 70%;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    position: relative;
}

.chat-message.own {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: var(--radius-sm);
}

.chat-message.other {
    background: var(--bg-color);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: var(--radius-sm);
}

.chat-input-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.chat-input-actions {
    display: flex;
    gap: var(--space-xs);
}

.chat-input-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.chat-input-btn:hover {
    background: var(--hover-color);
}

.chat-input {
    flex: 1;
    padding: var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    outline: none;
    transition: var(--transition);
}

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

.chat-send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Settings Modal */
.settings-modal {
    max-width: 600px;
}

.settings-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.settings-tab {
    padding: var(--space-md) var(--space-lg);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.settings-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.settings-content {
    min-height: 300px;
}

/* Notifications */
.notifications-container {
    position: fixed;
    top: 80px;
    right: var(--space-md);
    z-index: 9999;
    max-width: 350px;
}

.notification {
    background: var(--card-bg);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    border-left-color: #31a24c;
}

.notification.error {
    border-left-color: #e74c3c;
}

.notification.warning {
    border-left-color: #f39c12;
}

.notification.info {
    border-left-color: var(--primary-color);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    bottom: var(--space-md);
    right: var(--space-md);
    background: #e74c3c;
    color: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 9999;
    display: none;
}

.offline-indicator.show {
    display: block;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
}

.mobile-menu-btn span {
    width: 20px;
    height: 2px;
    background: white;
    transition: var(--transition);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--card-bg);
    z-index: 999;
    box-shadow: var(--shadow-lg);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
}

.mobile-nav-link {
    padding: var(--space-md);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: var(--hover-color);
    color: var(--primary-color);
}

/* Scrollbar Personalization */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Focus Outline */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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