/* 
 * PulseCore User System Styles
 * Modern, responsive UI for user authentication and profiles
 */

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

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent-primary: #a855f7;
    --accent-secondary: #06b6d4;
    --accent-tertiary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border-color: rgba(148, 163, 184, 0.15);
    --border-hover: rgba(168, 85, 247, 0.5);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 0 60px rgba(0, 0, 0, 0.6);
    --blur: blur(25px);
}

body {
    font-family: 'Segoe UI', 'Monaco', 'Cascadia Code', system-ui, monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Auth Page Layout */
.auth-page {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 500px;
}

.auth-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 3rem;
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.form-group label {
    font-weight: 600;
    color: var(--accent-secondary);
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--border-hover);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
    background: rgba(30, 41, 59, 0.8);
}

.form-group input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent-primary);
}

/* Buttons */
.btn {
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.8), rgba(124, 58, 237, 0.9));
    border-color: var(--border-hover);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: rgba(30, 41, 59, 0.9);
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid;
    font-size: 0.875rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Error Messages */
.error-message {
    color: var(--error);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Field Feedback */
.field-feedback {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.field-feedback.success {
    color: var(--success);
}

.field-feedback.error {
    color: var(--error);
}

/* Password Strength Indicator */
.strength-bar {
    height: 4px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
}

.strength-text {
    font-weight: 600;
    font-size: 0.75rem;
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.auth-links p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-links a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Navigation */
.main-nav {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: var(--blur);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-primary);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.3s ease;
}

.user-trigger:hover {
    background: rgba(30, 41, 59, 0.6);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    min-width: 200px;
    z-index: 1000;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(30, 41, 59, 0.8);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Profile Pages */
.profile-container {
    max-width: 100vw;
    margin: 0;
    padding: 0;
}

.profile-header {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: var(--blur);
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.profile-avatar {
    flex-shrink: 0;
}

.avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
}

.profile-info {
    flex: 1;
}

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

.profile-username {
    font-size: 1.25rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.profile-bio {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.meta-item {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-decoration: none;
}

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

/* User Widget for Integration */
.user-widget {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem;
    margin: 1rem 0;
    backdrop-filter: var(--blur);
}

.user-info, .guest-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-stats {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.user-stats a {
    color: var(--accent-primary);
    text-decoration: none;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-small:hover {
    border-color: var(--border-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 0.5);
    color: white;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: rgba(239, 68, 68, 0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-page {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 2rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-meta {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
    
    .profile-username {
        font-size: 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease;
}

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

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

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

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Nova Statistics Styles */
.nova-stats-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.nova-stats-section h3 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.nova-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.nova-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.nova-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-secondary);
    margin-bottom: 0.25rem;
}

.nova-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.last-nova {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Nova Activity Styles */
.nova-activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nova-activity-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.nova-activity-item:hover {
    border-color: var(--border-hover);
    background: rgba(168, 85, 247, 0.05);
}

.nova-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.nova-hash-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    font-family: 'Monaco', 'Cascadia Code', monospace;
}

.nova-hash-link:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.nova-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.nova-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.nova-mini-stat {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.nova-mini-stat strong {
    color: var(--text-primary);
}

.nova-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.nova-mode {
    background: rgba(6, 182, 212, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--accent-secondary);
}

.nova-group {
    background: rgba(236, 72, 153, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--accent-tertiary);
}

.view-all-link {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.view-all-link a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-all-link a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* Responsive Nova Stats */
@media (max-width: 768px) {
    .nova-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nova-stats-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nova-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Enhanced Activity Timeline Styles */
.activity-timeline {
    position: relative;
    padding-left: 0;
}

.activity-date-separator {
    margin: 1.5rem 0 1rem 0;
    text-align: center;
    position: relative;
}

.activity-date-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
    z-index: 1;
}

.activity-date {
    background: var(--bg-primary);
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 2;
    display: inline-block;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.activity-item:hover {
    background: rgba(15, 23, 42, 0.5);
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.activity-icon {
    font-size: 1.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 50%;
    border: 2px solid rgba(168, 85, 247, 0.2);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-description {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.activity-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Activity Type Specific Styles */
.activity-login .activity-icon {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.activity-logout .activity-icon {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.activity-profile .activity-icon {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.3);
}

.activity-security .activity-icon {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.activity-pattern .activity-icon {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
}

.activity-ai .activity-icon {
    background: rgba(236, 72, 153, 0.1);
    border-color: rgba(236, 72, 153, 0.3);
}

.view-all-activity {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Activity Timeline Responsive */
@media (max-width: 768px) {
    .activity-item {
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .activity-icon {
        min-width: 2rem;
        height: 2rem;
        font-size: 1.25rem;
    }
    
    .activity-description {
        font-size: 0.9rem;
    }
    
    .activity-date-separator {
        margin: 1rem 0 0.75rem 0;
    }
}

/* Two-Column Profile Layout */
.profile-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 3rem;
    max-width: 95vw;
    margin: 0 auto;
    padding: 2rem 2rem;
}

.profile-left-column {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.profile-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: var(--blur);
}

.profile-right-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 500px;
}

/* Enhanced Nova Stats Section for Right Column */
.profile-right-column .nova-stats-section {
    margin-top: 0;
}

.profile-right-column .admin-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: var(--blur);
}

.profile-right-column .admin-section h2,
.profile-right-column .nova-stats-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* Adjust profile stats for left column */
.profile-left-column .profile-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.profile-left-column .stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 8px;
}

/* Profile info adjustments for left column */
.profile-left-column .profile-avatar {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-left-column .profile-name {
    text-align: center;
    margin-bottom: 0.5rem;
}

.profile-left-column .profile-username {
    text-align: center;
    margin-bottom: 1rem;
}

.profile-left-column .profile-bio {
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.profile-left-column .profile-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.profile-left-column .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Profile Actions */
.profile-actions {
    text-align: center;
    margin-top: 1.5rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .profile-layout {
        grid-template-columns: 350px 1fr;
        gap: 2rem;
        padding: 1.5rem 1.5rem;
        max-width: 98vw;
    }
}

@media (max-width: 768px) {
    .profile-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .profile-left-column {
        position: static;
    }
    
    .profile-left-column .profile-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .profile-left-column .stat-item {
        padding: 0.75rem 0.5rem;
    }
    
    .profile-card {
        padding: 1.5rem;
    }
    
    .profile-right-column .admin-section {
        padding: 1.5rem;
    }
}