/**
 * 냉파고 서비스 스타일시트
 * 초록색 테마의 모바일 퍼스트 반응형 디자인 (깔끔한 버전)
 */

/* 기본 리셋 및 변수 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #2ecc71;
    --primary-green-dark: #27ae60;
    --primary-green-light: #58d68d;
    --accent-yellow: #f1c40f;
    --background-bg: #fdfefe;
    --card-bg: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #ecf0f1;
    --error-color: #e74c3c;
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
    --naver-green: #03c75a;
    --youtube-red: #ff0000;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #f0f9f5 0%, #ffffff 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* 컨테이너 */
.container {
    max-width: 650px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(46, 204, 113, 0.1);
    overflow: hidden;
    position: relative;
}

/* 헤더 */
header {
    background: linear-gradient(120deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 10%, transparent 10.5%);
    background-size: 20px 20px;
    opacity: 0.3;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--accent-yellow);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 0;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

/* 메인 콘텐츠 */
main {
    padding: 30px 25px;
}

/* 입력 그룹 */
.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group label i {
    color: var(--primary-green);
}

.textarea-wrapper {
    position: relative;
}

.input-group textarea {
    width: 100%;
    padding: 18px;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    font-size: 1.05rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background-color: #fcfcfc;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
}

/* 버튼 */
.btn-primary {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(46, 204, 113, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #bdc3c7;
    box-shadow: none;
}

/* 검색 버튼 섹션 */
.search-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px dashed var(--border-color);
}

.search-section h3 {
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-search {
    flex: 1;
    min-width: 140px;
    padding: 14px 20px;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-naver {
    background-color: var(--naver-green);
}

.btn-youtube {
    background-color: var(--youtube-red);
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}

/* 로딩 스피너 */
.spinner-container {
    text-align: center;
    padding: 50px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #ecf0f1;
    border-top: 5px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-container p {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
}

/* 결과 영역 */
.result-area {
    margin-top: 30px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.recipe-result {
    background: #fff;
    border-radius: 20px;
    padding: 0;
    margin-top: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.recipe-result h2 {
    color: var(--white);
    background: linear-gradient(to right, var(--primary-green), var(--primary-green-light));
    font-size: 1.5rem;
    margin: 0;
    padding: 20px 25px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recipe-result h2::before {
    content: '\f0f5'; /* fa-utensils */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2rem;
    opacity: 0.8;
}

.recipe-steps {
    padding: 25px;
    background: #fdfefe;
}

.recipe-steps h3 {
    color: var(--primary-green-dark);
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recipe-steps h3::before {
    content: '\f0cb'; /* fa-list-ul */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.recipe-steps p {
    color: var(--text-dark);
    line-height: 1.9;
    white-space: pre-line;
    font-size: 1.05rem;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px dashed #dcdcdc;
}

/* 광고 섹션 */
.ad-section {
    padding: 25px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.ad-section h3 {
    color: var(--text-dark);
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ad-section h3::before {
    content: '\f291'; /* fa-shopping-basket */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-green);
}

/* 아이디어 상품 섹션 강조 스타일 */
.idea-product {
    background-color: #e8f5e9; /* 연한 초록색 배경 */
    position: relative;
    overflow: hidden;
    border: 1px solid #c8e6c9;
}

.idea-product::after {
    content: '\f0eb'; /* fa-lightbulb */
    font-family: 'Font Awesome 6 Free';
    font-weight: 400; /* Regular style */
    position: absolute;
    right: -20px;
    top: -20px;
    font-size: 8rem;
    color: var(--primary-green);
    opacity: 0.05;
    transform: rotate(15deg);
}

.idea-product h3::before {
    content: '\f0eb'; /* fa-lightbulb */
    color: var(--accent-yellow);
}

/* 밀키트 섹션 스타일 제거 (더 이상 사용 안 함) */

.coupang-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

@media (min-width: 600px) {
    .coupang-items {
        grid-template-columns: repeat(4, 1fr);
    }
}

.coupang-item {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    position: relative;
}

.coupang-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-green-light);
}

.coupang-img {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-bottom: 1px solid #f5f5f5;
}

.coupang-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.coupang-item:hover .coupang-img img {
    transform: scale(1.05);
}

.coupang-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.coupang-name {
    font-size: 0.8rem;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
    color: #444;
}

.coupang-price {
    font-weight: 800;
    color: #e74c3c;
    font-size: 0.95rem;
    text-align: right;
}

.coupang-notice {
    font-size: 0.7rem;
    color: #95a5a6;
    margin-top: 15px;
    text-align: right;
    font-style: italic;
}

/* 에러 메시지 */
.error {
    background: #fdedec;
    color: var(--error-color);
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid var(--error-color);
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-soft);
}

/* 푸터 */
footer {
    background: var(--card-bg);
    padding: 30px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 1px solid #f0f0f0;
}

/* 반응형 디자인 (태블릿 이상) */
@media (min-width: 768px) {
    body {
        padding: 40px 20px;
    }
    
    header {
        padding: 60px 20px;
    }
    
    header h1 {
        font-size: 3.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    main {
        padding: 50px 40px;
    }
    
    .recipe-result {
        padding: 0;
    }
}
