:root {
    --primary-color: #6366f1;
    --primary-hover: #5855eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #ffffff;
    --surface-color: #f8fafc;
    --card-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
    --transition: all 0.2s ease-in-out;
}

[data-theme="dark"] {
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --card-color: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #475569;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    font-size: 14px;
    padding: 0;
    margin: 0;
}

/* Mobile-first typography */
@media (min-width: 768px) {
    body {
        font-size: 16px;
    }
}

/* Login Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    padding: 2rem;
}

.login-card {
    background: var(--card-color);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.login-form {
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--surface-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    text-align: left;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.demo-credentials {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.demo-credentials code {
    background-color: var(--border-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.auth-switch a:hover {
    text-decoration: underline;
    color: #8b5cf6;
}

.register-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    padding: 2rem;
    font-family: monospace;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header - Mobile First */
.header {
    background: linear-gradient(135deg, var(--card-color), rgba(99, 102, 241, 0.05));
    border-bottom: 3px solid var(--border-color);
    padding: 0.75rem 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .header {
        padding: 1rem 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 0 20px rgba(99, 102, 241, 0.05);
    }
    
    .header-content {
        padding: 1rem;
        flex-direction: row;
        gap: 1rem;
    }
}

.app-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

@media (min-width: 768px) {
    .app-title {
        font-size: 2.5rem;
        text-align: left;
    }
}

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

@media (min-width: 768px) {
    .header-controls {
        gap: 1.5rem;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }
}

.user-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--surface-color), rgba(99, 102, 241, 0.05));
    border-radius: 20px;
    border: 2px solid var(--border-color);
}

@media (min-width: 768px) {
    .user-info {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
        border-radius: 25px;
    }
}

.user-info:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.user-info #currentUser {
    color: var(--primary-color);
    font-weight: 600;
}

.subscription-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 12px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.subscription-badge.free {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.subscription-badge.premium {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #ffffff;
    border: 1px solid #d97706;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

@media (min-width: 768px) {
    .subscription-badge {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        margin-left: 0.75rem;
    }
}

.theme-toggle, .lang-toggle, .logout-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    font-weight: 700;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.theme-toggle:hover, .lang-toggle:hover, .logout-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.3), 0 0 20px rgba(99, 102, 241, 0.2);
}

.theme-toggle:active, .lang-toggle:active, .logout-btn:active {
    transform: translateY(-2px) scale(1.05);
}

.logout-btn {
    border-color: var(--danger-color);
}

.logout-btn:hover {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    border-color: var(--danger-color);
    color: white;
}



/* Fix per il contenuto dei pulsanti circolari */
.theme-toggle, .lang-toggle, .logout-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    line-height: 1 !important;
    text-align: center !important;
    overflow: hidden !important;
}

/* Navigation - Mobile First */
.nav-bar {
    position: relative;
    background: transparent;
    border: none;
    padding: 1rem;
    margin: 0.5rem auto;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 99;
    border-radius: 0;
    max-width: 1200px;
}

/* Hamburger Menu - Mobile Only */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation Items Container */
.nav-items {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-color);
    border-radius: 0 0 15px 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 20px;
    flex-direction: column;
    gap: 15px;
    z-index: 5;
}

.nav-items.active {
    display: flex;
}



.nav-item {
    background: linear-gradient(135deg, var(--surface-color), rgba(99, 102, 241, 0.03));
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 1rem 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    text-align: center;
    white-space: nowrap;
    flex: 1;
    max-width: 200px;
    min-width: 120px;
}



.nav-item:hover {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border-color: var(--primary-color);
}

.nav-item.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4), 0 0 25px rgba(99, 102, 241, 0.3);

    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}



/* Today's Emotions Cards */
.today-emotions {
    grid-column: span 2;
}

.today-emotions-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
    min-height: 200px;
}

.emotion-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    animation: slideInUp 0.3s ease-out forwards;
    opacity: 0;
    transform: translateY(8px);
    min-height: 80px;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.emotion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6, #ec4899, #f59e0b, var(--primary-color));
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.emotion-card:hover {
    transform: translateY(-1px) scale(1.005);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1), 0 0 10px rgba(99, 102, 241, 0.1);
    border-color: rgba(255,255,255,0.15);
}

.emotion-card:hover::before {
    opacity: 1;
}

.emotion-card:hover .emotion-emoji {
    animation: float 6s ease-in-out infinite, pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1) translateY(0px); }
    25% { transform: scale(1.005) translateY(-0.5px); }
    50% { transform: scale(1.01) translateY(-1px); }
    75% { transform: scale(1.005) translateY(-0.5px); }
}

.emotion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    min-height: 50px;
}

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

.emotion-emoji {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    animation: float 6s ease-in-out infinite;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-1px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.emotion-level {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.emotion-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.emotion-note {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    font-style: italic;
    color: var(--text-secondary);
    position: relative;
    backdrop-filter: blur(5px);
}

.emotion-note::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.6;
}

.emotion-note-text {
    line-height: 1.5;
    margin: 0;
}

.no-emotions {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 2px dashed rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}

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

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

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideInScale 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    transform: rotate(90deg);
}

.modal-body {
    padding: 1rem 2rem 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.day-summary {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.summary-count {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    font-weight: 500;
}

.day-moods-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.day-mood-item {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    overflow: hidden;
}

.day-mood-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6, #ec4899, #f59e0b, var(--primary-color));
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradientShift 3s ease-in-out infinite;
}

.day-mood-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.day-mood-item:hover::before {
    opacity: 1;
}

.day-mood-item .mood-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.day-mood-item .mood-emoji {
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
}

.day-mood-item .mood-time {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.day-mood-item .mood-label {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    flex: 1;
}

.day-mood-item .mood-note {
    color: rgba(255,255,255,0.8);
    font-style: italic;
    margin-top: 0.75rem;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border-left: 3px solid var(--primary-color);
    line-height: 1.5;
}

/* Scrollbar personalizzata per il modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary-color), #8b5cf6);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #8b5cf6, var(--primary-color));
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 1rem 1.5rem 1.5rem;
    }
    
    .day-mood-item {
        padding: 1rem;
    }
    
    .day-mood-item .mood-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Scrollbar styling for emotions container */
.today-emotions-container::-webkit-scrollbar {
    width: 6px;
}

.today-emotions-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.today-emotions-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border-radius: 3px;
}

.today-emotions-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #8b5cf6, var(--primary-color));
}

/* Responsive adjustments for emotion cards */
@media (max-width: 768px) {
    .today-emotions {
        grid-column: span 1;
    }
    
    .emotion-card {
        padding: 1rem;
    }
    
    .emotion-emoji {
        font-size: 2rem;
    }
    
    .emotion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
    }
    
    .hamburger-menu {
        display: flex;
    }
    
    .nav-items {
        display: none;
    }
    
    .nav-item {
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 1rem;
        font-size: 1rem;
    }
}

@media (min-width: 769px) {
    .nav-bar {
        display: flex;
        justify-content: space-evenly;
        align-items: center;
        padding: 1rem 1.5rem;
    }
    
    .hamburger-menu {
        display: none;
    }
    
    .nav-items {
        display: flex;
        position: static;
        background: transparent;
        box-shadow: none;
        padding: 0;
        flex-direction: row;
        gap: 15px;
        width: 100%;
        justify-content: space-evenly;
    }
    
    .nav-item {
        flex: 1;
        max-width: 200px;
        min-width: 120px;
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}

/* Main Content - Mobile First */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 0.5rem 1rem;
    width: 100%;
    overflow-y: auto;
    height: calc(100vh - 120px);
    min-height: 0;
}

@media (min-width: 768px) {
    .main-content {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Cards - Mobile First */
.card {
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .card {
        padding: 1.5rem;
    }
}

/* Dashboard - Mobile First */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    height: fit-content;
}

@media (min-width: 768px) {
    .dashboard-grid {
        gap: 0.75rem;
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 1rem;
    }
    
    .welcome-card {
        grid-column: 1;
        grid-row: 1;
    }
    
    .stats-card {
        grid-column: 2;
        grid-row: 1;
    }
    
    .today-emotions {
        grid-column: 1;
        grid-row: 2;
    }
    
    .recent-moods {
        grid-column: 2;
        grid-row: 2;
    }
}

.welcome-card {
    text-align: center;
    background: linear-gradient(135deg, var(--card-color), rgba(99, 102, 241, 0.05));
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 0.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .welcome-card {
        border: 3px solid var(--border-color);
        border-radius: 25px;
        padding: 1rem;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 30px rgba(99, 102, 241, 0.05);
    }
}

@media (min-width: 1024px) {
    .welcome-card {
        padding: 1.25rem;
    }
}

.welcome-card h2 {
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 768px) {
    .welcome-card h2 {
        font-size: 1.5rem;
    }
}

.welcome-card p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

@media (min-width: 768px) {
    .welcome-card p {
        font-size: 0.95rem;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
}

.stat-item {
    text-align: center;
    background: linear-gradient(135deg, var(--surface-color), rgba(99, 102, 241, 0.03));
    padding: 1rem;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.stat-item:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2), 0 0 25px rgba(99, 102, 241, 0.15);
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
}

.stat-item:hover .stat-value,
.stat-item:hover .stat-label {
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.stat-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.mood-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex: 1;
}

.mood-item {
    background: linear-gradient(135deg, var(--surface-color), rgba(99, 102, 241, 0.03));
    border-radius: 15px;
    border: 2px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.expandable-mood-item {
    cursor: pointer;
}

.mood-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.mood-main {
    display: flex;
    align-items: center;
}

.mood-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.mood-time-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.expand-icon {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
    margin-left: 0.5rem;
    color: var(--primary-color);
}

.expandable-mood-item.expanded .expand-icon {
    transform: rotate(180deg);
}

.mood-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: rgba(255,255,255,0.03);
}

.expandable-mood-item.expanded .mood-details {
    max-height: 200px;
    padding: 0.75rem;
}

.mood-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    font-style: italic;
    background: rgba(255,255,255,0.05);
    padding: 0.5rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.expandable-mood-item:hover {
    transform: translateX(5px) scale(1.01);
    border-color: var(--primary-color);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.2), 0 0 20px rgba(99, 102, 241, 0.1);
}

.expandable-mood-item:hover .mood-header {
    background: rgba(99, 102, 241, 0.1);
}

.expandable-mood-item:hover .mood-emoji {
    transform: scale(1.1);
}

.expandable-mood-item:hover .mood-date {
    color: var(--primary-color);
}

.mood-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.mood-item:hover::before {
    left: 100%;
}

.mood-emoji {
    font-size: 1.5rem;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.mood-item:hover .mood-emoji {
    transform: scale(1.2) rotate(10deg);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.mood-date {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Mood Entry */
.mood-entry-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 0.25rem 1rem 1rem 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mood-entry-container h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    flex-shrink: 0;
}

.emoji-btn {
    background: var(--card-color);
    border: 3px solid var(--border-color);
    border-radius: 20px;
    padding: 1rem;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    transform: scale(1.2) rotate(360deg) translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.emoji-btn:active {
    transform: scale(1.1) rotate(180deg);
}

/* Colori specifici per ogni emoji al hover con effetti spettacolari */
.emoji-btn[data-mood="5"]:hover {
    background: linear-gradient(135deg, #42a5f5, #1976d2);
    border-color: #2196f3;
    color: white;
    box-shadow: 0 20px 40px rgba(66, 165, 245, 0.4), 0 0 30px rgba(66, 165, 245, 0.6);
}

.emoji-btn[data-mood="4"]:hover {
    background: linear-gradient(135deg, #66bb6a, #388e3c);
    border-color: #4caf50;
    color: white;
    box-shadow: 0 20px 40px rgba(102, 187, 106, 0.4), 0 0 30px rgba(102, 187, 106, 0.6);
}

.emoji-btn[data-mood="3"]:hover {
    background: linear-gradient(135deg, #ffeb3b, #f57f17);
    border-color: #fdd835;
    color: #333;
    box-shadow: 0 20px 40px rgba(255, 235, 59, 0.4), 0 0 30px rgba(255, 235, 59, 0.6);
}

.emoji-btn[data-mood="2"]:hover {
    background: linear-gradient(135deg, #ffa726, #e65100);
    border-color: #ff9800;
    color: white;
    box-shadow: 0 20px 40px rgba(255, 167, 38, 0.4), 0 0 30px rgba(255, 167, 38, 0.6);
}

.emoji-btn[data-mood="1"]:hover {
    background: linear-gradient(135deg, #ff6b6b, #c62828);
    border-color: #e55555;
    color: white;
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.4), 0 0 30px rgba(255, 107, 107, 0.6);
}

.emoji-btn.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4), 0 0 25px rgba(99, 102, 241, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4), 0 0 25px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 20px 45px rgba(99, 102, 241, 0.6), 0 0 35px rgba(99, 102, 241, 0.5);
    }
}



.note-section {
    text-align: left;
    margin-bottom: 0.75rem;
}

.note-section label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.note-section textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    background-color: var(--card-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    resize: vertical;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.note-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2), 0 0 20px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--card-color), rgba(99, 102, 241, 0.02));
}

.note-section label {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.note-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1rem 2rem;
    border-radius: 25px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #7c3aed);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4), 0 0 30px rgba(99, 102, 241, 0.3);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(-2px) scale(1.02);
}

.btn-secondary {
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 25px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-large:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4), 0 0 30px rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, #5855eb, #7c3aed);
}

.btn-large:active {
    transform: translateY(-2px) scale(1.02);
}

.btn-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-large:hover::before {
    left: 100%;
}

/* Analytics - Spectacular Layout */
.analytics-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 3rem 3rem 3rem;
}

.analytics-container h2 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
    margin-bottom: 3rem;
}

.analytics-controls {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.analytics-controls select {
    padding: 1rem 1.5rem;
    border: 3px solid var(--border-color);
    border-radius: 25px;
    background-color: var(--card-color);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.analytics-controls select:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.3), 0 0 20px rgba(99, 102, 241, 0.2);
}

.time-range-btn {
    padding: 1rem 2rem;
    border: 3px solid var(--border-color);
    background: var(--card-color);
    color: var(--text-primary);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.time-range-btn:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.3), 0 0 20px rgba(99, 102, 241, 0.2);
}

.time-range-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    animation: pulse-active 2s infinite;
}

@keyframes pulse-active {
    0%, 100% { box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 15px 40px rgba(99, 102, 241, 0.6), 0 0 25px rgba(99, 102, 241, 0.3); }
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.chart-section {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.chart-container {
    background: linear-gradient(135deg, var(--card-color), rgba(99, 102, 241, 0.02));
    padding: 2.5rem;
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 30px rgba(99, 102, 241, 0.05);
    border: 3px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chart-container:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15), 0 0 40px rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.8s;
}

.chart-container:hover::before {
    left: 100%;
}

.chart-container h3 {
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.chart-container canvas {
    max-height: 350px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.chart-container canvas:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* Compact Calendar */
.calendar-section {
    display: flex;
    flex-direction: column;
}

.compact-calendar {
    background-color: var(--card-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    height: fit-content;
}

.compact-calendar h3 {
    margin-bottom: 1rem;
    text-align: center;
}

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

.calendar-nav {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
}

.calendar-nav:hover {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
}

.calendar-month {
    font-weight: 600;
    color: var(--text-primary);
}

/* Mood Legend Card */
.mood-legend-card {
    background-color: var(--card-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.mood-legend-card h3 {
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.legend-item:hover {
    background-color: var(--surface-color);
}

.legend-emoji {
    font-size: 28px;
    line-height: 1;
}

.legend-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* Mood color classes */
.mood-color-1 {
    background-color: #ff6b6b; /* Rosso per Terrible */
}

.mood-color-2 {
    background-color: #ffa726; /* Arancione per Bad */
}

.mood-color-3 {
    background-color: #ffeb3b; /* Giallo per Okay */
}

.mood-color-4 {
    background-color: #66bb6a; /* Verde per Good */
}

.mood-color-5 {
    background-color: #42a5f5; /* Blu per Excellent */
}

/* Mini Calendar - Heatmap Style */
.mini-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    font-size: 0.8rem;
    margin-top: 1rem;
}

.mini-calendar-header {
    text-align: center;
    font-weight: 600;
    padding: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.mini-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 500;
}

.mini-calendar-day:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.mini-calendar-day[data-date] {
    cursor: pointer;
}

.mini-calendar-day[data-date]:hover {
    background: rgba(255,255,255,0.1);
}

.mini-calendar-day.other-month {
    color: var(--text-secondary);
    opacity: 0.3;
    background-color: transparent;
}

/* Mood intensity levels - heatmap style con colori coerenti */
.mini-calendar-day.mood-level-1 {
    background-color: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    border-color: #e55555;
}

.mini-calendar-day.mood-level-2 {
    background-color: rgba(255, 167, 38, 0.3);
    color: #ffa726;
    border-color: #ff9800;
}

.mini-calendar-day.mood-level-3 {
    background-color: rgba(255, 235, 59, 0.3);
    color: #ffeb3b;
    border-color: #fdd835;
}

.mini-calendar-day.mood-level-4 {
    background-color: rgba(102, 187, 106, 0.3);
    color: #66bb6a;
    border-color: #4caf50;
}

.mini-calendar-day.mood-level-5 {
    background-color: rgba(66, 165, 245, 0.3);
    color: #42a5f5;
    border-color: #2196f3;
}

/* Dark theme adjustments */
[data-theme="dark"] .mini-calendar-day.mood-level-1 {
    background-color: rgba(255, 107, 107, 0.2);
    color: #ff8a80;
    border-color: #e55555;
}

[data-theme="dark"] .mini-calendar-day.mood-level-2 {
    background-color: rgba(255, 167, 38, 0.2);
    color: #ffb74d;
    border-color: #ff9800;
}

[data-theme="dark"] .mini-calendar-day.mood-level-3 {
    background-color: rgba(255, 235, 59, 0.2);
    color: #ffeb3b;
    border-color: #fdd835;
}

[data-theme="dark"] .mini-calendar-day.mood-level-4 {
    background-color: rgba(102, 187, 106, 0.2);
    color: #81c784;
    border-color: #4caf50;
}

[data-theme="dark"] .mini-calendar-day.mood-level-5 {
    background-color: rgba(66, 165, 245, 0.2);
    color: #64b5f6;
    border-color: #2196f3;
}

.mini-calendar-day.today {
    border: 2px solid var(--primary-color);
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Mood intensity legend */
.mood-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mood-legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.mood-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid var(--border-color);
}

/* Settings */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0.5rem 2rem 2rem 2rem;
}

.settings-container h2 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 3rem;
    animation: title-pulse 4s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.settings-group {
    margin-bottom: 3rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.settings-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.settings-group:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
}

.settings-group:hover::before {
    left: 100%;
}

.settings-group h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 1rem;
    flex-direction: row;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.setting-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.setting-item:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.2);
}

.setting-item label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    flex: 1;
}

.setting-item select {
    padding: 0.75rem 1rem;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    min-width: 150px;
}

.setting-item select:hover {
    border-color: rgba(99, 102, 241, 0.6);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.setting-item select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.setting-item .btn {
    margin: 0.25rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    min-width: 140px;
    text-align: center;
}

/* Special layout for Data Management buttons */
.settings-group h3[data-translate="data_management"] + .setting-item {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.settings-group h3[data-translate="data_management"] + .setting-item,
.settings-group h3[data-translate="data_management"] + .setting-item + .setting-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem;
}

.settings-group h3[data-translate="data_management"] + .setting-item .btn,
.settings-group h3[data-translate="data_management"] + .setting-item + .setting-item .btn {
    margin: 0;
    width: 100%;
    justify-self: stretch;
}

.setting-item .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.setting-item .btn:hover::before {
    left: 100%;
}

.setting-item .btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.setting-item .btn-secondary:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: #6366f1;
    color: white;
}

.setting-item .btn-danger:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
}

.settings-group p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.settings-group p strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile-First Responsive Design */

/* Additional mobile styles */
.stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.chart-container canvas {
    max-height: 200px;
}

.mini-calendar {
    font-size: 0.75rem;
}

.mini-calendar-day {
    padding: 0.25rem;
    font-size: 0.7rem;
}

.toast {
    min-width: auto;
    margin: 0 1rem;
    font-size: 0.875rem;
}

.header-controls {
    gap: 0.5rem;
    justify-content: center;
}

.user-info {
    display: none;
}

.login-card {
    padding: 1.5rem;
    margin: 1rem;
}

/* Small mobile devices */
@media (max-width: 480px) {
    .emoji-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 250px;
    }
    
    .emoji-btn {
        padding: 0.75rem;
        font-size: 1.5rem;
    }
    
    .login-card {
        padding: 1rem;
    }
    
    .app-title {
        font-size: 1.25rem;
    }
    
    .nav-item {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .mood-entry-container h2 {
        font-size: 1.5rem;
    }
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    .header-content {
        padding: 1rem 2rem;
        flex-direction: row;
    }
    
    .main-content {
        padding: 0.5rem 2rem 2rem 2rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .analytics-grid {
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1rem;
        max-width: 400px;
    }
    
    .nav-bar {
        padding: 0 2rem;
        justify-content: flex-start;
    }
    
    .nav-item {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .setting-item {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
    
    .toast {
        min-width: 300px;
        margin: 0;
    }
    
    .header-controls {
        gap: 1rem;
        justify-content: flex-end;
    }
    
    .user-info {
        display: block;
    }
    
    .login-card {
        padding: 3rem;
    }
}

/* Calendar Navigation Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.calendar-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.calendar-nav-btn {
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
}

.calendar-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.calendar-nav-btn:active {
    transform: scale(0.95);
} margin: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .chart-container canvas {
        max-height: 250px;
    }
}

/* Desktop and larger screens */
@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .chart-container canvas {
        max-height: 300px;
    }
    
    .emoji-grid {
        max-width: 500px;
    }
    
    .emoji-btn {
        padding: 1.25rem;
        font-size: 2.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Modal styles for password setup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.modal-content h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    text-align: center;
}

.modal-content p {
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
}

.modal-content .form-group {
    margin-bottom: 1rem;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.modal-content .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-background);
    color: var(--text-color);
    font-size: 1rem;
    box-sizing: border-box;
}

.modal-content .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.modal-content .form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-content .form-actions button {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-content .form-actions button[type="submit"] {
    background: var(--primary-color);
    color: white;
}

.modal-content .form-actions button[type="submit"]:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.modal-content .form-actions button[type="button"] {
    background: var(--background-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.modal-content .form-actions button[type="button"]:hover {
    background: var(--border-color);
    color: var(--text-color);
}

/* Advertisement Banner */
.ad-banner {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 16px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ad-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.ad-label {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 0.7rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-text {
    flex: 1;
    padding-top: 8px;
}

.ad-text h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.ad-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.85rem;
}

.ad-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ad-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.ad-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.close-ad-banner {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.3s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-ad-banner:hover {
    color: white;
}

@media (max-width: 768px) {
    .ad-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .ad-actions {
        justify-content: center;
    }
}

/* Modal Base Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #1a1a2e;
    color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Subscription Plans Modal */
.subscription-modal {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.subscription-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.plan-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
    color: white;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.premium-plan {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #3b82f6;
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.plan-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: #3b82f6;
}

.plan-price span {
    font-size: 0.9rem;
    font-weight: 500;
    color: #9ca3af;
}

.plan-features {
    margin-bottom: 1.5rem;
}

.feature {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: #e5e7eb;
}

.feature.limited {
    color: #6b7280;
}

.plan-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.current-plan {
    background: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    cursor: not-allowed;
}

.upgrade-btn {
    background: #3b82f6;
    color: white;
}

.upgrade-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

@media (max-width: 768px) {
    .subscription-plans {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .plan-card {
        padding: 1rem;
    }
    
    .plan-price {
        font-size: 1.5rem;
    }
}