/* Health Tracker Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0047AB 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

header h1 {
    font-size: 2.5em;
    color: #0047AB;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

/* Section Styles */
.quick-log-section,
.view-section,
.recent-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

h2 {
    color: #0047AB;
    margin-bottom: 20px;
    font-size: 1.8em;
}

/* Quick Log Buttons */
.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.btn-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

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

.btn-wrapper .quick-btn {
    flex: 1 1 0%;
    min-width: 0;
    border-radius: 0;
    box-shadow: none;
}

.btn-wrapper .quick-btn:hover {
    transform: none;
    box-shadow: none;
}

.entry-strip {
    display: flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    background: #FCAB10;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    transition: background 0.2s ease;
    padding: 0;
}

.entry-strip:hover {
    background: #e09a0e;
}

.quick-btn {
    padding: 14px 16px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: white;
}

.quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

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

.no1-btn {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: #333;
}

.no2-btn {
    background: linear-gradient(135deg, #d4a373 0%, #c19a6b 100%);
    color: white;
}

.bsl-btn {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.insulin-btn {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.meal-btn {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.exercise-btn {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%);
}

.event-btn {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

.weight-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.meds-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* View Buttons */
.view-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.view-buttons button {
    padding: 15px;
    background: #8b2e3b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-buttons button:hover {
    background: #a83948;
    transform: translateY(-2px);
}

/* Recent Activity */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0047AB;
}

.activity-item .time {
    font-size: 0.9em;
    color: #666;
}

.activity-item .details {
    margin-top: 5px;
    font-weight: 500;
}

.loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #000;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

/* Time/date inputs need less horizontal padding so browser segments don't misalign when typing */
.form-group input[type="time"],
.form-group input[type="date"] {
    padding: 10px 6px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0047AB;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.btn-primary {
    flex: 1;
    padding: 15px;
    background: #0047AB;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    flex: 1;
    padding: 15px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Log List Styles */
.log-list {
    max-height: 500px;
    overflow-y: auto;
}

.log-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #0047AB;
}

.log-item .log-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
}

.log-item .log-details {
    font-size: 0.95em;
    color: #555;
}

.log-item .log-detail-row {
    margin: 5px 0;
}

.delete-btn {
    background: #f5576c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.delete-btn:hover {
    background: #e04654;
}

/* Success Message */
.success-message {
    background: #4caf50;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2em;
    }


    .quick-btn {
        padding: 11px 12px;
        font-size: 1em;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .button-group {
        flex-direction: column;
    }
}


/* Uniform dark turquoise buttons for Events */
.uniform-btn {
    background: #2c7873 !important;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.uniform-btn:hover {
    background: #3a9188 !important;
}

/* Yellow pee droplet icon */
.pee-icon {
    display: inline-block;
    filter: brightness(0) saturate(100%) invert(78%) sepia(70%) saturate(600%) hue-rotate(5deg) brightness(0.95);
}

/* Recent Activity day dots */
.day-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #0047AB;
    background: white;
    cursor: pointer;
    transition: background 0.2s;
}
.day-dot.active {
    background: #0047AB;
}

/* Modal title colors */
.event-title { color: #2c7873; }
.entry-title { color: #FCAB10; }

/* Nutrition inputs — hide spinners so number aligns flush right under label */
input.ni-input::-webkit-inner-spin-button,
input.ni-input::-webkit-outer-spin-button { display: none; }
input.ni-input { -moz-appearance: textfield; appearance: textfield; }
