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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2d3748;
    transition: background-color 0.4s ease;
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.back-button button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #4a5568;
}

.back-button button:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.diary-container {
    display: flex;
    height: 100vh;
    gap: 0;
}

.calendar-section {
    width: 320px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 80px 24px 24px 24px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.calendar-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #4a5568;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.calendar-header button:hover {
    background: #edf2f7;
}

.calendar-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    letter-spacing: -0.5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid transparent;
}

.calendar-day:hover {
    background: #edf2f7;
    border-color: #e2e8f0;
}

.calendar-day.selected {
    background: #4299e1;
    color: white;
}

.calendar-day.other-month {
    color: #a0aec0;
}

.calendar-day.has-content::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #48bb78;
    border-radius: 50%;
}

.diary-section {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 40px 40px 40px;
    overflow-y: auto;
}

.diary-header {
    margin-bottom: 30px;
}

.diary-header h3 {
    font-size: 56px;
    font-weight: 300;
    color: white;
    letter-spacing: -2px;
    font-feature-settings: 'tnum';
    margin-bottom: 8px;
}

.diary-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.notes-section,
.tasks-section,
.reflection-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.notes-section:hover,
.tasks-section:hover,
.reflection-section:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.notes-section h4,
.tasks-section h4,
.reflection-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notes-section textarea,
.reflection-section textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: all 0.2s ease;
}

.notes-section textarea:focus,
.reflection-section textarea:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.task-input-group {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
}

.task-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.task-input-group input:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.task-input-group button {
    width: 50px;
    background: #2d3748;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.task-input-group button:hover {
    background: #1a202c;
}

.task-input-group button:active {
    transform: scale(0.98);
}

#dailyTasksList {
    list-style: none;
}

#dailyTasksList li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 14px;
}

#dailyTasksList li:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #e2e8f0;
    transform: translateX(2px);
}

.task-checkbox {
    margin-right: 10px;
}

.task-text {
    flex: 1;
    font-size: 14px;
}

.task-text.completed {
    text-decoration: line-through;
    opacity: 0.6;
    color: #38a169;
}

.delete-task {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.delete-task:hover {
    opacity: 1;
    background: #c53030;
    transform: scale(1.05);
}

/* Animazioni di ingresso */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#dailyTasksList li {
    animation: fadeInUp 0.3s ease;
}

@media (max-width: 768px) {
    .diary-container {
        flex-direction: column;
    }
    
    .calendar-section {
        width: 100%;
        height: 300px;
        padding: 60px 20px 20px 20px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .diary-section {
        padding: 20px;
    }
    
    .diary-header h3 {
        font-size: 36px;
    }
}
