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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #374151;
    background: linear-gradient(135deg, #fdf2f8 0%, #f3e8ff 50%, #dbeafe 100%);
    min-height: 100vh;
}

.app {
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #ec4899, #8b5cf6, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.nav-container {
    background: white;
    border-radius: 9999px;
    padding: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #f3f4f6;
}

.nav-buttons {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #f9fafb;
}

.nav-btn.active {
    background: linear-gradient(135deg, #fce7f3, #e0e7ff);
    color: #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-icon {
    font-size: 1rem;
}

.nav-label {
    display: none;
}

@media (min-width: 640px) {
    .nav-label {
        display: inline;
    }
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Greeting Card */
.greeting-card {
    background: linear-gradient(135deg, #fce7f3, #e0e7ff, #dbeafe);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.time-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.time-icon {
    font-size: 2rem;
}

.time-period {
    font-size: 1.1rem;
    color: #6b7280;
    text-transform: capitalize;
}

.greeting-text {
    font-size: 2rem;
    font-weight: bold;
    color: #374151;
    margin-bottom: 0.5rem;
}

.greeting-subtitle {
    color: #6b7280;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.name-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.name-input {
    padding: 0.5rem 1rem;
    border: 2px solid #fce7f3;
    border-radius: 9999px;
    text-align: center;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.name-input:focus {
    border-color: #ec4899;
}

.save-name-btn {
    padding: 0.5rem 1.5rem;
    background: #ec4899;
    color: white;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}


.history {
  margin-top: 30px;
}

.analytics-section {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: var(--card-shadow);
}

.chart-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
  height: 400px; /* Set a fixed height */
}

.chart-container canvas {
  width: 100% !important;
  height: 200px !important; /* Set a fixed height for each chart */
}

.history-item {
  background: white;
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);

.save-name-btn:hover {
    background: #db2777;

}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.journal-card {
    border: 2px solid #fce7f3;
}

.chatbot-card {
    border: 2px solid #dbeafe;
}

.calendar-card {
    border: 2px solid #d1fae5;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #374151;
    margin-bottom: 0.5rem;
}

.feature-description {
    color: #6b7280;
    margin-bottom: 1rem;
}

.feature-btn {
    background: none;
    border: none;
    color: #ec4899;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.feature-btn:hover {
    color: #db2777;
}

/* Recent Mood Card */
.recent-mood-card {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #fde68a;
}

.recent-mood-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #374151;
    margin-bottom: 1rem;
}

.recent-mood-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.recent-mood-emoji {
    font-size: 2.5rem;
}

.recent-mood-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}

.recent-mood-date {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Journal Styles */
.journal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.5rem;
}

.new-entry-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.new-entry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.4);
}

/* Journal Form */
.journal-form {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #fce7f3;
}

.form-section {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.mood-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.mood-btn {
    padding: 1rem;
    border: 2px solid #f3f4f6;
    border-radius: 1rem;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mood-btn:hover {
    transform: scale(1.05);
    background: #f3f4f6;
}

.mood-btn.selected {
    border-color: #ec4899;
    background: #fce7f3;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
}

.mood-emoji {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.mood-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

#mood-note {
    width: 100%;
    padding: 1rem;
    border: 2px solid #f3f4f6;
    border-radius: 1rem;
    resize: none;
    height: 120px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

#mood-note:focus {
    border-color: #ec4899;
}

:root {
  --card-bg: #ffffff;
  --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* Dark theme */
body.dark {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: #e0e0e0;
  --card-bg: #374151;
  --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);

.form-buttons {
    display: flex;
    gap: 0.75rem;

}

.submit-btn {
    flex: 1;
    padding: 0.75rem;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.3);
}

.cancel-btn {
    padding: 0.75rem 1.5rem;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cancel-btn:hover {
    background: #e5e7eb;
}

/* Journal Entries */
.journal-entries {
    space-y: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: #f9fafb;
    border-radius: 1.5rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.empty-subtitle {
    color: #9ca3af;
}

.journal-entry {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #f3f4f6;
    transition: all 0.2s ease;
}

.journal-entry:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.entry-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.entry-mood {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.entry-emoji {
    font-size: 2.5rem;
}

.entry-mood-text {
    font-size: 1.25rem;
    font-weight: bold;
    color: #374151;
}

.entry-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.entry-note {
    color: #374151;
    line-height: 1.6;
}

/* Chatbot Styles */
.chatbot-container {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e7ff;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chatbot-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border-bottom: 2px solid #e0e7ff;
    background: linear-gradient(135deg, #f3e8ff, #fce7f3);
    border-radius: 1.5rem 1.5rem 0 0;
}

.bot-avatar {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bot-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: #374151;
}

.bot-status {
    font-size: 0.9rem;
    color: #6b7280;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.welcome-message {
    text-align: center;
    padding: 2rem 1rem;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.welcome-title {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    color: #9ca3af;
}

.message {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.message.bot {
    align-self: flex-start;
    background: #f3f4f6;
    color: #374151;
    border-bottom-left-radius: 0.25rem;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.chat-form {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 2px solid #e0e7ff;
}

#chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e7ff;
    border-radius: 9999px;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

#chat-input:focus {
    border-color: #8b5cf6;
}

.send-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: white;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Calendar Styles */
.calendar-container {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #dbeafe;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.calendar-nav-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: #dbeafe;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    color: #3b82f6;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: #bfdbfe;
    transform: scale(1.1);
}

.calendar-month {
    font-size: 1.25rem;
    font-weight: bold;
    color: #374151;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.weekday {
    text-align: center;
    font-weight: 600;
    color: #6b7280;
    padding: 0.5rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

.calendar-day:hover {
    background: #f3f4f6;
}

.calendar-day.today {
    ring: 2px solid #3b82f6;
}

.calendar-day.has-mood {
    background: linear-gradient(135deg, #fce7f3, #e0e7ff);
    cursor: pointer;
}

.calendar-day.has-mood:hover {
    background: linear-gradient(135deg, #fce7f3, #c7d2fe);
}

.calendar-day-emoji {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    font-size: 1.25rem;
}

.calendar-stats {
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #dbeafe;
}

.stats-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-icon {
    font-size: 1.25rem;
}

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

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #3b82f6;
}

.stat-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #8b5cf6;
}

.stat-emoji {
    font-size: 2rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 2rem;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .greeting-text {
        font-size: 1.5rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .journal-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mood-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

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

.tab-content.active {
    animation: fadeIn 0.3s ease;
}

.journal-entry {
    animation: fadeIn 0.3s ease;
}

.message {
    animation: fadeIn 0.3s ease;
}