/* Enhanced styles for new FitTrack features */

/* Notification System Styles */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 350px;
}

.in-app-notification {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    padding: 16px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.in-app-notification.show {
    transform: translateX(0);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notification-header strong {
    color: var(--text-color);
    font-size: 14px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--bg-color);
}

.notification-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.notification-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.notification-action-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.in-app-message {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    font-size: 14px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.in-app-message.show {
    transform: translateX(0);
}

.in-app-message.success {
    border-left-color: #22c55e;
    background: #f0fdf4;
    color: #15803d;
}

.in-app-message.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
    color: #d97706;
}

.in-app-message.error {
    border-left-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

.in-app-message.info {
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

/* Barcode Scanner Styles */
.barcode-scanner {
    margin-bottom: 20px;
}

.scanner-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.scanner-interface {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
}

.camera-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.barcode-video {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scan-frame {
    width: 200px;
    height: 120px;
    border: 2px solid #fff;
    border-radius: 8px;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
}

.scan-frame::before,
.scan-frame::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 2px;
    background: #22c55e;
    animation: scanLine 2s linear infinite;
}

@keyframes scanLine {
    0%, 100% { transform: translate(-50%, -50%) scaleX(0); }
    50% { transform: translate(-50%, -50%) scaleX(1); }
}

.scan-instruction {
    color: #fff;
    margin-top: 10px;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.scanner-status {
    text-align: center;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-color);
}

.scanner-actions {
    text-align: center;
}

/* Photo Recognition Styles */
.photo-recognition {
    margin-bottom: 20px;
}

.photo-interface {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
}

.food-video {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.food-photo {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.photo-controls {
    text-align: center;
}

.photo-status {
    text-align: center;
    margin-top: 10px;
    font-weight: 500;
    color: var(--text-color);
}

/* Enhanced Food Search Styles */
.food-search-container {
    margin-bottom: 20px;
}

.search-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.search-input-group input {
    flex: 1;
}

.btn-icon {
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.food-suggestions {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    position: relative;
}

.food-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.food-suggestion:hover {
    background: var(--bg-color);
}

.food-suggestion:last-child {
    border-bottom: none;
}

.suggestion-name {
    font-weight: 500;
    color: var(--text-color);
    display: block;
    margin-bottom: 2px;
}

.suggestion-brand {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.suggestion-nutrition {
    font-size: 12px;
    color: var(--primary-color);
}

.recent-foods {
    margin-top: 15px;
}

.recent-foods h4 {
    margin-bottom: 10px;
    color: var(--text-color);
    font-size: 14px;
}

.recent-foods-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.recent-food-item {
    padding: 6px 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.recent-food-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Enhanced Food Details Styles */
.food-details {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.food-info {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.food-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.food-basic-info h4 {
    margin: 0 0 5px 0;
    color: var(--text-color);
}

.food-brand {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 3px 0;
}

.food-source {
    font-size: 11px;
    color: var(--primary-color);
    margin: 0;
    text-transform: uppercase;
    font-weight: 500;
}

.portion-controls {
    margin-bottom: 20px;
}

.portion-controls label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.portion-input-group {
    display: flex;
    gap: 8px;
}

.portion-input-group input {
    flex: 2;
}

.portion-input-group select {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
}

.nutrition-preview {
    margin-bottom: 20px;
}

.nutrition-preview h4 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.nutrition-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.nutrient-name {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.nutrient-value {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 600;
}

/* Enhanced Daily Summary Styles */
.daily-nutrition-summary {
    margin-bottom: 25px;
}

.daily-nutrition-summary h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.nutrition-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.summary-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.summary-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.summary-value span:first-child {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.unit {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Food Log Styles */
.food-log-section {
    margin-bottom: 25px;
}

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

.section-header h3 {
    margin: 0;
    color: var(--text-color);
}

.log-filters {
    display: flex;
    gap: 5px;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--bg-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.food-list {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    min-height: 120px;
}

.food-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.food-item-info {
    flex: 1;
}

.food-item-name {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 2px;
}

.food-item-details {
    font-size: 12px;
    color: var(--text-secondary);
}

.food-item-nutrition {
    text-align: right;
}

.food-item-calories {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.food-item-macros {
    font-size: 11px;
    color: var(--text-secondary);
}

.delete-food-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.delete-food-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .scanner-controls {
        flex-direction: column;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .nutrition-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .food-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .portion-input-group {
        flex-direction: column;
    }
    
    .nutrition-grid {
        grid-template-columns: 1fr;
    }
    
    .notification-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success animations */
.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background: #22c55e; }
    100% { transform: scale(1); }
}