/* 전역 변수 - 화이트 & 하늘색 파스텔 테마 */
:root {
    --primary-color: #7eb3d5;
    --primary-light: #a8d0e6;
    --primary-dark: #5a9bc4;
    --secondary-color: #8ec5e0;
    --accent-color: #d4e9f7;
    --danger-color: #ff9999;
    --warning-color: #fff59d;
    --success-color: #99d6a8;
    --bg-light: #f8fcff;
    --bg-white: #ffffff;
    --text-dark: #2c3e50;
    --text-gray: #6c7a89;
    --text-light: #b0bec5;
    --border-color: #e3f2fd;
    --shadow: 0 2px 8px rgba(126, 179, 213, 0.08);
    --shadow-hover: 0 8px 24px rgba(126, 179, 213, 0.15);
    --gradient-sky: linear-gradient(135deg, #a8d0e6 0%, #7eb3d5 100%);
}

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

/* number input 스피너 버튼 숨기기 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* 화이트 & 하늘색 파스텔 테마 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f8fcff 0%, #e8f4f8 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    color: var(--text-dark);
}

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

/* 헤더 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 24px 28px;
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

h1 { 
    color: var(--text-dark);
    font-size: 28px;
    font-weight: 700;
}

.header-title-mobile {
    display: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-gray);
    font-weight: 500;
}

.logout-btn {
    background: linear-gradient(to bottom, #ffb3b3 0%, #ff9999 50%, #ff7675 100%);
    padding: 10px 20px;
    border-radius: 8px;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 
        0 8px 15px rgba(255, 118, 117, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 3px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
    border-radius: 8px 8px 0 0;
}

.logout-btn:active {
    transform: translateY(2px);
    box-shadow: 
        0 4px 8px rgba(255, 118, 117, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 섹션 */
.section {
    background: var(--bg-white);
    padding: 32px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.section h2 {
    margin-bottom: 24px;
    background: var(--gradient-sky);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 24px;
    font-weight: 700;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 14px;
}

/* 폼 요소 */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    background: var(--bg-white);
    color: var(--text-dark);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

/* 버튼 - 3D 글래스 효과 */
button {
    background: linear-gradient(to bottom, #a8d0e6 0%, #7eb3d5 50%, #5a9bc4 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    margin-right: 10px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 
        0 8px 15px rgba(126, 179, 213, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 3px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
    border-radius: 12px 12px 0 0;
}

button:active {
    transform: translateY(2px);
    box-shadow: 
        0 4px 8px rgba(126, 179, 213, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

button.delete { 
    background: linear-gradient(to bottom, #ffb3b3 0%, #ff9999 50%, #ff7675 100%);
    box-shadow: 
        0 8px 15px rgba(255, 118, 117, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 3px rgba(0, 0, 0, 0.15);
}

button.delete:active {
    box-shadow: 
        0 4px 8px rgba(255, 118, 117, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

button.edit { 
    background: linear-gradient(to bottom, #b3d9f2 0%, #8ec5e0 50%, #6fb1d4 100%);
    box-shadow: 
        0 8px 15px rgba(142, 197, 224, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 3px rgba(0, 0, 0, 0.15);
}

button.edit:active {
    box-shadow: 
        0 4px 8px rgba(142, 197, 224, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 뒤로가기 버튼 */
.btn-back-to-list {
    padding: 8px 16px !important;
    background: linear-gradient(to bottom, #a8d0e6 0%, #7eb3d5 50%, #5a9bc4 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    box-shadow: 
        0 4px 8px rgba(126, 179, 213, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15) !important;
    white-space: nowrap !important;
    margin-right: 0 !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.2s !important;
}

.btn-back-to-list::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 50% !important;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)) !important;
    border-radius: 8px 8px 0 0 !important;
}

.btn-back-to-list:hover {
    transform: translateY(-1px) !important;
    box-shadow: 
        0 6px 12px rgba(126, 179, 213, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.btn-back-to-list:active {
    transform: translateY(1px) !important;
    box-shadow: 
        0 2px 4px rgba(126, 179, 213, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.15) !important;
}

/* 필터 버튼 */
.filter-btn {
    background: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 50%, #d0d0d0 100%);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -2px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    border-radius: 10px 10px 0 0;
}

.filter-btn.active {
    background: linear-gradient(to bottom, #5a9bc4 0%, #7eb3d5 50%, #a8d0e6 100%);
    box-shadow: 
        inset 0 3px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(0, 0, 0, 0.2);
    transform: translateY(2px);
}

.filter-btn.active span {
    color: white !important;
}

.filter-btn:active {
    transform: translateY(2px);
    box-shadow: 
        inset 0 3px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(0, 0, 0, 0.15);
}

/* 탭 콘텐츠 */
#fridgeTab, #inventoryTab, #myRecipesTab, #recipesTab, #alertsTab {
    min-height: 400px;
}

/* 탭 */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    background: var(--bg-white);
    padding: 14px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.tab {
    padding: 16px 24px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-gray);
    flex: 1;
    text-align: center;
    position: relative;
    transition: none;
    overflow: visible;
}

.tab.active { 
    background: var(--gradient-sky);
    color: white;
    box-shadow: 0 4px 12px rgba(126, 179, 213, 0.25);
    transition: none;
}

/* 레드닷 배지 */
.tab .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff7675;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 118, 117, 0.5);
    border: 2px solid white;
    animation: pulse 2s infinite;
    z-index: 100;
}

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

/* 아이템 그룹 */
.item-group {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 24px;
    background: var(--bg-white);
    margin-bottom: 20px;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.item-group:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.item-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.item-group-header h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 20px;
    font-weight: 700;
}

.item-group-total {
    background: var(--primary-color);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
}

/* 아이템 인스턴스 */
.item-instances {
    display: grid;
    gap: 12px;
}

.item-instance {
    background: #ffffff;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.item-instance:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.item-instance.expired {
    border: 4px solid #ff3b30;
    background: #fffafa;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.3);
}

.item-instance.urgent {
    border: 4px solid #ff9500;
    background: #fffef9;
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.3);
}

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

.item-quantity {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.item-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.item-details {
    margin-bottom: 12px;
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.8;
}

.item-detail-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.item-detail-label {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 100px;
}

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

.quantity-controls {
    display: flex;
    gap: 6px;
}

.quantity-btn {
    padding: 0;
    font-size: 16px;
    min-width: 30px;
    width: 30px;
    height: 30px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 카드 */
.item-card, .recipe-card {
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 18px;
    background: var(--bg-white);
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.recipe-card {
    max-width: 300px;
    width: 100%;
}

.item-card:hover, .recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

/* 냉장고 그리드 카드 스타일 */
.item-card.expired {
    border: 4px solid #ff3b30;
    background: #fffafa;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.3);
}

.item-card.urgent {
    border: 4px solid #ff9500;
    background: #fffef9;
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.3);
}

.item-card h3, .recipe-card h3 { 
    margin-bottom: 12px;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 700;
}

/* 카테고리 카드 */
.category-card {
    background: var(--bg-white);
    padding: 32px 24px;
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid var(--border-color);
    text-align: center;
    box-shadow: var(--shadow);
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

/* 모바일에서 카테고리 카드 컴팩트하게 */
@media (max-width: 768px) {
    .category-card {
        padding: 16px 12px;
        border-radius: 12px;
    }
    
    .category-card h3 {
        font-size: 14px !important;
    }
    
    .category-card p {
        font-size: 11px !important;
    }
    
    /* 레시피 추천 탭의 카테고리 그리드 */
    #categoryGrid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
        gap: 8px !important;
    }
    
    /* 내 요리 탭의 카테고리 그리드 */
    #myCategoryGrid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
        gap: 8px !important;
    }
    
    /* 레시피 카드 그리드 중앙 정렬 */
    .recipe-card {
        margin: 0 auto;
    }
    
    /* 레시피 필터 버튼 컴팩트하게 */
    #recipeStats .filter-btn,
    #statsCards .filter-btn {
        padding: 6px 8px !important;
        gap: 4px !important;
        flex-direction: column !important;
        min-width: 0 !important;
    }
    
    #recipeStats .filter-btn span,
    #statsCards .filter-btn span {
        font-size: 16px !important;
        line-height: 1 !important;
    }
    
    #recipeStats .filter-btn span:nth-child(2),
    #statsCards .filter-btn span:nth-child(2) {
        display: none !important;
    }
    
    #recipeStats .filter-btn span:nth-child(3),
    #statsCards .filter-btn span:nth-child(3) {
        display: none !important;
    }
    
    /* 내 요리 탭 액션 버튼 모바일에서 컴팩트하게 */
    .my-recipe-action-buttons {
        gap: 6px !important;
    }
    
    .my-recipe-action-buttons button {
        padding: 8px 10px !important;
        font-size: 18px !important;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .my-recipe-action-buttons button span {
        display: none;
    }
    
    #statsCards {
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    #statsCards > div {
        padding: 8px 10px !important;
        gap: 6px !important;
    }
    
    #statsCards .filter-btn {
        padding: 8px 10px !important;
        gap: 4px !important;
        min-width: 0 !important;
        flex: 1 !important;
    }
    
    #statsCards .filter-btn span:first-child {
        font-size: 16px !important;
    }
    
    #statsCards .filter-btn span:nth-child(2) {
        display: none !important;
    }
    
    #statsCards .filter-btn span:nth-child(3) {
        display: none !important;
    }
    
    /* 레시피 추천 탭도 동일하게 */
    #recipeStats > div {
        padding: 8px 10px !important;
        gap: 6px !important;
    }
    
    #recipeStats .filter-btn {
        padding: 8px 10px !important;
        gap: 4px !important;
        min-width: 0 !important;
        flex: 1 !important;
    }
    
    #recipeStats .filter-btn span:first-child {
        font-size: 16px !important;
    }
    
    #recipeStats .filter-btn span:nth-child(2) {
        font-size: 14px !important;
    }
    
    #recipeStats > div,
    #statsCards > div {
        padding: 8px 8px !important;
        gap: 6px !important;
    }
}

/* 알림 */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 4px solid;
}

.alert-expired { 
    background: #fff5f5;
    border-left-color: var(--danger-color);
}

.alert-urgent { 
    background: #fff9f5;
    border-left-color: #ff9500;
}

.alert-warning { 
    background: #fffef9;
    border-left-color: var(--warning-color);
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(255, 59, 48, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 59, 48, 0.5);
    }
}

/* 매칭 배지 */
.match-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.match-perfect {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6);
    }
}

.match-high { 
    background: var(--success-color);
    color: white; 
}

.match-medium { 
    background: #ffb74d;
    color: #333; 
    font-weight: 600;
}

.match-low { 
    background: var(--text-light);
    color: white; 
}

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

.modal-content {
    background: var(--bg-white);
    margin: 50px auto;
    padding: 30px;
    border-radius: 16px;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* 컴팩트 모달 스타일 */
.compact-modal {
    padding: 20px !important;
    max-width: 360px !important;
    margin: 30px auto !important;
}

.compact-modal .modal-header {
    margin-bottom: 16px !important;
}

.compact-modal .form-group {
    margin-bottom: 12px !important;
}

.compact-modal label {
    font-size: 13px !important;
    margin-bottom: 6px !important;
    display: block;
}

.compact-modal input,
.compact-modal select {
    padding: 8px 12px !important;
    font-size: 14px !important;
}

.compact-modal button {
    padding: 10px 16px !important;
    font-size: 14px !important;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        padding: 24px;
        max-width: calc(100% - 40px);
        max-height: 90vh;
    }
    
    .compact-modal {
        margin: 15px !important;
        padding: 20px !important;
        max-width: calc(100% - 30px) !important;
        max-height: 90vh !important;
    }
    
    .compact-modal .modal-header h2 {
        font-size: 16px !important;
    }
    
    .compact-modal label {
        font-size: 12px !important;
    }
    
    .compact-modal input,
    .compact-modal select {
        padding: 8px 10px !important;
        font-size: 13px !important;
    }
    
    .compact-modal button {
        padding: 9px 12px !important;
        font-size: 13px !important;
    }
}

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

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.close:hover { 
    color: var(--text-dark);
}

.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.confirm-content {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 16px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.confirm-content h3 {
    margin-bottom: 15px;
    color: var(--text-dark);
    font-weight: 700;
}

.confirm-content p {
    margin-bottom: 20px;
    color: var(--text-gray);
    line-height: 1.6;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.warning-text {
    color: var(--danger-color);
    font-weight: 700;
}

/* 맨 위로 버튼 */
#scrollToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: linear-gradient(to bottom, #7eb3d5 0%, #5a9bc4 50%, #4a8bb4 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 15px rgba(126, 179, 213, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 3px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    z-index: 999;
    overflow: hidden;
}

#scrollToTop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
    border-radius: 50% 50% 0 0;
}

#scrollToTop:active {
    transform: translateY(2px);
    box-shadow: 
        0 4px 8px rgba(126, 179, 213, 0.3),
        inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

#scrollToTop.show {
    display: flex;
}

/* 모바일에서 맨 위로 버튼 위치 조정 */
@media (max-width: 768px) {
    #scrollToTop {
        bottom: 90px; /* 하단 네비게이션 위로 */
        right: 15px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* 레시피 그리드 */
.recipe-grid {
    display: grid;
    gap: 16px;
}

.recipe-category {
    margin-bottom: 30px;
}

.category-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
}

/* 통계 카드 */
.stats-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

/* 반응형 */
@media (max-width: 768px) {
    body {
        padding: 10px 10px 80px 10px; /* 하단 네비게이션 공간 확보 */
    }
    
    /* 기존 탭 숨기기 */
    .tabs {
        display: none;
    }
    
    /* 헤더 컴팩트하게 */
    .header {
        padding: 12px 16px;
        margin-bottom: 15px;
    }
    
    .header h1 {
        display: none; /* 타이틀 숨기기 */
    }
    
    .user-info {
        flex: 1; /* 전체 너비 사용 */
        justify-content: space-between;
    }
    
    .user-info span {
        display: inline; /* 사용자 이름 표시 */
        font-size: 16px;
        font-weight: 700;
        color: var(--text-dark);
    }
    
    .logout-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* 설정 버튼 모바일 스타일 */
    .user-info > div {
        gap: 6px !important;
    }
    
    .user-info > div button:last-of-type {
        padding: 6px 10px !important;
        font-size: 16px !important;
        margin: 0 !important;
    }
    
    /* 모바일 하단 네비게이션 */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 8px 0;
    }
    
    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 4px;
        cursor: pointer;
        position: relative;
        border: none;
        background: none;
        color: var(--text-gray);
        transition: all 0.2s;
    }
    
    .mobile-nav-item.active {
        color: var(--primary-color);
        background: linear-gradient(to bottom, rgba(126, 179, 213, 0.1), rgba(126, 179, 213, 0.05));
        border-radius: 12px;
    }
    
    .mobile-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 3px;
        background: var(--primary-color);
        border-radius: 0 0 3px 3px;
    }
    
    .mobile-nav-icon {
        font-size: 24px;
        margin-bottom: 4px;
        transition: transform 0.2s;
    }
    
    .mobile-nav-item.active .mobile-nav-icon {
        transform: scale(1.1);
    }
    
    .mobile-nav-label {
        font-size: 10px;
        font-weight: 600;
    }
    
    .mobile-nav-item.active .mobile-nav-label {
        font-weight: 700;
    }
    
    .mobile-nav-item .badge {
        position: absolute;
        top: 4px;
        right: 8px;
        background: #ff7675;
        color: white;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: 700;
        box-shadow: 0 2px 8px rgba(255, 118, 117, 0.5);
        border: 2px solid white;
        z-index: 10;
        z-index: 10;
    }
    
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* 쇼핑 2분할 -> 모바일에서는 1열 */
    #shoppingTab .section > div {
        grid-template-columns: 1fr !important;
    }
}

/* 데스크톱에서는 모바일 네비게이션 숨기기 */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none;
    }
}

/* Choices.js 커스터마이징 */
.choices {
    margin-bottom: 0 !important;
}

.choices__inner {
    background: var(--bg-white) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 20px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    min-height: auto !important;
    transition: all 0.3s !important;
}

.choices__inner:hover {
    border-color: var(--primary-light) !important;
}

.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(126, 179, 213, 0.1) !important;
}

.choices__list--dropdown {
    border: 2px solid var(--primary-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    z-index: 100 !important;
}

.choices__list--dropdown .choices__item--selectable {
    padding: 10px 16px !important;
    font-size: 13px !important;
    transition: background-color 0.2s !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--primary-light) !important;
    color: white !important;
}

.choices[data-type*="select-one"] .choices__inner {
    padding-bottom: 12px !important;
}

.choices__list--single {
    padding: 0 !important;
}

/* 유튜브 레시피 검색 섹션 */
.youtube-search-container {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    border-radius: 12px;
    border: 2px solid #d4e9f7;
    box-shadow: 0 2px 8px rgba(126, 179, 213, 0.1);
}

.youtube-search-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.youtube-icon {
    width: 36px;
    height: 36px;
    background: #FF0000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
}

.youtube-search-title {
    flex: 1;
}

.youtube-search-title h3 {
    color: #5a9bc4;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.youtube-search-title p {
    color: #6c7a89;
    font-size: 11px;
    margin: 0;
}

.youtube-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.youtube-search-row:last-child {
    margin-bottom: 0;
}

/* 데스크톱에서는 긴 설명 표시 */
.youtube-desc-mobile {
    display: none;
}

.youtube-desc-mobile-row {
    display: none;
}

.youtube-search-btn-mobile {
    display: none;
}

.youtube-mobile-only {
    display: none;
}

.youtube-desktop-only {
    display: flex;
}

/* 모바일에서는 세로 배치 */
@media (max-width: 768px) {
    .youtube-search-container {
        padding: 12px !important;
        margin-bottom: 15px !important;
    }
    
    .youtube-search-header {
        margin-bottom: 10px !important;
    }
    
    .youtube-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
    }
    
    .youtube-search-title h3 {
        font-size: 13px !important;
        margin-bottom: 4px !important;
    }
    
    .youtube-desc-desktop {
        display: none !important;
    }
    
    .youtube-desc-mobile-row {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    
    .youtube-desc-mobile {
        display: block !important;
        margin: 0 !important;
        flex: 1;
    }
    
    .youtube-search-btn-mobile {
        display: block !important;
        padding: 6px 12px !important;
        background: #FF0000;
        color: white;
        font-weight: 600;
        border: none;
        border-radius: 6px;
        font-size: 11px !important;
        cursor: pointer;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .youtube-add-btn-mobile {
        padding: 6px 12px !important;
        font-size: 11px !important;
        white-space: nowrap;
        flex-shrink: 0;
        flex: 0 0 auto !important;
        width: auto !important;
    }
    
    .youtube-desktop-only {
        display: none !important;
    }
    
    .youtube-mobile-only {
        display: block !important;
        margin-bottom: 6px;
    }
    
    .youtube-mobile-only:last-child {
        margin-bottom: 0;
    }
    
    .youtube-mobile-row {
        display: flex !important;
        gap: 8px;
    }
    
    .youtube-mobile-only input,
    .youtube-mobile-only select,
    .youtube-mobile-only button {
        width: 100%;
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
    
    .youtube-mobile-row select,
    .youtube-mobile-row button {
        padding: 8px 10px !important;
        font-size: 11px !important;
    }
}

.youtube-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #d4e9f7;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    outline: none;
    font-weight: 500;
    color: #2c3e50;
}

.youtube-search-input:focus {
    border-color: #7eb3d5;
    box-shadow: 0 0 0 3px rgba(126, 179, 213, 0.1);
}

.youtube-search-btn {
    padding: 10px 18px;
    background: #FF0000;
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.youtube-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.add-recipe-btn {
    background: #66bb6a;
}

.add-recipe-btn:hover {
    background: #5aae5e;
}

/* 카테고리 셀렉트 박스 */
#recipeCategorySelect {
    padding: 10px 14px;
    border: 2px solid #7eb3d5;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    color: #2c3e50;
    font-weight: 600;
    cursor: pointer;
    min-width: 150px !important;
    width: 150px !important;
    flex-shrink: 0;
}

/* Choices.js가 적용된 recipeCategorySelect */
#recipeCategorySelect + .choices,
.youtube-search-row .choices {
    min-width: 150px !important;
    width: 150px !important;
    max-width: 150px !important;
}

#recipeCategorySelect + .choices .choices__inner,
.youtube-search-row .choices .choices__inner {
    min-width: 150px !important;
    width: 150px !important;
}

/* 모바일에서는 자동 너비 */
@media (max-width: 768px) {
    #recipeCategorySelect {
        min-width: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    #recipeCategorySelect + .choices,
    .youtube-search-row .choices {
        min-width: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    #recipeCategorySelect + .choices .choices__inner,
    .youtube-search-row .choices .choices__inner {
        min-width: auto !important;
        width: 100% !important;
    }
}

#recipeCategorySelect:focus {
    border-color: #5a9bc4;
    box-shadow: 0 0 0 3px rgba(126, 179, 213, 0.15);
}

/* 안내 문구 */
.recipe-notice {
    margin-bottom: 15px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #7eb3d5;
}

.recipe-notice p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

/* 버튼 스타일 확장 */
.btn-back {
    padding: 10px 20px;
    background: var(--gradient-sky);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(126, 179, 213, 0.2);
    white-space: nowrap;
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-youtube {
    background: #FF0000;
    padding: 12px 20px;
    white-space: nowrap;
}

.btn-youtube:hover {
    background: #cc0000;
}

.btn-complete {
    padding: 6px 16px;
    font-size: 11px;
    background: #66bb6a;
    color: white;
}

.btn-complete:hover {
    background: #5aae5e;
}

.btn-cancel {
    background: #999;
}

.btn-cancel:hover {
    background: #777;
}

/* 통계 카드 */
.stats-card-high {
    background: #66bb6a;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stats-card-medium {
    background: #74b9ff;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stats-card-low {
    background: #8e8e93;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stats-number {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stats-label {
    font-size: 14px;
    opacity: 0.9;
}

.stats-sublabel {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

/* 재료 태그 */
.ingredient-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    margin: 3px;
    font-size: 13px;
    font-weight: 600;
}

.ingredient-available {
    background: #66bb6a;
    color: white;
}

.ingredient-missing {
    background: #ff3b30;
    color: white;
}

/* 검색 입력 */
.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(126, 179, 213, 0.1);
}

/* 안내 박스 */
.info-box {
    padding: 15px;
    background: #fff9e6;
    border-radius: 10px;
    border: 2px solid #ffe066;
    margin-bottom: 20px;
}

.info-box-blue {
    background: #f8fcff;
    border: 1px solid #d4e9f7;
    padding: 12px 16px;
    border-radius: 10px;
}

.info-text {
    color: #8b7500;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 500;
}

/* 레시피 상세 */
.recipe-detail-section {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 10px;
}

.recipe-detail-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
}

.recipe-detail-content {
    white-space: pre-line;
    line-height: 1.8;
    color: var(--text-dark);
}

/* 카테고리 관리 */
.category-item {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-btn-edit {
    background: #74b9ff;
    padding: 2px 8px;
    font-size: 12px;
    margin: 0;
}

.category-btn-delete {
    background: #ff4757;
    padding: 2px 8px;
    font-size: 12px;
    margin: 0;
}

/* 재료 입력 행 */
.ingredient-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 2px solid #e8f4f8;
}

.ingredient-name {
    color: #2c3e50;
    font-weight: 600;
    font-size: 16px;
}

.ingredient-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 조미료 섹션 */
.seasoning-section {
    margin-top: 15px;
    padding: 15px;
    background: #f8fcff;
    border-radius: 8px;
    border: 1px solid #d4e9f7;
}

.seasoning-title {
    font-weight: 600;
    color: #5a9bc4;
    margin-bottom: 10px;
    font-size: 14px;
}

.seasoning-list {
    color: #6c7a89;
    font-size: 14px;
    line-height: 1.6;
}

/* 헤더 행 (검색어 + 버튼) */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-term {
    color: #6b7c99;
    font-weight: 600;
    font-size: 14px;
}

/* 유틸리티 클래스 */
.text-center {
    text-align: center;
}

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

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

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

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-gap-10 {
    gap: 10px;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* Version: v=20260304035 - Added filter button styles for my-recipes tab */

/* 냉장고 탭 모바일 최적화 */
@media (max-width: 768px) {
    /* 품목 추가 버튼 전체 너비 */
    .fridge-add-btn-container {
        text-align: center !important;
    }
    
    .fridge-add-btn {
        width: 100% !important;
        padding: 14px 24px !important;
        font-size: 15px !important;
    }
    
    /* 정렬 셀렉트박스 숨기기 */
    .fridge-sort-item {
        display: none !important;
    }
    
    /* 필터 2개만 가로 배치 */
    .fridge-filters {
        gap: 8px !important;
    }
    
    .fridge-filter-item {
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .fridge-filters select {
        font-size: 13px !important;
        padding: 10px 8px !important;
    }
}
