/* usda-search.css - USDA Search Page Styles */

/* ============================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================ */

:root {
  /* Use same color variables as search-recipe-view.css */
  --usda-color-primary: var(--color-primary, #283655);
  --usda-color-primary-dark: var(--color-primary-dark, #1e2a43);
  --usda-color-primary-light: var(--color-primary-light, #3a4d6e);
  --usda-color-secondary: var(--color-secondary, #DFA774);
  --usda-color-text-primary: var(--color-text-primary, #333);
  --usda-color-text-secondary: var(--color-text-secondary, #666);
  --usda-color-background: var(--color-background, #ffffff);
  --usda-color-background-alt: var(--color-background-alt, #f8f9fa);
  --usda-color-border: var(--color-border, #e1e5e9);
  --usda-spacing-md: var(--spacing-md, 16px);
  --usda-spacing-lg: var(--spacing-lg, 24px);
  --usda-spacing-xl: var(--spacing-xl, 32px);
  --usda-radius-md: var(--radius-md, 8px);
  --usda-radius-lg: var(--radius-lg, 12px);
  --usda-shadow-md: var(--shadow-md, 0 4px 8px rgba(0, 0, 0, 0.1));
  --usda-shadow-lg: var(--shadow-lg, 0 8px 16px rgba(0, 0, 0, 0.15));
}

/* ============================================
   USDA SEARCH CONTAINER
   ============================================ */

#usda-search {
    min-height: calc(100vh - 140px);
    background: #0056b3;
    padding: var(--usda-spacing-lg) 0;
}

.usda-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   USDA HEADER
   ============================================ */

.usda-search-header,
.usda-header {
    background: #0056b3;
    color: #0056b3;
    padding: 12px 20px;
    border-radius: var(--usda-radius-lg);
    margin-bottom: var(--usda-spacing-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: none;
    max-height: 100px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.usda-search-header::before,
.usda-header::before {
    display: none;
}

.usda-search-header h1,
.usda-header h1 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 2;
    color: #000000;
    text-shadow: none;
    white-space: nowrap;
}

.usda-title-main {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
}

.usda-title-sub {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
}

.usda-search-header h1 i,
.usda-header h1 i {
    margin-right: 15px;
    animation: pulse 2s ease-in-out infinite;
}

.usda-search-header p,
.usda-header p {
    display: none;
}

.header-content {
    position: relative;
    z-index: 2;
}

.header-content--inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.header-stats-left,
.header-stats-right {
    display: flex;
    gap: 8px;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.usda-search-header .stat-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: #DFA774 !important;
    padding: 0 !important;
    border-radius: 6px !important;
    width: 80px !important;
    height: 60px !important;
    min-width: 80px !important;
    text-align: center;
    box-sizing: border-box;
}

.usda-search-header .stat-number {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #283655 !important;
    line-height: 1;
    display: block;
    text-align: center;
}

.usda-search-header .stat-label {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #283655 !important;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    font-weight: 600;
    line-height: 1;
    margin-top: 3px;
    display: block;
    text-align: center;
}

.usda-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 15px;
}

/* ============================================
   SEARCH SECTION
   ============================================ */

.usda-search-view .search-section,
.usda-search-view .usda-search-section {
    background: #DFA774 !important;
    border-radius: var(--usda-radius-lg, 12px) !important;
    padding: 13px !important;
    margin-top: 20px !important;
    margin-bottom: var(--usda-spacing-lg, 24px) !important;
    box-shadow: var(--usda-shadow-md, 0 4px 8px rgba(0, 0, 0, 0.1)) !important;
    border: none !important;
    position: relative;
    z-index: 1;
    max-width: 700px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.usda-search-view .search-form {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    position: relative;
    z-index: 1;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.search-input-group {
    width: 100%;
    position: relative;
    z-index: 1;
}

.search-input-container {
    display: flex;
    gap: var(--usda-spacing-md, 16px);
    align-items: stretch;
    width: 100%;
    position: relative;
    z-index: 1;
}

.search-input-container * {
    position: relative;
    z-index: 1;
}

/* ============================================
   USDA SEARCH FORM - Matching Search Recipe Style
   ============================================ */

.usda-search-view .usda-search-input-group {
    display: flex !important;
    gap: 8px !important;
    background: white !important;
    border-radius: 12px !important;
    padding: 13px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
    width: 100% !important;
    height: 48px !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.usda-search-input {
    flex: 1;
    margin: 0;
    padding: 0 12px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 1rem;
    background: white !important;
    color: #333;
    transition: all 0.2s ease;
    outline: none;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.usda-search-input:hover {
    overflow: visible;
}

.usda-search-input::placeholder {
    color: #6b7280;
    opacity: 1;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usda-search-input:hover::placeholder {
    overflow: visible;
    text-overflow: unset;
}

.usda-search-input:focus {
    border-color: #283655;
    box-shadow: 0 0 0 3px rgba(40, 54, 85, 0.1);
}

.usda-clear-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.usda-clear-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.usda-search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: #283655;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.usda-search-btn:hover:not(:disabled) {
    background: #1e2a43;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 54, 85, 0.25);
}

.usda-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.usda-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #283655;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.usda-filter-btn:focus,
.usda-filter-btn:focus-visible {
    outline: none;
    box-shadow: none;
}

.usda-filter-btn:hover {
    background: #1e2a43;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 54, 85, 0.25);
}

.usda-search-view .usda-search-form {
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.usda-search-form .advanced-filters-toggle,
.usda-search-form .search-actions {
    display: none;
}

.main-search {
    display: flex;
    gap: var(--usda-spacing-md);
    align-items: center;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 18px 24px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #ffffff !important;
    color: #333333 !important;
    position: relative;
    z-index: 1;
}

.search-input::placeholder {
    color: #999999 !important;
    opacity: 0.7;
}

.search-input:focus {
    outline: none;
    border-color: #283655;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(40, 54, 85, 0.1);
    color: #333333 !important;
    z-index: 2;
}

.search-input * {
    color: #333333 !important;
}

.search-btn,
.search-button {
    padding: 18px 32px;
    background: #283655 !important;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.search-btn *,
.search-button * {
    color: #ffffff !important;
}

.search-btn i,
.search-button i {
    color: #ffffff !important;
}

.search-btn span,
.search-button span {
    color: #ffffff !important;
    font-weight: 600;
    margin-left: 4px;
}

.search-btn:hover:not(:disabled),
.search-button:hover:not(:disabled) {
    background: #1e2a43 !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    color: #ffffff !important;
    z-index: 2;
}

.search-btn:hover:not(:disabled) *,
.search-button:hover:not(:disabled) * {
    color: #ffffff !important;
}

.search-btn:hover:not(:disabled) span,
.search-button:hover:not(:disabled) span {
    color: #ffffff !important;
}

.search-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.advanced-filters-toggle {
    display: flex;
    justify-content: center;
    margin-top: var(--usda-spacing-md);
}

.advanced-filters-toggle .btn {
    z-index: 10;
    position: relative;
}

.search-actions {
    display: flex;
    justify-content: center;
    gap: var(--usda-spacing-md);
    margin-top: var(--usda-spacing-md);
}

.search-actions .btn {
    z-index: 10;
    position: relative;
}

/* ============================================
   FOOD TYPE FILTERS
   ============================================ */

.food-type-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.food-type-btn {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.food-type-btn:hover {
    border-color: #283655;
    background: #ebeef3;
    color: #283655;
}

.food-type-btn.active {
    background: #283655;
    border-color: #283655;
    color: white;
    box-shadow: 0 2px 8px rgba(40, 54, 85, 0.3);
}

.food-type-btn i {
    font-size: 0.9rem;
}

/* ============================================
   ADVANCED FILTERS
   ============================================ */

.usda-search-view .advanced-filters {
    background: #DFA774;
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    border: none;
    width: 100%;
    box-sizing: border-box;
}

.usda-search-view .filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.usda-search-view .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #FFFFFF;
    border-radius: 8px;
    padding: 8px;
}

.usda-search-view .filter-group label,
.usda-search-view .filter-label {
    font-weight: 600;
    color: #283655;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.usda-search-view .filter-input,
.usda-search-view .filter-select {
    width: 100%;
    padding: 8px 12px;
    height: 38px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: #FFFFFF;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.usda-search-view .filter-input:focus,
.usda-search-view .filter-select:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15);
}

/* ============================================
   SEARCH RESULTS
   ============================================ */

.results-section,
.search-results {
    margin-top: 30px;
    background: #0056b3;
    border: none;
    border-radius: 12px;
    padding: 20px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 5px;
}

.results-count {
    color: #666;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-count i {
    color: #283655;
    font-size: 1rem;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
}

.view-mode-toggle {
    display: flex;
    gap: 3px;
    background: #f8f9fa;
    padding: 3px;
    border-radius: 8px;
}

.view-mode-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.view-mode-btn.active {
    background: white;
    color: #283655;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   FOOD ITEMS GRID
   ============================================ */

.food-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.food-items-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.food-item {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.food-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #283655;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.food-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #283655;
}

.food-item:hover::before {
    transform: scaleY(1);
}

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

.food-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #283655 0%, #1e2a43 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.food-info {
    flex: 1;
}

.food-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #283655;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.food-brand {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.food-category {
    display: inline-block;
    background: #ebeef3;
    color: #283655;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.food-nutrition {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.nutrition-stat {
    text-align: center;
    padding: 10px 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.nutrition-value {
    font-weight: 600;
    font-size: 0.95rem;
    color: #283655;
    display: block;
}

.nutrition-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.food-actions {
    display: flex;
    gap: 10px;
}

.food-action-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-details {
    background: #283655;
    color: white;
}

.btn-details:hover {
    background: #1e2a43;
    transform: translateY(-1px);
}

.btn-add {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
}

.btn-add:hover {
    background: #e9ecef;
    color: #283655;
}

/* ============================================
   FOOD DETAILS MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-index-modal, 500);
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    background: linear-gradient(135deg, #283655 0%, #1e2a43 100%);
    color: white;
    padding: 30px;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

.modal-food-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.modal-food-brand {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

.modal-body {
    padding: 30px;
}

.nutrition-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.nutrition-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #283655;
}

.nutrition-section h4 {
    color: #283655;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.nutrition-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nutrition-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.nutrition-row:last-child {
    border-bottom: none;
}

.nutrient-name {
    color: #666;
    font-size: 0.9rem;
}

.nutrient-value {
    font-weight: 600;
    color: #283655;
    font-size: 0.9rem;
}

.food-meta-info {
    background: #ebeef3;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #8a9bb5;
}

.food-meta-info h4 {
    color: #283655;
    margin-bottom: 15px;
}

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

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.meta-value {
    color: #283655;
    font-weight: 500;
}

/* ============================================
   LOADING STATES
   ============================================ */

.results-loading,
.search-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.results-loading i,
.search-loading i {
    font-size: 3rem;
    color: #283655;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

.results-error {
    text-align: center;
    padding: 60px 20px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #856404;
}

.results-error i {
    font-size: 3rem;
    color: #ff9800;
    margin-bottom: 20px;
}

.results-error h3 {
    color: #856404;
    margin-bottom: 10px;
}

.results-error p {
    color: #856404;
    margin-bottom: 20px;
}

.results-empty,
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.results-empty--compact {
    padding: 6px 16px;
    display: block;
    background: #0056b3;
    border-radius: 6px;
    box-shadow: none;
    max-height: none;
    color: #000000;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    max-width: 700px;
    margin: 20px auto;
    width: fit-content;
}

.results-empty i,
.no-results i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.results-empty h3,
.no-results h3 {
    color: #666;
    margin-bottom: 0;
}

.results-empty--compact h3 {
    margin: 0;
    font-size: 0.85rem;
    color: #FFFFFF;
    font-weight: 600;
}

.results-empty p,
.no-results p {
    color: #999;
    margin-bottom: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.food-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid #0056b3;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.food-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #283655;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.food-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #003d80;
}

.food-card:hover::before {
    transform: scaleY(1);
}

.food-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 15px;
}

.food-card-title-section {
    flex: 1;
}

.food-card-badges {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.food-card-content {
    margin-bottom: 15px;
}

.food-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.food-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #283655;
    margin-bottom: 5px;
    line-height: 1.3;
}

.food-brand {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.food-fdc-id,
.food-data-type {
    display: inline-block;
    background: #ebeef3;
    color: #283655;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.usda-search-view .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
    background: #DFA774 !important;
    border-radius: 12px;
}

.pagination-btn {
    padding: 10px 20px;
    background: #283655;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover:not(:disabled) {
    background: #1e2a43;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 54, 85, 0.3);
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    color: #283655;
    font-size: 1.2rem;
    font-weight: 600;
}

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

.nutrition-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #283655;
}

.modal-overlay .modal-footer,
.modal-content .modal-footer,
.modal-footer {
    padding: 25px 30px !important;
    border-top: 1px solid #e9ecef !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 20px !important;
    background: #f8f9fa !important;
    border-radius: 0 0 20px 20px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.modal-overlay .modal-footer .btn,
.modal-content .modal-footer .btn,
.modal-footer .btn {
    min-width: 140px !important;
    padding: 14px 28px !important;
    font-size: 1rem !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* USDA Search Modal Footer Button - Maximum Specificity */
#usda-search .modal-overlay .modal-content .modal-footer .btn.btn-primary,
.modal-overlay[role="dialog"] .modal-content .modal-footer .btn.btn-primary,
#usda-search .modal-footer .btn.btn-primary,
.modal-overlay .modal-content .modal-footer .btn.btn-primary,
.modal-footer .btn.btn-primary[data-add-favorite],
.modal-overlay .modal-footer .btn-primary,
.modal-content .modal-footer .btn-primary,
.modal-footer .btn-primary {
    min-width: 380px !important;
    max-width: 100% !important;
    width: auto !important;
    padding: 18px 50px !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    background-color: #283655 !important;
    color: #ffffff !important;
    border: 2px solid #283655 !important;
}

.modal-overlay .modal-footer .btn-primary:hover,
.modal-content .modal-footer .btn-primary:hover,
.modal-footer .btn-primary:hover {
    background-color: #1e2a43 !important;
    border-color: #1e2a43 !important;
    color: #ffffff !important;
}

.modal-overlay .modal-footer .btn-primary i,
.modal-content .modal-footer .btn-primary i,
.modal-footer .btn-primary i {
    margin-right: 10px !important;
    flex-shrink: 0 !important;
    font-size: 1.1rem !important;
    color: #ffffff !important;
}

.modal-overlay .modal-footer .btn-primary span,
.modal-content .modal-footer .btn-primary span,
.modal-footer .btn-primary span {
    color: #ffffff !important;
    font-weight: 600 !important;
}

#usda-search .modal-overlay .modal-content .modal-footer .btn.btn-outline,
.modal-overlay[role="dialog"] .modal-content .modal-footer .btn.btn-outline,
#usda-search .modal-footer .btn.btn-outline,
.modal-overlay .modal-content .modal-footer .btn.btn-outline,
.modal-overlay .modal-footer .btn-outline,
.modal-content .modal-footer .btn-outline,
.modal-footer .btn-outline {
    min-width: 160px !important;
    padding: 14px 28px !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .usda-search-container {
        padding: 0 15px;
    }
    
    .usda-search-header,
    .usda-header {
        padding: 30px 20px;
        margin-bottom: 20px;
    }
    
    .usda-search-header h1,
    .usda-header h1 {
        font-size: 2rem;
    }
    
    .usda-search-view .search-section,
    .usda-search-view .usda-search-section {
        padding: 13px !important;
    }
    
    .main-search {
        flex-direction: column;
        align-items: stretch;
    }
    
    .food-type-filters {
        justify-content: center;
    }
    
    .filters-content {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .food-items-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .food-nutrition {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nutrition-details {
        grid-template-columns: 1fr;
    }
    
    .meta-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10px;
        border-radius: 15px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-food-name {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .usda-search-header h1,
    .usda-header h1 {
        font-size: 1.75rem;
    }
    
    .food-item {
        padding: 20px;
    }
    
    .food-header {
        flex-direction: column;
        text-align: center;
    }
    
    .food-nutrition {
        grid-template-columns: 1fr;
    }
    
    .food-actions {
        flex-direction: column;
    }
    
    .food-type-filters {
        flex-direction: column;
    }
    
    .food-type-btn {
        justify-content: center;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* ============================================
   GUEST LOGIN NOTICE
   ============================================ */

.guest-login-notice {
    background: linear-gradient(135deg, #ebeef3 0%, #d6dce6 100%);
    border: 2px solid #283655;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin: 40px auto;
    max-width: 600px;
    box-shadow: 0 8px 25px rgba(40, 54, 85, 0.15);
}

.guest-login-notice h3 {
    color: #283655;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.guest-login-notice p {
    color: #283655;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.guest-login-notice a {
    color: #283655;
    text-decoration: none;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.guest-login-notice a:hover {
    background: rgba(40, 54, 85, 0.1);
    text-decoration: underline;
}