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

html, body {
    height: 100%;
    min-height: 100vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    min-height: 844px; /* iPhone 12 height */
    color: #333;
    /* Ensure gradient fills the viewport and beyond */
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
}

.container {
    max-width: 390px;      /* iPhone 12 width */
    min-width: 320px;
    margin: 0 auto;
    padding: 12px;
    min-height: 844px;     /* iPhone 12 height */
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.dog-image-section {
    background: white;
    border-radius: 20px;
    padding: 12px;
    margin-bottom: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    text-align: center;
}

.dog-image {
    width: 150px;
    height: 150px;
    border-radius: 20px;
    max-width: 80vw;
    max-height: 30vh;
    margin: 0 auto;
    display: block;
}

.streak-section {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 12px;
    margin-bottom: 14px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.streak-number {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 3px;
}

.streak-text {
    font-size: 14px;
    opacity: 0.9;
}

.log-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    margin-top: 12px;
}

.log-btn:hover {
    transform: translateY(-2px);
}

.log-btn:active {
    transform: translateY(0);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 0; /* Remove default margin */
    padding: 18px;
    border-radius: 16px;
    width: 90%;
    max-width: 340px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
#dayModal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.35);
}
#dayModal .close {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 22px;
    cursor: pointer;
}
.remove-walk-btn {
    margin-top: 10px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
.remove-walk-btn:active {
    background: #c0392b;
}
@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 22px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: #667eea;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 16px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    font-size: 15px;
    border-radius: 8px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-log-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s ease;
}

.modal-log-btn:hover {
    transform: translateY(-2px);
}

.modal-log-btn:active {
    transform: translateY(0);
}

.heatmap-section {
    background: white;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.heatmap-title {
    font-size: 15px;
    margin-bottom: 10px;
    color: #333;
}

.heatmap {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 8px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    background: #eee;
    transition: all 0.2s ease;
}

.heatmap-cell.has-walk {
    background: #667eea;
}

.heatmap-cell.has-walk.level-1 {
    background: #c6cfff;
}

.heatmap-cell.has-walk.level-2 {
    background: #9aa9ff;
}

.heatmap-cell.has-walk.level-3 {
    background: #667eea;
}

.heatmap-cell.has-walk.level-4 {
    background: #4c63d2;
}





.month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.month-nav button {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.month-nav span {
    font-weight: 600;
    color: #333;
}

@media (max-width: 400px) {
    .container {
        max-width: 100vw;
        padding: 4vw;
    }
    .modal-content {
        max-width: 95vw;
    }
    .dog-image {
        width: 120px;
        height: 120px;
    }
}