/* Custom styles for Blood Sugar Tracker */

.card {
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: var(--bs-light);
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
}

.badge {
    font-size: 0.875em;
    padding: 0.375rem 0.75rem;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.table td {
    vertical-align: middle;
}

.navbar-brand {
    font-weight: 700;
}

.alert {
    border: 1px solid;
    border-radius: 0.375rem;
}

.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    background-color: var(--bs-light);
    border: 1px solid var(--bs-border-color);
}

/* Chart container */
#bloodSugarChart {
    max-height: 400px;
}

/* Classification color indicators */
.bg-success { background-color: var(--bs-success) !important; }
.bg-warning { background-color: var(--bs-warning) !important; }
.bg-danger { background-color: var(--bs-danger) !important; }
.bg-info { background-color: var(--bs-info) !important; }

.text-success { color: var(--bs-success) !important; }
.text-warning { color: var(--bs-warning) !important; }
.text-danger { color: var(--bs-danger) !important; }
.text-info { color: var(--bs-info) !important; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-group-sm .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    /* Mobile-friendly navbar */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* Compact cards on mobile */
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    /* Stack buttons vertically on mobile */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
    
    /* Responsive statistics cards */
    .row.g-4 {
        --bs-gutter-x: 1rem;
    }
    
    /* Touch-friendly form inputs */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    /* Responsive chart */
    #bloodSugarChart {
        max-height: 300px;
    }
    
    /* Mobile-friendly table */
    .table td, .table th {
        padding: 0.5rem 0.25rem;
        font-size: 0.875rem;
    }
    
    /* Compact analytics cards */
    .analytics-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Very small screens */
    .display-4 {
        font-size: 2rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    /* Single column layout for forms */
    .row.justify-content-center .col-md-6 {
        max-width: 100%;
    }
    
    /* Compact dashboard header */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    .d-flex.justify-content-between h2 {
        font-size: 1.5rem;
    }
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Focus states for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}
