/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #37352f;
    background-color: #ffffff;
    max-width: 600px; /* Reduced max-width for better form appearance */
    margin: 0 auto;
    padding: 80px 20px 20px 20px; /* Updated padding to account for fixed nav */
}

/* Header styles */
.date-header {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e6e6e6;
    position: relative;
    display: block;
    cursor: pointer;
    text-align: center; /* Center the heading */
}

.date-tooltip {
    visibility: hidden;
    background-color: #37352f;
    color: white;
    text-align: center;
    padding: 5px 10px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    top: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 16px;
    white-space: nowrap;
}

.date-header:hover .date-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Enhanced vertical form styles */
.habit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Form group styles - enhanced for vertical layout */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Label styles */
.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: #555;
    margin-bottom: 2px;
}

/* Input styles */
.habit-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box; /* Ensures padding doesn't expand width */
}

.habit-input:focus {
    border-color: #2eaadc;
    box-shadow: 0 0 5px rgba(46, 170, 220, 0.5);
    outline: none;
}

/* Button styles */
.habit-button {
    padding: 14px;
    margin-top: 10px;
    font-size: 16px;
    font-weight: 600;
    background-color: #2eaadc;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.habit-button:hover {
    background-color: #1f91be;
    transform: scale(1.02);
}

.habit-button:active {
    transform: scale(0.98);
}

/* Custom frequency container - maintain vertical layout */
#custom-frequency-container {
    margin-top: 10px;
}

/* Habit list styles (kept for reference) */
.habit-list {
    list-style-type: none;
    padding: 0;
}

.habit-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f1f1;
}

.habit-checkbox {
    appearance: none;
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border: 2px solid #e6e6e6;
    border-radius: 4px;
    margin-right: 15px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.habit-checkbox:checked {
    background-color: #2eaadc;
    border-color: #2eaadc;
}

.habit-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.habit-name {
    font-size: 16px;
    margin-left: 5px;
    flex-grow: 1;
}

.habit-checkbox:checked + .habit-name {
    text-decoration: line-through;
    color: #b1b1b1;
}

/* Add responsive adjustments */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .habit-form {
        padding: 15px;
    }
    
    .date-header {
        font-size: 28px;
    }
}