/* AI Relationship & Communication Coach - Professional Styles */
/* Inspired by BetterHelp, Talkspace, and modern therapy platforms */

:root {
    --primary-gradient: linear-gradient(135deg, #32abb9 0%, #2a8f9b 100%);
    --secondary-gradient: linear-gradient(135deg, #32abb9 0%, #1e8a96 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warm-gradient: linear-gradient(135deg, #32abb9 0%, #5cd0dd 100%);
    
    --primary-color: #32abb9;
    --primary-dark: #2a8f9b;
    --secondary-color: #2a8f9b;
    --accent-color: #5cd0dd;
    
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #a0aec0;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Authentication Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    padding: 20px;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    width: 100%;
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    padding: 60px;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-img {
    width: 50px;
    object-fit: contain;
}

.sidebar .logo-img {
    width: 115px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-block {
    width: 100%;
}

.auth-footer {
    text-align: center;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-visual {
    background: var(--primary-gradient);
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.visual-content h2 {
    font-size: 36px;
    margin-bottom: 16px;
    font-weight: 700;
}

.visual-content p {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 40px;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
}

.testimonials {
    margin-top: 40px;
}

.testimonial {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.testimonial p {
    font-size: 15px;
    font-style: italic;
    margin-bottom: 8px;
}

.testimonial span {
    font-size: 14px;
    opacity: 0.8;
}

/* Dashboard Layout */
.dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fcfd 100%);
    border-right: 1px solid rgba(50, 171, 185, 0.1);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.05);
    width: 280px;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0.5;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(50, 171, 185, 0.1);
    background: white;
    position: relative;
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-item:hover {
    background: rgba(50, 171, 185, 0.08);
    color: var(--primary-color);
    transform: translateX(4px);
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(50, 171, 185, 0.3);
    transform: translateX(0);
}

.nav-item.active::before {
    transform: scaleY(0);
}

.nav-item svg {
    transition: transform 0.3s ease;
}

.nav-item:hover svg {
    transform: scale(1.1);
}

.nav-item.active svg {
    transform: scale(1);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.logout-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.logout-link:hover {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.content-header {
    margin-bottom: 40px;
}

.content-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.content-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Category Selection */
.category-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px 0;
}

.category-card {
    background: white;
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: white;
}

.category-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.category-card p {
    color: var(--text-secondary);
    font-size: 15px;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Chat Interface */
.chat-interface {
    background: white;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.chat-title-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar-header {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.chat-title-text {
    display: flex;
    flex-direction: column;
}

.chat-title h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    scroll-behavior: smooth;
    background: linear-gradient(0deg, rgba(102, 126, 234, 0.02) 0%, rgba(255, 255, 255, 1) 100%);
    background-attachment: fixed;
}

.chat-messages::-webkit-scrollbar {
    width: 10px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 5px;
    margin: 4px 0;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
    opacity: 0.6;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
    opacity: 1;
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: auto;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
}

.welcome-message h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.welcome-message p {
    font-size: 16px;
    color: var(--text-secondary);
}

.message {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    animation: messageSlideIn 0.3s ease-out;
    width: 100%;
    align-items: flex-end;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-user {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.message-assistant {
    flex-direction: row;
    justify-content: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.message-user .message-avatar {
    background: var(--primary-color);
    color: white;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 65%;
    gap: 4px;
}

.message-content {
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    position: relative;
}

.message-assistant .message-content {
    border-top-left-radius: 2px;
}

.message-user .message-content {
    background: #dcf8c6;
    border-color: transparent;
    border-top-right-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.4);
    margin-left: auto;
    margin-top: 4px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-user .message-time {
    color: rgba(0, 0, 0, 0.45);
}

.message-content p {
    margin: 0 0 6px 0;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 14.5px;
    color: var(--text-primary);
}

.message-user .message-content p {
    color: #111;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    font-weight: 600;
}

.message-content ol,
.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}

.typing-indicator {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    width: 100%;
    animation: messageSlideIn 0.3s ease-out;
    align-items: flex-end;
}

.typing-dots {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    display: flex;
    gap: 5px;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.chat-input-container {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    max-width: 100%;
    background: white;
    border-radius: 24px;
    padding: 4px 6px 4px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.emoji-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.emoji-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.chat-input-wrapper textarea {
    flex: 1;
    padding: 8px 0;
    border: none;
    font-size: 14.5px;
    font-family: inherit;
    resize: none;
    min-height: 36px;
    max-height: 120px;
    transition: var(--transition);
    background: transparent;
    line-height: 1.4;
}

.chat-input-wrapper textarea:focus {
    outline: none;
}

.chat-input-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Resources */
.resources-container {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.resource-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.resource-section h2 svg {
    color: var(--primary-color);
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.resource-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.resource-card.expandable {
    cursor: pointer;
}

.resource-card.expandable:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.resource-card.expanded {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-xl);
}

.resource-card.expanded .resource-details {
    max-height: 600px;
    opacity: 1;
    margin-top: 16px;
}

.resource-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: white;
}

.resource-card h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.resource-card > p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.resource-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.resource-details ul {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.resource-details li {
    padding: 8px 0 8px 24px;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.resource-details li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.resource-details li strong {
    color: var(--text-primary);
    font-weight: 600;
}

.try-ai-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.try-ai-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.try-ai-btn::before {
    content: "✨";
    font-size: 16px;
}

/* AI Suggestions Section */
.ai-suggestions-section {
    background: linear-gradient(135deg, #32abb9 0%, #5cd0dd 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-xl);
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.close-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.ai-suggestions-content {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    min-height: 200px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 15px;
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.error-message svg {
    color: #ef4444;
    margin-bottom: 16px;
}

.error-message p {
    color: var(--text-secondary);
    font-size: 15px;
}

.ai-tips-grid {
    /*display: grid;*/
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ai-tip-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    border-left: 4px solid var(--primary-color);
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-tip-number {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
}

.ai-tip-content h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ai-tip-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.tip-action-btn {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tip-action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.ai-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fef3c7;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
}

.ai-disclaimer svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #f59e0b;
}

/* History */
.history-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    margin-bottom: 24px;
}

.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.conversation-item {
    padding: 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    cursor: pointer;
}

.conversation-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.conversation-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.conversation-preview {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.conversation-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-visual {
        display: none;
    }
    
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100vh;
        z-index: 1001;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.2);
        overflow-y: auto;
        width: 280px;
    }
    
    .sidebar.mobile-active {
        left: 0;
    }
    
    .sidebar-close {
        display: flex !important;
    }
    
    .main-content {
        width: 100%;
        padding: 80px 16px 16px;
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .mobile-overlay {
        display: block !important;
    }
    
    /* Show mobile header */
    .mobile-header {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 30px 20px;
    }
    
    .main-content {
        padding: 70px 12px 12px;
    }
    
    .content-header {
        margin-bottom: 24px;
    }
    
    .content-header h1 {
        font-size: 22px;
        line-height: 1.3;
    }
    
    .content-header p {
        font-size: 14px;
    }
    
    .content-header .btn {
        width: 100%;
        margin-top: 12px;
    }
    
    .category-selection {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .category-card {
        padding: 16px;
    }
    
    .category-card h3 {
        font-size: 16px;
    }
    
    .category-card p {
        font-size: 13px;
    }
    
    .chat-interface {
        height: calc(100vh - 70px);
        max-height: calc(100vh - 70px);
        border-radius: var(--radius-md);
        margin: 0 -12px;
    }
    
    .chat-messages {
        padding: 12px;
    }
    
    .message-wrapper {
        max-width: 85% !important;
    }
    
    .message-content {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .resource-card {
        padding: 16px;
    }
    
    .ai-tips-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-input-wrapper textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .nav-item {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 260px;
        left: -260px;
    }
    
    .mobile-menu-btn {
        width: 46px;
        height: 46px;
        top: 12px;
        right: 12px;
    }
    
    .main-content {
        padding: 90px  10px 10px;
    }
    
    .content-header h1 {
        font-size: 20px;
    }
    
    .category-card {
        padding: 14px;
    }
    
    .category-card h3 {
        font-size: 15px;
    }
    
    .category-card p {
        font-size: 12px;
    }
    
    .category-icon {
        width: 40px;
        height: 40px;
    }
    
    .chat-header {
        padding: 10px 12px;
    }
    
    .chat-title-text h2 {
        font-size: 14px;
    }
    
    .ai-avatar-header {
        width: 36px;
        height: 36px;
    }
    
    .online-status {
        font-size: 11px;
    }
    
    .message-content {
        font-size: 13px;
    }
    
    .message-time {
        font-size: 10px;
    }
    
    .resource-card {
        padding: 14px;
    }
    
    .resource-card h3 {
        font-size: 16px;
    }
    
    .chat-input-container {
        padding: 8px 12px;
    }
    
    .chat-input-wrapper {
        padding: 4px 4px 4px 10px;
    }
    
    .send-btn {
        width: 36px;
        height: 36px;
    }
    
    .app-footer {
        font-size: 11px;
        padding: 10px;
    }
    
    .logo-img {
        width: 32px;
    }
    
    .logo-text {
        font-size: 16px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Footer */
.app-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.app-footer p {
    margin: 0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 13px;
    right: 16px;
    z-index: 1002;
    width: 43px;
    height: 43px;
    background: var(--primary-color);
    border: none;
    border-radius: 12px;
    color: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(50, 171, 185, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(50, 171, 185, 0.4);
}

.mobile-menu-btn:active {
    transform: translateY(0);
}

.mobile-menu-btn svg {
    display: block;
    transition: transform 0.3s ease;
}

.mobile-menu-btn.active svg {
    transform: rotate(90deg);
}

/* Hamburger Icon Animation */
.hamburger {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(50, 171, 185, 0.05) 0%, rgba(255, 255, 255, 1) 100%);
    border-bottom: 2px solid rgba(50, 171, 185, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.mobile-header .logo-img {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.mobile-header .logo-img:hover {
    transform: scale(1.05);
}

.mobile-header .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 10px;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Terms and Conditions Page */
.terms-content-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
    margin-top: 24px;
}

.terms-content-wrapper .terms-content {
    line-height: 1.8;
    color: var(--text-primary);
}

.terms-content-wrapper h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.terms-content-wrapper h2:first-child {
    margin-top: 0;
}

.terms-content-wrapper h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 12px;
}

.terms-content-wrapper p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.terms-content-wrapper ol,
.terms-content-wrapper ul {
    margin: 15px 0;
    padding-left: 30px;
}

.terms-content-wrapper li {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.terms-content-wrapper ol ol,
.terms-content-wrapper ul ul {
    margin-top: 10px;
    margin-bottom: 10px;
    padding-left: 30px;
}

.terms-content-wrapper strong {
    color: var(--text-primary);
    font-weight: 600;
}

.terms-content-wrapper a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.terms-content-wrapper a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.terms-content-wrapper .disclaimer-box {
    background: #fff3cd;
    border-left: 4px solid #ff9800;
    padding: 20px;
    margin: 25px 0;
    border-radius: var(--radius-md);
}

.terms-content-wrapper .disclaimer-box h3 {
    color: #ff6b00;
    margin-top: 0;
    font-size: 18px;
    font-weight: 600;
}

.terms-content-wrapper .disclaimer-box p {
    margin: 0;
    color: #664d03;
    line-height: 1.6;
}

.terms-content-wrapper .emergency-box {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 20px;
    margin: 25px 0;
    border-radius: var(--radius-md);
}

.terms-content-wrapper .emergency-box h3 {
    color: #721c24;
    margin-top: 0;
    font-size: 18px;
    font-weight: 600;
}

.terms-content-wrapper .emergency-box p {
    margin: 0;
    color: #721c24;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .terms-content-wrapper {
        padding: 24px 16px;
    }

    .terms-content-wrapper h2 {
        font-size: 20px;
    }

    .terms-content-wrapper h3 {
        font-size: 16px;
    }
}

/* Legacy styles - kept for backwards compatibility if needed elsewhere */
.terms-page {
    min-height: 100vh;
    background: var(--primary-gradient);
    padding: 40px 20px;
}

.terms-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

.terms-header {
    background: var(--primary-gradient);
    color: white;
    padding: 40px;
    text-align: center;
}

.terms-header .logo-img {
    height: 60px;
    width: auto;
    margin-bottom: 20px;
}

.terms-header h1 {
    font-size: 32px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.terms-header p {
    font-size: 16px;
    margin: 0;
    opacity: 0.95;
}

.terms-content {
    padding: 40px;
    line-height: 1.8;
    color: var(--text-primary);
}

.terms-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.terms-content h2:first-child {
    margin-top: 0;
}

.terms-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 12px;
}

.terms-content p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.terms-content ol,
.terms-content ul {
    margin: 15px 0;
    padding-left: 30px;
}

.terms-content li {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.terms-content ol ol,
.terms-content ul ul {
    margin-top: 10px;
    margin-bottom: 10px;
    padding-left: 30px;
}

.terms-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.terms-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.terms-content a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.disclaimer-box {
    background: #fff3cd;
    border-left: 4px solid #ff9800;
    padding: 20px;
    margin: 25px 0;
    border-radius: var(--radius-md);
}

.disclaimer-box h3 {
    color: #ff6b00;
    margin-top: 0;
    font-size: 18px;
    font-weight: 600;
}

.disclaimer-box p {
    margin: 0;
    color: #664d03;
    line-height: 1.6;
}

.emergency-box {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 20px;
    margin: 25px 0;
    border-radius: var(--radius-md);
}

.emergency-box h3 {
    color: #721c24;
    margin-top: 0;
    font-size: 18px;
    font-weight: 600;
}

.emergency-box p {
    margin: 0;
    color: #721c24;
    line-height: 1.6;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.back-button:hover {
    background: var(--primary-dark);
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.terms-footer {
    background: var(--bg-secondary);
    padding: 30px 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
}

.terms-footer p {
    margin: 5px 0;
}

@media (max-width: 768px) {
    .terms-page {
        padding: 20px 10px;
    }

    .terms-header {
        padding: 30px 20px;
    }

    .terms-header h1 {
        font-size: 24px;
    }

    .terms-content {
        padding: 30px 20px;
    }

    .terms-content h2 {
        font-size: 20px;
    }

    .terms-content h3 {
        font-size: 16px;
    }

    .terms-footer {
        padding: 20px;
    }
}

/* Subscribe Prompt Styles */
.subscribe-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--primary-gradient);
}

.prompt-content {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 60px 40px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.6s ease-out;
}

.prompt-icon {
    color: var(--primary-color);
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.prompt-content h2 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.prompt-content p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 30px;
}

.btn-subscribe {
    display: inline-block;
    padding: 16px 40px;
    background: var(--primary-gradient);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
    margin-bottom: 30px;
}

.btn-subscribe:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.features-list {
    margin-top: 30px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.features {
    list-style: none;
    margin-top: 15px;
    text-align: left;
    display: inline-block;
}

.features li {
    padding: 8px 0;
    padding-left: 30px;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
}

.features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 16px;
}

@media (max-width: 768px) {
    .subscribe-prompt {
        min-height: auto;
        padding: 40px 20px;
    }

    .prompt-content {
        padding: 40px 20px;
    }

    .prompt-content h2 {
        font-size: 24px;
    }

    .btn-subscribe {
        width: 100%;
    }
}
