/* General Styles */
body {
    background-color: #f8f9fa;
}

/* Desktop container */
@media (min-width: 1200px) {
    #app-container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .content {
        padding: 2rem;
    }
    
    .card {
        margin-bottom: 2rem;
    }
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    background-color: #fff !important;
    padding: 0.5rem 1rem;
}

@media (min-width: 1200px) {
    .navbar {
        padding: 0.75rem 2rem;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1.25rem;
        font-size: 1.1rem;
    }
}

.navbar-brand {
    font-weight: bold;
    color: #007bff !important;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 0.25rem;
    background-color: rgba(0,123,255,0.1);
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 123, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-nav .nav-link {
    color: #495057 !important;
    padding: 0.5rem 1rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #007bff !important;
    background-color: rgba(0,123,255,0.05);
}

/* Mobile navbar adjustments */
@media (max-width: 768px) {
    .navbar-collapse {
        background-color: #fff;
        padding: 0.5rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.25rem;
    }
    
    .navbar-nav .nav-item:not(:last-child) {
        margin-bottom: 0.25rem;
    }
}

/* Content */
.content {
    padding: 1rem;
}

/* Pages */
.page {
    display: none;
    padding-bottom: 80px; /* Default padding for all pages */
}

.page.active {
    display: block;
}

/* Mobile menu spacing */
@media (max-width: 991.98px) { /* lg breakpoint in Bootstrap */
    .page {
        padding-bottom: 120px; /* Increased padding on mobile to account for the navigation bar */
    }
    
    .content {
        padding-bottom: 60px; /* Additional padding for the content container */
    }
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0,0,0,.1);
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
}

.btn-lg {
    padding: 1rem 2rem;
}

/* Forms */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* List Groups */
.list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0,0,0,.1);
    padding: 1rem;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Calendar */
.calendar-container {
    margin: 1rem 0;
}

#calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-gap: 5px;
    margin-top: 10px;
}

.calendar-day-header {
    text-align: center;
    font-weight: bold;
    padding: 5px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.calendar-day {
    min-height: 80px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 5px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.calendar-day:hover {
    background-color: #f8f9fa;
}

.calendar-day.empty {
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
}

.calendar-day.has-training {
    border: 1px solid #28a745;
}

.calendar-day.today {
    border: 2px solid #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.calendar-day.today.has-training {
    border: 2px solid #28a745;
    background-color: rgba(40, 167, 69, 0.05);
}

.calendar-day .day-number {
    position: absolute;
    top: 5px;
    right: 5px;
    font-weight: bold;
}

.calendar-day .calories {
    margin-top: 20px;
    font-size: 0.75rem;
    color: #6c757d;
}

.calendar-day .steps-count {
    font-size: 0.7rem;
    color: #28a745;
    margin-top: 2px;
}

/* Day Details Modal */
#dayDetailsModal .modal-body {
    padding: 1.5rem;
}

#dayDetailsModal .list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0,0,0,.1);
    padding: 1rem;
}

#dayDetailsModal .list-group-item:last-child {
    border-bottom: none;
}

#dayDetailsModal .stats-card {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    height: 100%;
}

#dayDetailsModal .stats-card .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #212529;
    margin-bottom: 0.25rem;
}

#dayDetailsModal .stats-card .label {
    font-size: 0.875rem;
    color: #6c757d;
}

#dayDetailsModal .training-detail {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

#dayDetailsModal .training-detail i {
    margin-right: 0.25rem;
}

/* Mobile responsive calendar */
@media (max-width: 768px) {
    #calendar {
        grid-gap: 2px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 3px;
        font-size: 0.85rem;
    }
    
    .calendar-day-header {
        padding: 3px;
        font-size: 0.85rem;
    }
    
    .calendar-day .calories {
        margin-top: 20px;
        font-size: 0.65rem;
        word-break: break-word;
    }

    #dayDetailsModal .stats-card {
        padding: 0.75rem;
    }

    #dayDetailsModal .stats-card .value {
        font-size: 1.25rem;
    }

    #dayDetailsModal .stats-card .label {
        font-size: 0.75rem;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    #calendar {
        grid-gap: 1px;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 2px;
        font-size: 0.75rem;
    }
    
    .calendar-day-header {
        padding: 2px;
        font-size: 0.75rem;
    }
    
    .calendar-day .day-number {
        top: 2px;
        right: 2px;
    }
    
    .calendar-day .calories {
        margin-top: 15px;
        font-size: 0.6rem;
    }

    #dayDetailsModal .modal-body {
        padding: 1rem;
    }

    #dayDetailsModal .stats-card {
        padding: 0.5rem;
    }

    #dayDetailsModal .stats-card .value {
        font-size: 1rem;
    }

    #dayDetailsModal .stats-card .label {
        font-size: 0.7rem;
    }
}

/* Charts */
canvas {
    max-width: 100%;
    height: auto !important;
}

/* Modals */
.modal-content {
    border-radius: 1rem;
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,.1);
}

.modal-body {
    padding: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0;
    }
    
    .content {
        padding: 0.5rem;
    }
    
    .card {
        margin-bottom: 0.5rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Progress Bars */
.progress {
    height: 0.5rem;
    border-radius: 1rem;
    background-color: #e9ecef;
}

.progress-bar {
    background-color: #007bff;
    border-radius: 1rem;
}

/* Stats Cards */
.stats-card {
    text-align: center;
    padding: 1rem;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    transition: transform 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
}

@media (min-width: 1200px) {
    .stats-card {
        padding: 1.5rem;
    }
    
    .stats-card .value {
        font-size: 2.5rem;
    }
    
    .stats-card .label {
        font-size: 1rem;
    }
}

/* Dish Search Autocomplete Styles */
.dish-search-container {
    position: relative;
}

/* Update clear button styles to work with input-group */
#clear-dish-search {
    display: none;
}

#clear-dish-search.visible {
    display: inline-flex !important;
}

#clear-dish-search.mobile-clear-visible {
    color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.1) !important;
    border-color: #dc3545 !important;
}

#dish-search-results {
    display: none;
    position: absolute;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1050;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
    background-color: white;
}

#dish-search-results.show {
    display: block;
}

.dish-search-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dish-search-item:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.dish-search-item .dish-name {
    font-weight: 500;
}

.dish-search-item .dish-details {
    font-size: 0.8rem;
    color: #6c757d;
}

/* User Management Styles */
#users-page .table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

#users-page .table th {
    background-color: #f8f9fa;
    white-space: nowrap;
}

#users-page .table td {
    vertical-align: middle;
}

/* Highlight current user row */
#users-page .table tr.current-user {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Mobile user management styles */
@media (max-width: 768px) {
    #users-page .card-body {
        padding: 0.75rem;
    }
    
    #users-page .table {
        font-size: 0.85rem;
    }
    
    #users-page .table th,
    #users-page .table td {
        padding: 0.5rem;
    }
    
    #users-page .d-grid button {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    #userManagementModal .row {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    #userManagementModal .col-12 {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    #userManagementModal .btn {
        font-size: 0.85rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Extra small devices - transform table to cards */
@media (max-width: 576px) {
    #users-page .table-responsive {
        border: none;
    }
    
    #users-page .table,
    #users-page .table tbody,
    #users-page .table tr,
    #users-page .table td {
        display: block;
        width: 100%;
    }
    
    #users-page .table thead {
        display: none; /* Hide table headers */
    }
    
    #users-page .table tr {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,.1);
        background-color: #fff;
        overflow: hidden;
    }
    
    #users-page .table tr.current-user {
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
        border: 1px solid rgba(0, 123, 255, 0.2);
    }
    
    #users-page .table td {
        position: relative;
        padding: 0.75rem 0.75rem 0.75rem 45%;
        text-align: right;
        border: none;
        border-bottom: 1px solid rgba(0,0,0,.05);
    }
    
    #users-page .table td:last-child {
        border-bottom: none;
    }
    
    #users-page .table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        width: 40%;
        padding-right: 0.5rem;
        font-weight: bold;
        text-align: left;
        color: #495057;
    }
    
    #users-page .table td:nth-child(1):before { content: "ID"; }
    #users-page .table td:nth-child(2):before { content: "Name"; }
    #users-page .table td:nth-child(3):before { content: "Email"; }
    #users-page .table td:nth-child(4):before { content: "Role"; }
    #users-page .table td:nth-child(5):before { content: "Actions"; }
    
    #users-page .table td:nth-child(5) {
        text-align: center;
        padding-left: 0.75rem;
    }
    
    #users-page .table .btn-sm {
        padding: 0.375rem 1rem;
    }
}

/* Responsive utility classes */
.w-md-auto {
    width: 100%;
}

@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }
}

/* Home Page Layout */
@media (min-width: 1200px) {
    #home-page .row {
        margin-bottom: 2rem;
    }
    
    #home-page .btn-lg {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
    }
    
    #home-page .card {
        margin-bottom: 2rem;
    }
}

/* Today's Entries Page */
@media (min-width: 1200px) {
    #today-page h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    #today-page h4 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    #today-page .list-group-item {
        padding: 1.25rem;
    }
}

/* Goals Page */
@media (min-width: 1200px) {
    #goals-page .card {
        max-width: 800px;
        margin: 0 auto;
    }
    
    #goals-page .form-control {
        padding: 0.75rem 1rem;
    }
    
    #goals-page .btn {
        padding: 0.75rem 2rem;
    }
}

/* Modals */
@media (min-width: 1200px) {
    .modal-dialog {
        max-width: 600px;
    }
    
    .modal-lg {
        max-width: 800px;
    }
    
    .modal-body {
        padding: 2rem;
    }
    
    .form-control {
        padding: 0.75rem 1rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
    }
}

/* Mobile Navigation Styles */
.nav-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.nav-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

#mobile-nav {
    white-space: nowrap;
    padding: 0.5rem;
}

#mobile-nav .nav-item {
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

#mobile-nav .nav-link {
    color: #6c757d;
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

#mobile-nav .nav-link i {
    font-size: 1.25rem;
}

#mobile-nav .nav-link span {
    font-size: 0.75rem;
}

#mobile-nav .nav-link.active {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

/* Adjust content padding to account for fixed footer */
@media (max-width: 991.98px) {
    .content {
        padding-bottom: 4rem;
    }
}

.training-info {
    flex: 1;
}

.training-details {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.training-detail {
    margin-bottom: 0.25rem;
}

.training-detail:last-child {
    margin-bottom: 0;
}

.training-notes {
    font-size: 0.875rem;
    color: #666;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    white-space: pre-line;
}

.training-actions {
    min-width: 100px;
}

@media (max-width: 576px) {
    .training-actions {
        min-width: 80px;
    }
    
    .training-actions .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Training Entry Styles */
.list-group-item {
    padding: 1.25rem;
}

.training-entry {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.training-info {
    flex: 1;
}

.training-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.training-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #212529;
    margin: 0;
}

.training-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.training-details {
    color: #666;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

.training-detail {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.training-detail i {
    color: #0d6efd;
    width: 1rem;
    text-align: center;
}

.training-detail:last-child {
    margin-bottom: 0;
}

.training-notes {
    font-size: 0.875rem;
    color: #666;
    padding: 0.75rem;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    white-space: pre-line;
}

.training-actions {
    display: flex;
    gap: 0.5rem;
}

.training-actions .btn {
    padding: 0.375rem 0.75rem;
}

@media (max-width: 576px) {
    .training-entry {
        flex-direction: column;
    }
    
    .training-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #e9ecef;
    }
    
    .training-actions .btn {
        flex: 1;
    }
}

/* Ensure the mobile navigation stays at the bottom */
.fixed-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background-color: #fff;
    border-top: 1px solid rgba(0,0,0,.125);
}

/* Dropzone styles */
.dropzone {
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropzone:hover {
    border-color: #0d6efd;
    background: #f1f3f5;
}

.dropzone .dz-message {
    margin: 2em 0;
}

.dropzone .dz-preview {
    margin: 10px;
}

.dropzone .dz-preview .dz-image {
    border-radius: 4px;
}

.dropzone .dz-preview .dz-details {
    padding: 1em;
    text-align: center;
}

.dropzone .dz-preview .dz-progress {
    height: 4px;
}

.dropzone .dz-preview .dz-error-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 0.5em;
}

.dropzone .dz-preview .dz-remove {
    color: #dc3545;
    text-decoration: none;
    font-size: 0.9em;
}

.dropzone .dz-preview .dz-remove:hover {
    text-decoration: underline;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

#currentMonthYear {
    font-size: 1.1rem;
    min-width: 120px;
    text-align: center;
}

@media (max-width: 576px) {
    #prevMonth, #nextMonth {
        padding: 0.375rem 0.5rem;
        min-width: 40px;
        justify-content: center;
    }
    
    #currentMonthYear {
        font-size: 1rem;
        min-width: 100px;
    }
} 