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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: #667eea;
    color: white;
}

/* Sections - Updated for multi-page design */
.section {
    animation: fadeIn 0.5s ease-in;
}

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

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #ff6b6b;
    color: white;
}

.btn-danger:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
}

/* Load More Button */
.load-more-btn {
    display: block;
    width: 200px;
    margin: 20px auto;
    padding: 12px 25px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.load-more-btn:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* Home Section */
.welcome-section {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
}

.welcome-section h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #667eea;
}

.welcome-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.quick-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.daily-tip {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

.daily-tip h3 {
    color: #667eea;
    margin-bottom: 15px;
}

/* Journal Section */
.journal-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.entry-form h3,
.analysis-results h3 {
    margin-bottom: 20px;
    color: #333;
}

#journal-entry {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

#journal-entry:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#save-entry {
    width: 100%;
}

.analysis-results {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    height: fit-content;
}

.emotion-result {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.emotion-result p {
    font-size: 1.2rem;
    font-weight: 500;
    color: #667eea;
}

.emotion-result .comforting-message {
    font-size: 1rem;
    font-weight: 400;
    color: #6c757d;
    margin-top: 10px;
    font-style: italic;
    background-color: #f0f4f8;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.recommendations-section h3 {
    margin-bottom: 15px;
}

.recommendations {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease;
}

.activity:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.activity::before {
    content: "✨";
    font-size: 1.2rem;
}

/* History Section */
.history-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input,
.filter-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus,
.filter-select:focus {
    border-color: #667eea;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-item {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 5px solid #667eea;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-date {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.history-emotion {
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: capitalize;
}

.history-emotion.Happy {
    background-color: #d4edda;
    color: #155724;
}

.history-emotion.Sad {
    background-color: #d1ecf1;
    color: #0c5460;
}

.history-emotion.Angry {
    background-color: #f8d7da;
    color: #721c24;
}

.history-emotion.Anxious {
    background-color: #fff3cd;
    color: #856404;
}

.history-emotion.Calm {
    background-color: #e2e3e5;
    color: #383d41;
}

.history-entry {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
}

.history-recommendations {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.history-recommendations h4 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.history-recommendations ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-recommendations li {
    background-color: #f8f9fa;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #555;
}

/* Stats Section */
.stats-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    margin-bottom: 15px;
    color: #666;
    font-size: 1rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

.stats-details {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
    justify-content: center;
}

.emotion-distribution,
.emotion-trend {
    background-color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    flex: 1;
    min-width: 400px;
    max-width: 500px;
}

.emotion-distribution h3,
.emotion-trend h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.distribution-chart,
.trend-chart {
    width: 100%;
    height: 400px;
    margin: 0 auto;
}

/* Settings Section */
.settings-container {
    max-width: 600px;
    margin: 30px auto 0;
}

.settings-group {
    background-color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.settings-group h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.setting-item input[type="text"],
.setting-item input[type="checkbox"] {
    margin-right: 10px;
}

.setting-item input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.setting-item input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.setting-item input[type="checkbox"] {
    transform: scale(1.2);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    border-top: 2px solid #eee;
    color: #666;
    font-size: 0.9rem;
}

.footer-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.footer-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Hide desktop-only items on mobile */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .nav-links {
        gap: 10px;
    }
    
    .nav-link {
        padding: 5px 10px;
        font-size: 0.9rem;
    }
    
    .welcome-section h1 {
        font-size: 2rem;
    }
    
    .journal-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quick-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .history-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .welcome-section {
        padding: 20px;
    }
    
    .welcome-section h1 {
        font-size: 1.8rem;
    }
    
    .welcome-section p {
        font-size: 1rem;
    }
}

/* Policy and Terms Pages */
.policy-section, .terms-section, .contact-section {
    max-width: 800px;
    margin: 30px auto 0;
    padding: 0 20px;
}

.policy-section h2, .terms-section h2, .contact-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #667eea;
    text-align: center;
}

.policy-section h3, .terms-section h3 {
    font-size: 1.5rem;
    margin: 30px 0 15px;
    color: #333;
}

.policy-section h4, .terms-section h4 {
    font-size: 1.2rem;
    margin: 20px 0 10px;
    color: #555;
}

.policy-section p, .terms-section p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

.policy-section ul, .terms-section ul, .policy-section ol, .terms-section ol {
    margin: 15px 0 20px 30px;
    color: #555;
}

.policy-section li, .terms-section li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.policy-section strong, .terms-section strong {
    color: #333;
    font-weight: 600;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.contact-info h3, .contact-form h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

.contact-info p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

.contact-details {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-top: 20px;
}

.contact-details p {
    margin-bottom: 10px;
}

.contact-details strong {
    color: #667eea;
    font-weight: 600;
}

/* Contact Form */
#contact-form {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

#contact-form button {
    width: 100%;
}

/* Responsive Design for New Pages */
@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .policy-section h2, .terms-section h2, .contact-section h2 {
        font-size: 1.8rem;
    }
    
    .policy-section h3, .terms-section h3, .contact-info h3, .contact-form h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .policy-section, .terms-section, .contact-section {
        padding: 0 15px;
    }
    
    .policy-section h2, .terms-section h2, .contact-section h2 {
        font-size: 1.5rem;
    }
    
    .contact-details, #contact-form {
        padding: 20px;
    }
}