body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #1a1a1a; /* Dark background */
    color: #e0e0e0; /* Light text */
}

.dashboard-container {
    display: grid;
    grid-template-columns: 0.25fr 0.50fr 0.25fr; /* 25-50-25 ratio */
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 20px auto;
    box-sizing: border-box;
}

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

.card {
    background-color: #2b2b2b; /* Darker card background */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); /* Deeper shadow for dark mode */
    padding: 20px;
    position: relative;
}

.card h3, .card h4 {
    margin-top: 0;
    color: #90caf9; /* Light blue accent */
}

/* Profile Card */
.profile-card {
    text-align: center;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #90caf9; /* Light blue border */
}

.profile-card h3 {
    margin-bottom: 5px;
}

.profile-card p {
    color: #bbb; /* Slightly lighter than main text */
    font-size: 0.9em;
}

/* Calendar Section */
.calendar-section {
    flex-grow: 1; /* Allow calendar to take available space */
}

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

.calendar-header button {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #90caf9; /* Light blue accent */
}

.calendar-header span {
    font-weight: bold;
    font-size: 1.1em;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
    font-size: 0.9em;
}

.calendar-grid div {
    padding: 8px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.calendar-grid div.day-label {
    font-weight: bold;
    background-color: #3f51b5; /* Darker blue */
    color: #e0e0e0;
    cursor: default;
}

.calendar-grid div.current-month {
    background-color: #3a3a3a;
}

.calendar-grid div.current-month:hover {
    background-color: #4a4a4a;
}

.calendar-grid div.selected-date {
    background-color: #5c6bc0; /* Medium blue */
    font-weight: bold;
    border: 1px solid #90caf9;
}

.calendar-grid div.solved-day {
    background-color: #388e3c; /* Darker green for solved */
}

.calendar-grid div.solved-day:hover {
    background-color: #4caf50; /* Lighter green on hover */
}
.solved-day {
    background-color: #4caf50;
    color: white;
    border-radius: 4px;
}

.calendar-grid div.today {
    border: 2px solid #90caf9;
    box-sizing: border-box;
}

.calendar-grid div.empty, .calendar-grid div.other-month {
    color: #777; /* Dimmed for other months/empty cells */
    cursor: default;
    background-color: transparent;
}

/* Language Section */
.language-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

.language-icons img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.2s ease;
    filter: brightness(0.8) saturate(0.8); /* Slightly dim/desaturate for dark mode */
}

.language-icons img:hover {
    transform: scale(1.1);
    filter: brightness(1) saturate(1); /* Restore on hover */
}

/* Daily Progress Grid (GitHub style Heatmap) */
.daily-progress-grid h4 {
    margin-bottom: 15px;
}

.progress-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10px, 1fr));
    gap: 2px;
    padding: 10px;
    background-color: #1a1a1a; /* Matches body or slightly darker */
    border-radius: 5px;
    overflow-x: auto;
    height: 100px; /* Fixed height for heatmap appearance */
    align-items: center; /* Center squares vertically if grid isn't full */
}

.progress-square {
    width: 12px;
    height: 12px;
    background-color: #393939; /* Level 0: No problems (dark gray) */
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

/* GitHub-like heatmap colors */
.progress-square.level-1 {
    background-color: #0e4429; /* Darkest green */
}
.progress-square.level-2 {
    background-color: #006d32; /* Darker green */
}
.progress-square.level-3 {
    background-color: #26a641; /* Medium green */
}
.progress-square.level-4 {
    background-color: #39d353; /* Lightest green */
}

/* Current Day Problems */
.current-day-problems ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.current-day-problems li {
    background-color: #3a3a3a; /* Darker background for list items */
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 5px;
    border-left: 5px solid #90caf9; /* Accent color */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-day-problems li span.problem-title {
    font-weight: bold;
    color: #e0e0e0;
}

.current-day-problems li span.problem-meta {
    font-size: 0.85em;
    color: #bbb;
}

/* Difficulty Progress */
.difficulty-progress .progress-item {
    margin-bottom: 20px;
}

.difficulty-progress .progress-item span:first-child {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.progress-bar-container {
    background-color: #4a4a4a; /* Darker gray for container */
    border-radius: 10px;
    height: 15px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar {
    height: 100%;
    width: 0%; /* Will be set by JS */
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

.progress-bar.easy {
    background-color: #66bb6a; /* Light green */
}

.progress-bar.medium {
    background-color: #ffb300; /* Amber */
}

.progress-bar.hard {
    background-color: #ef5350; /* Red */
}

.difficulty-progress .progress-item span:last-child {
    font-size: 0.9em;
    color: #bbb;
}

/* Dashboard Button (for modal trigger) */
.dashboard-button {
    background-color: #5c6bc0; /* Medium blue, matches selected date */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px; /* Space from progress bars */
}

.dashboard-button:hover {
    background-color: #3f51b5; /* Darker blue on hover */
}

/* Modal (Pop-up) Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.7); /* Black w/ opacity */
    backdrop-filter: blur(5px); /* Optional: blur background */
}

.modal-content {
    background-color: #2b2b2b; /* Same as card background */
    margin: 10% auto; /* 10% from the top and centered */
    padding: 30px;
    border: 1px solid #444;
    border-radius: 10px;
    width: 80%; /* Could be adjusted */
    max-width: 600px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

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

.modal-content h4 {
    color: #90caf9;
    margin-bottom: 20px;
    text-align: center;
}

.close-button {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #eee;
    text-decoration: none;
}

/* Styles for list items inside modal (Last 7 Days Problems) */
.modal-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px; /* Limit height for scrollability */
    overflow-y: auto;
}

.modal-content li {
    background-color: #3a3a3a;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 5px;
    border-left: 5px solid #90caf9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-content li span.problem-title {
    font-weight: bold;
    color: #e0e0e0;
}

.modal-content li span.problem-meta {
    font-size: 0.85em;
    color: #bbb;
}

.modal-content li.pending {
    border-left-color: #ffb300;
    background-color: #4a4230;
}

.modal-content li.completed {
    border-left-color: #66bb6a;
    background-color: #3a4a3b;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 15px;
    }
    .column {
        flex-direction: column;
    }
    .daily-progress-grid .progress-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(10px, 1fr));
    }
    .modal-content {
        margin: 5% auto;
        width: 90%;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        margin: 10px auto;
        padding: 10px;
    }
    .card {
        padding: 15px;
    }
    .profile-photo {
        width: 120px;
        height: 120px;
    }
    .language-icons img {
        width: 50px;
        height: 50px;
    }
    .daily-progress-grid .progress-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(8px, 1fr));
        padding: 5px;
        height: 80px;
    }
    .progress-square {
        width: 10px;
        height: 10px;
    }
    .calendar-grid div {
        padding: 5px 0;
    }
    .modal-content {
        margin: 10% 5%;
        width: 90%;
        padding: 20px;
    }
}
