/* リセット & 基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    min-height: 100vh;
}

/* コンテナ */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー */
.header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.logo:hover {
    opacity: 0.8;
}

nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #666;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
}

#adminLink {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #2d3436 !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

#adminLink:hover {
    background: linear-gradient(135deg, #ffed4e 0%, #ffc947 100%);
    color: #2d3436 !important;
    transform: translateY(-1px);
}

.logo-icon {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

.logo-text {
    font-size: 1.5rem;
    color: #ff6b35;
    font-weight: 700;
    pointer-events: none;
}

.logo-icon {
    pointer-events: none;
}

/* メインコンテンツ */
.main {
    padding: 2rem 0;
}

/* セクションタイトル */
.section-title {
    text-align: center;
    font-size: 1.8rem;
    color: #2d3436;
    margin-bottom: 2rem;
}

/* フォーム */
.recipe-form-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 0.5rem;
}

.form-help {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 50px;
}

.form-select:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-select:required:invalid {
    border-color: #ef4444;
}

/* 画像アップロード */
.image-upload {
    position: relative;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.image-upload:hover {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.05);
}

.image-input {
    display: none;
}

.add-image-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    width: 100%;
    font-size: inherit;
    font-family: inherit;
    gap: 10px;
    color: #666;
}

.add-image-btn:hover {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.05);
}

.upload-icon {
    font-size: 2rem;
}

.image-preview {
    margin-bottom: 1rem;
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.image-preview:not(:empty) {
    display: grid;
}

.preview-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.preview-number {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 107, 53, 0.9);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.preview-remove {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.preview-remove:hover {
    background: rgba(255, 59, 48, 1);
    transform: scale(1.1);
}

/* 生成ボタン */
.generate-button {
    width: 100%;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.generate-button:active {
    transform: translateY(0);
}

.button-icon {
    font-size: 1.4rem;
    animation: bounce 2s infinite;
}

.button-sparkle {
    font-size: 1.2rem;
    animation: sparkle 1.5s infinite;
}

/* 結果表示 */
.result-section {
    animation: fadeIn 0.5s ease;
}

.result-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.result-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    color: #2d3436;
    margin-bottom: 1.5rem;
}

.result-icon {
    font-size: 1.8rem;
}

.recipe-content {
    line-height: 1.8;
    color: #555;
}

.recipe-content h4 {
    color: #ff6b35;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #fff8f3 0%, #ffe8e0 100%);
    border-left: 5px solid #ff6b35;
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.1);
    position: relative;
    overflow: hidden;
}

.recipe-content h4:before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(45deg, transparent 50%, rgba(255, 107, 53, 0.05) 50%);
}

/* セクション別の装飾 */
.recipe-content h4.section-dish {
    background: linear-gradient(135deg, #fff9e6 0%, #ffecb3 100%);
    border-left-color: #ffc107;
}

.recipe-content h4.section-ingredients {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    border-left-color: #9c27b0;
}

.recipe-content h4.section-steps {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c8 100%);
    border-left-color: #4caf50;
}

.recipe-content h4.section-tips {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left-color: #2196f3;
}

/* ホバー効果 */
.recipe-content h4:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
    transition: all 0.3s ease;
}

.recipe-content ul,
.recipe-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.recipe-content li {
    margin-bottom: 0.5rem;
}

/* ローディング */
.loading {
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    font-size: 3rem;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: #666;
    font-size: 1.1rem;
}

/* アニメーション */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

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

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

/* フッター */
.footer {
    background: rgba(45, 52, 54, 0.95);
    color: white;
    margin-top: 4rem;
    padding: 3rem 0 1rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #ff6b35;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: #b2bec3;
    font-size: 0.9rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-section ul li a:hover {
    color: #ff6b35;
}

.footer-bottom {
    border-top: 1px solid #636e72;
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    color: #b2bec3;
    font-size: 0.9rem;
}

/* ハンバーガーメニュー */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #666;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
    
    nav.active {
        right: 0;
    }
    
    .nav-link {
        width: 100%;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
        margin-bottom: 10px;
    }
    
    #adminLink {
        margin-top: 20px;
        text-align: center;
        border-radius: 10px;
        padding: 15px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .generate-button {
        font-size: 16px;
        padding: 14px 24px;
    }
    
    .recipe-form-section,
    .result-container {
        padding: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer {
        padding: 2rem 0 1rem 0;
    }
}