/* 칵테일 AI 레시피 생성기 스타일 */
:root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --secondary: #2c3e50;
    --accent: #f39c12;
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --bg-input: #0f3460;
    --text-light: #eee;
    --text-muted: #aaa;
    --success: #27ae60;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #0f0f23 100%);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
}

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

/* 헤더 */
header {
    text-align: center;
    padding: 40px 20px;
    background: var(--glass);
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

header h1 .icon {
    font-size: 2.8rem;
    margin-right: 10px;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* 탭 네비게이션 */
.tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 15px 30px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
}

.tab-btn .icon {
    font-size: 1.3rem;
}

/* 입력 패널 */
.input-panel {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 텍스트 입력 */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-muted);
}

.input-group textarea,
.input-group input[type="text"] {
    width: 100%;
    padding: 15px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s;
}

.input-group textarea:focus,
.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

.input-group textarea {
    min-height: 120px;
}

/* 재료 선택 칩 */
.ingredient-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.chip {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: var(--primary);
}

.chip.selected {
    background: var(--primary);
    border-color: var(--primary);
}

/* 파일 업로드 */
.upload-zone {
    border: 3px dashed var(--border);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--glass);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(231, 76, 60, 0.1);
}

.upload-zone .icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.upload-zone p {
    color: var(--text-muted);
    margin-bottom: 10px;
}

.upload-zone input[type="file"] {
    display: none;
}

.preview-container {
    margin-top: 20px;
    text-align: center;
}

.preview-container img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 12px;
    border: 2px solid var(--border);
}

/* 스캐너 영역 */
.scanner-container {
    position: relative;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
}

#scanner-video,
#qr-video {
    width: 100%;
    max-height: 400px;
    display: block;
}

.scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 150px;
    border: 3px solid var(--primary);
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.scanner-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--primary);
    animation: scan 2s infinite;
}

@keyframes scan {
    0%, 100% { top: 0; }
    50% { top: 100%; }
}

.scan-result {
    padding: 15px;
    background: var(--bg-input);
    border-radius: 12px;
    margin-top: 15px;
    font-family: monospace;
    word-break: break-all;
}

/* 버튼 */
.btn {
    padding: 15px 40px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-light);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
}

.btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

#print-recipe-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
}

#print-recipe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(155, 89, 182, 0.3);
}

/* 로딩 */
.loading {
    display: none;
    text-align: center;
    padding: 50px;
}

.loading.active {
    display: block;
}

.loading .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* 결과 영역 */
.result-panel {
    display: none;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border);
    animation: slideUp 0.5s ease;
}

.result-panel.active {
    display: block;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.recipe-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.recipe-header h2 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 5px;
}

.recipe-header .subtitle {
    color: var(--text-muted);
    font-style: italic;
}

.recipe-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass);
    border-radius: 20px;
    font-size: 0.9rem;
}

.meta-item .icon {
    color: var(--accent);
}

.recipe-description {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    padding: 20px;
    background: var(--glass);
    border-radius: 12px;
}

/* 재료 & 단계 그리드 */
.recipe-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .recipe-grid {
        grid-template-columns: 1fr;
    }
}

.recipe-section {
    background: var(--glass);
    border-radius: 16px;
    padding: 25px;
}

.recipe-section h3 {
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ingredients-list {
    list-style: none;
}

.ingredients-list li {
    padding: 12px 15px;
    background: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ingredients-list .amount {
    color: var(--accent);
    font-weight: 600;
}

.steps-list {
    list-style: none;
    counter-reset: step;
}

.steps-list li {
    padding: 15px 15px 15px 50px;
    background: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
}

.steps-list li::before {
    content: counter(step);
    counter-increment: step;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* 팁 영역 */
.recipe-tips {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(243, 156, 18, 0.1));
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    border-left: 4px solid var(--accent);
}

.recipe-tips h3 {
    color: var(--accent);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 대안 레시피 */
.alternatives {
    margin-top: 30px;
}

.alternatives h3 {
    color: var(--text-light);
    margin-bottom: 20px;
    text-align: center;
}

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

.alternative-card {
    background: var(--glass);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.alternative-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.alternative-card h4 {
    color: var(--accent);
    margin-bottom: 8px;
}

.alternative-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 푸드 페어링 섹션 */
.food-pairing-section {
    margin-top: 30px;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1), rgba(231, 76, 60, 0.05));
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

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

.pairing-header h3 {
    color: var(--accent);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.occasion-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent), #e67e22);
    border-radius: 20px;
    font-size: 0.9rem;
    color: white;
    font-weight: 500;
}

.pairing-principle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid var(--accent);
}

.principle-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pairing-principle p {
    margin: 0;
    color: var(--text-light);
    line-height: 1.6;
}

.pairing-foods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.pairing-food-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pairing-food-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
}

.pairing-food-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(243, 156, 18, 0.2);
    border-color: var(--accent);
}

.food-category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.food-card-header {
    margin-bottom: 12px;
    padding-right: 70px;
}

.food-name {
    color: var(--text-light);
    font-size: 1.2rem;
    margin: 0 0 4px 0;
}

.food-name-en {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.food-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.flavor-harmony {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: rgba(243, 156, 18, 0.1);
    border-radius: 10px;
    margin-bottom: 10px;
}

.harmony-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.flavor-harmony span:last-child {
    color: var(--accent);
    font-size: 0.9rem;
    line-height: 1.5;
}

.recipe-brief {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 10px;
}

.recipe-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.recipe-brief span:last-child {
    color: var(--success);
    font-size: 0.9rem;
    line-height: 1.5;
}

.avoid-foods {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.avoid-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.avoid-foods span:last-child {
    color: var(--text-light);
    font-size: 0.9rem;
}

.avoid-foods strong {
    color: var(--primary);
}

/* 히스토리 */
.history-panel {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    border: 1px solid var(--border);
}

.history-panel h3 {
    margin-bottom: 20px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--glass);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: var(--bg-input);
}

.history-item .type-badge {
    padding: 5px 12px;
    background: var(--primary);
    border-radius: 15px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.history-item .title {
    flex: 1;
    font-weight: 500;
}

.history-item .date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* 인식된 재료 */
.identified-ingredients {
    background: var(--glass);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.identified-ingredients h4 {
    color: var(--success);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.identified-list .tag {
    padding: 6px 14px;
    background: var(--success);
    border-radius: 15px;
    font-size: 0.9rem;
}

/* 푸터 */
footer {
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* 토스트 알림 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: var(--bg-card);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateX(150%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--primary);
}

/* 반응형 */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        justify-content: center;
    }
    
    .input-panel,
    .result-panel {
        padding: 20px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
    }
}
