/* Reset และ Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Login Section */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 50%;
    border: 3px solid #4CAF50;
    padding: 5px;
    background: white;
}

.login-header h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 5px;
}

.login-header p {
    color: #666;
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.login-btn,
.save-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover,
.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #fcc;
    text-align: center;
}

/* App Container */
.app-container {
    min-height: 100vh;
    background: #f5f7fa;
}

/* Navigation */
.navbar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #4CAF50;
}

.nav-brand .nav-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid #4CAF50;
    padding: 2px;
    background: white;
}

.nav-menu {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    border: 2px solid #e1e1e1;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #666;
}

.nav-btn.active,
.nav-btn:hover {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.nav-btn.logout {
    border-color: #f44336;
    color: #f44336;
}

.nav-btn.logout:hover {
    background: #f44336;
    color: white;
}

/* Main Content */
.main-content {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.content-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

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

.section-header h2 {
    color: #333;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 25px;
    font-size: 1rem;
}

.search-bar i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Recipes Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.recipe-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.recipe-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.recipe-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.recipe-category {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 15px;
}

.recipe-ingredients {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.9;
}

/* Recipe Form */
.recipe-form {
    display: grid;
    gap: 25px;
    max-width: 600px;
}

.recipe-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Sauce Guide Styles */
.sauce-guide-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.sauce-recipe-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    border-left: 5px solid #4CAF50;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.sauce-recipe-card:hover {
    transform: translateY(-3px);
}

.sauce-title {
    color: #354f52;
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(76, 175, 80, 0.2);
}

.sauce-ingredients h4,
.sauce-instructions h4 {
    color: #52796f;
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.sauce-ingredients ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.sauce-ingredients li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.sauce-ingredients li:before {
    content: "🥄";
    position: absolute;
    left: 0;
    top: 5px;
}

.sauce-instructions ol {
    padding-left: 20px;
    counter-reset: step-counter;
}

.sauce-instructions li {
    margin-bottom: 8px;
    line-height: 1.6;
    position: relative;
    list-style: none;
    counter-increment: step-counter;
    padding-left: 30px;
}

.sauce-instructions li:before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #4CAF50;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Superfood Guide Styles */
.superfood-guide-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.superfood-item {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #4CAF50;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.superfood-item::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20px;
    width: 100px;
    height: 100px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 50%;
    transform: rotate(45deg);
}

.superfood-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.15);
}

.superfood-name {
    color: #2e7d32;
    font-size: 1.2rem;
    margin-bottom: 12px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.superfood-description {
    color: #2e7d32;
    line-height: 1.6;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

/* Recipe Detail */
.recipe-detail h2 {
    color: #4CAF50;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.recipe-detail .category-badge {
    background: #4CAF50;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 20px;
}

.recipe-detail h3 {
    color: #333;
    margin: 25px 0 10px 0;
    font-size: 1.3rem;
}

.recipe-detail p,
.recipe-detail pre {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #555;
}

.recipe-detail pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    white-space: pre-wrap;
    font-family: inherit;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
    }
    
    .search-bar {
        width: 100%;
        max-width: 400px;
    }
    
    .recipes-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 30px 25px;
    }
    
    .recipe-form {
        padding: 0;
    }

    .sauce-guide-container {
        grid-template-columns: 1fr;
    }

    .superfood-guide-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-brand {
        font-size: 1.2rem;
    }
    
    .nav-brand .nav-logo {
        width: 35px;
        height: 35px;
    }
    
    .login-header .logo {
        width: 60px;
        height: 60px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }

    .sauce-guide-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sauce-recipe-card {
        padding: 20px;
    }

    .superfood-item {
        padding: 15px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Success Message */
.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #c8e6c9;
    text-align: center;
    margin-top: 15px;
} 