/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #0066ff;
    --secondary-blue: #4285f4;
    --accent-blue: #40a9ff;
    --light-blue: #69c0ff;
    --dark-blue: #003eb3;
    --bg-primary: #0a0e1a;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252b3d;
    --text-primary: #ffffff;
    --text-secondary: #b3b8c4;
    --text-muted: #7d7d7d;
    --border-color: #2d3447;
    --success: #52c41a;
    --warning: #faad14;
    --error: #ff4d4f;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glow: 0 0 20px rgba(0, 102, 255, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 102, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(64, 169, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(66, 133, 244, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.main-nav {
    background: rgba(26, 31, 46, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.nav-tabs {
    display: flex;
    gap: 1rem;
}

.nav-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-tab:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-tab.active {
    background: var(--primary-blue);
    color: white;
    box-shadow: var(--glow);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-level, .points-display {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-level:hover, .points-display:hover {
    background: var(--glass-border);
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.settings-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    color: var(--primary-blue);
    background: var(--glass-bg);
    transform: rotate(90deg);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto; /* Ensure scrolling works */
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
    min-height: 0; /* Allow content to determine height */
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard */
.dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary-blue), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

#current-date {
    color: var(--accent-blue);
    font-weight: 600;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary-blue);
}

.stat-icon {
    background: linear-gradient(45deg, var(--primary-blue), var(--accent-blue));
    border-radius: 12px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.today-habits, .progress-overview {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
}

.today-habits h2, .progress-overview h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.progress-rings {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.progress-ring {
    position: relative;
    text-align: center;
}

.progress-ring-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--primary-blue);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 1s ease;
}

.progress-label {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.activity-heatmap {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
}

.activity-heatmap h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

#heatmap-container {
    display: grid;
    grid-template-columns: repeat(53, 1fr);
    gap: 2px;
    max-width: 100%;
    overflow-x: auto;
}

.heatmap-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--border-color);
    transition: all 0.3s ease;
}

.heatmap-cell.level-1 { background: rgba(0, 102, 255, 0.3); }
.heatmap-cell.level-2 { background: rgba(0, 102, 255, 0.5); }
.heatmap-cell.level-3 { background: rgba(0, 102, 255, 0.7); }
.heatmap-cell.level-4 { background: rgba(0, 102, 255, 1); }

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Buttons */
.primary-btn, .secondary-btn, .danger-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn {
    background: linear-gradient(45deg, var(--primary-blue), var(--accent-blue));
    color: white;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.secondary-btn {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: var(--glass-border);
    transform: translateY(-2px);
}

.danger-btn {
    background: var(--error);
    color: white;
}

.danger-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* Filters */
.habits-filter, .goals-filter, .task-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.habits-filter select, .habits-filter input, .goals-filter select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    min-width: 150px;
}

.habits-filter select option, .goals-filter select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.habits-filter select:focus, .habits-filter input:focus, .goals-filter select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.1);
}

.habits-filter input {
    flex: 1;
}

.filter-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary-blue);
    color: white;
}

/* Grids */
.habits-grid, .goals-grid, .achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.habit-card, .goal-card, .achievement-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.habit-card:hover, .goal-card:hover, .achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary-blue);
}

.habit-header, .goal-header, .achievement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.habit-name, .goal-title, .achievement-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.habit-category, .goal-type {
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.habit-streak, .goal-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.streak-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.habit-actions, .goal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.habit-actions button, .goal-actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.habit-actions button:hover, .goal-actions button:hover {
    color: var(--primary-blue);
    background: var(--glass-bg);
}

.complete-btn {
    background: var(--success) !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
}

.complete-btn:hover {
    background: #45a049 !important;
}

.complete-btn.completed {
    background: var(--text-muted) !important;
    cursor: not-allowed !important;
}

/* Tasks */
.tasks-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.task-calendar, .task-list {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
}

.task-calendar h2, .task-list h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.task-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.task-item:hover {
    border-color: var(--primary-blue);
    transform: translateX(5px);
}

.task-item.completed {
    opacity: 0.7;
    text-decoration: line-through;
}

.task-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.task-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.task-priority {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.task-priority.high { background: var(--error); color: white; }
.task-priority.medium { background: var(--warning); color: white; }
.task-priority.low { background: var(--success); color: white; }

.task-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.task-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.task-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.task-actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.task-actions button:hover {
    color: var(--primary-blue);
    background: var(--glass-bg);
}

/* Calendar */
.calendar-header {
    margin-bottom: 1rem;
}

.calendar-header h3 {
    color: var(--text-primary);
    text-align: center;
}

.calendar-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 1rem;
}

.calendar-day-header {
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.calendar-day {
    min-height: 80px;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.calendar-day:hover {
    background: var(--glass-bg);
}

.calendar-day.today {
    background: var(--primary-blue);
    color: white;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day-number {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.calendar-day-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calendar-task {
    font-size: 0.7rem;
    padding: 0.25rem;
    border-radius: 2px;
    background: var(--glass-bg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-task.high { background: var(--error); }
.calendar-task.medium { background: var(--warning); }
.calendar-task.low { background: var(--success); }

.calendar-task-more {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    overflow: visible; /* Ensure no hidden overflow */
}

/* Analytics specific styles */
#analytics {
    overflow-y: auto; /* Allow scrolling */
    max-height: none; /* Remove any height restrictions */
}

#analytics .section-header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.chart-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    height: 400px; /* Fixed height */
    display: flex;
    flex-direction: column;
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    flex-shrink: 0; /* Prevent title from shrinking */
}

.chart-container canvas {
    flex: 1; /* Take remaining space */
    width: 100% !important;
    height: auto !important;
    max-height: 320px; /* Ensure it doesn't exceed container */
}

/* Achievements */
.achievement-stats {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
}

.achievement-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.achievement-card.unlocked {
    background: linear-gradient(45deg, var(--primary-blue), var(--accent-blue));
    color: white;
}

.achievement-card.unlocked::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.achievement-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.achievement-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.achievement-points {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.achievement-unlocked {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success);
    margin-top: 0.5rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
    background: var(--bg-secondary);
}

.form-group select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-group select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.5rem;
}

.form-group input::placeholder, .form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Settings */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.settings-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    z-index: 3000;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-color: var(--success);
    background: linear-gradient(45deg, var(--success), rgba(82, 196, 26, 0.1));
}

.toast.error {
    border-color: var(--error);
    background: linear-gradient(45deg, var(--error), rgba(255, 77, 79, 0.1));
}

.toast.info {
    border-color: var(--primary-blue);
    background: linear-gradient(45deg, var(--primary-blue), rgba(0, 102, 255, 0.1));
}

/* YouTube Embed */
.youtube-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.file-preview i {
    font-size: 2rem;
    color: var(--primary-blue);
}

.file-preview span {
    flex: 1;
    color: var(--text-primary);
}

.file-preview button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.file-preview button:hover {
    color: var(--primary-blue);
    background: var(--glass-bg);
}

/* Goal Deadline */
.goal-deadline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.goal-deadline.overdue {
    color: var(--error);
}

.goal-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Mood Tracker */
.mood-tracker {
    margin-top: 1rem;
    text-align: center;
}

.mood-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.mood-btn {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mood-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--glow);
}

.mood-btn.active {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
}

/* AI Insights */
.dashboard-insights {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.insights-card, .quotes-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
}

.insights-card h2, .quotes-card h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.insight-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.insight-icon {
    background: var(--primary-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.insight-text {
    flex: 1;
    color: var(--text-primary);
}

/* Quotes */
.quote-container {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border-left: 4px solid var(--primary-blue);
}

.quote-icon {
    font-size: 2rem;
    color: var(--primary-blue);
    margin-top: 0.5rem;
}

.quote-content {
    flex: 1;
}

.quote-text {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-weight: 500;
}

.quote-author {
    font-size: 0.9rem;
    color: var(--accent-blue);
    font-weight: 600;
    font-style: normal;
}

.quote-container:hover {
    background: var(--glass-bg);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Habit Templates */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.template-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-card:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

.template-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.template-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.template-habits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.template-habit {
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Pomodoro Timer */
.pomodoro-timer {
    text-align: center;
    padding: 2rem;
}

.timer-display {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 2rem;
    font-family: 'Courier New', monospace;
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.timer-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

.timer-settings label {
    color: var(--text-primary);
    font-weight: 500;
}

.timer-settings input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    color: var(--text-primary);
}

/* Photo Capture */
.photo-capture {
    text-align: center;
    padding: 2rem;
}

.photo-preview {
    margin: 2rem 0;
    min-height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.photo-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

.photo-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Habit Card Enhancements */
.habit-difficulty {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.habit-difficulty.easy {
    background: var(--success);
    color: white;
}

.habit-difficulty.medium {
    background: var(--warning);
    color: white;
}

.habit-difficulty.hard {
    background: var(--error);
    color: white;
}

.habit-reminder {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.habit-dependencies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.dependency-tag {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.habit-photo-proof {
    background: var(--accent-blue);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.habit-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Section Title with Actions */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title h2 {
    margin: 0;
    color: var(--text-primary);
}

.pomodoro-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.pomodoro-btn:hover {
    background: var(--primary-blue);
    color: white;
}

/* Habit Actions Enhancement */
.habit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.habit-actions .complete-btn {
    flex: 1;
    min-width: 120px;
}

.habit-actions .icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.habit-actions .icon-btn:hover {
    color: var(--primary-blue);
    background: var(--primary-blue);
    color: white;
}

/* AI Score Animation */
.ai-score-animation {
    animation: pulse 2s infinite;
}

/* Today Habits */
.today-habit {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.today-habit:hover {
    background: var(--glass-bg);
}

.today-habit.completed {
    opacity: 0.7;
}

.habit-check {
    display: flex;
    align-items: center;
}

.habit-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-blue);
}

.habit-info {
    flex: 1;
}

.habit-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.habit-streak {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Habit Actions */
.habit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: center;
}

.habit-actions .complete-btn {
    background: var(--success);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.habit-actions .complete-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.habit-actions .complete-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.habit-actions .icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.habit-actions .icon-btn:hover {
    color: var(--primary-blue);
    background: var(--glass-bg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-nav {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .tasks-view {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .habits-grid, .goals-grid, .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .progress-rings {
        flex-direction: column;
        gap: 1rem;
    }
    
    .dashboard-insights {
        grid-template-columns: 1fr;
    }
    
    .quote-container {
        flex-direction: column;
        text-align: center;
    }
    
    .quote-icon {
        margin-top: 0;
        align-self: center;
    }
    
    .mood-selector {
        flex-wrap: wrap;
    }
    
    .section-title {
        flex-direction: column;
        gap: 1rem;
    }
    
    .habit-actions .complete-btn {
        min-width: auto;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .timer-settings {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--glass-border);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Glow Effect */
.glow {
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.5);
}

/* Floating Animation */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}