body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
}

/* PDF Specific Styles */
@media print {
    body {
        zoom: 0.65; /* Adjust zoom to fit content */
    }
    
    .container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100vh;
        margin: 0;
        padding: 0;
    }
    
    #pdf-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    #pdf-title {
        text-align: center;
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .dashboard {
        font-size: 12px;
        margin-bottom: 10px;
        width: 100%;
        max-width: 800px; /* Adjust as needed */
    }
    
    #habits-table {
        font-size: 8px;
        width: 100%;
        max-width: 1000px; /* Ensure full width */
    }
}

.container {
    max-width: 100%;
    overflow-x: auto;
}

.dashboard {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.dashboard-item {
    text-align: center;
    flex: 1;
}

.dashboard-item h3 {
    margin-bottom: 10px;
    color: #333;
}

.dashboard-item div {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
}

#habits-table-container {
    overflow-x: auto;
    position: relative;
}

#habits-table {
    width: 100%;
    min-width: 1000px;
    border-collapse: separate;
    border-spacing: 0;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#habits-table th, #habits-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#habits-table thead tr th:first-child,
#habits-table tbody tr td:first-child {
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 2;
}

#habits-table thead th:first-child {
    z-index: 3;
}

#habits-table thead {
    background-color: #f2f2f2;
}

#habits-table th.today {
    background-color: #FF6B6B;
    color: white;
    font-weight: bold;
}

.habit-cell {
    cursor: pointer;
}

.completed {
    background-color: #4CAF50;
    color: white;
}

#habits-table .total-completed {
    font-weight: bold;
    background-color: #e0e0e0;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.controls {
    margin-top: 20px;
    text-align: center;
}

#add-habit-btn {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#current-date {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

#date-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

#date-controls input[type="date"] {
    padding: 5px;
    font-size: 16px;
}

#apply-date-btn {
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.edit-habit-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 10px;
    font-size: 16px;
}

#edit-habit-modal .modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

#delete-habit-btn {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

#edit-habit-modal input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
}

#download-pdf-btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

#download-pdf-btn:hover {
    background-color: #0056b3;
}

#pdf-table-wrapper {
    width: 100%;
    max-width: none;
    overflow-x: auto;
}

#pdf-content {
    width: 100%;
    max-width: none;
}