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

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

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}



main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

section h2 i {
    color: #667eea;
}

/* Ingredients Section */
.ingredients-input {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.ingredients-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.ingredients-input input:focus {
    outline: none;
    border-color: #667eea;
}

.ingredients-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ingredient-tag {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.ingredient-tag:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.ingredient-tag .remove-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.ingredient-tag .remove-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Recipe Generation Section */
.prompt-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.prompt-section textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.prompt-section textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-generate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.1rem;
    padding: 16px 32px;
    align-self: flex-start;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.btn-save {
    background: #48bb78;
    color: white;
}

.btn-save:hover {
    background: #38a169;
}

.btn-share {
    background: #4299e1;
    color: white;
}

.btn-share:hover {
    background: #3182ce;
}

.btn-remove {
    background: #f56565;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-remove:hover {
    background: #e53e3e;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Recipes Container */
.recipes-container {
    display: grid;
    gap: 20px;
}

.recipe-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    animation: slideIn 0.5s ease;
}

.recipe-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.1);
}

.recipe-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.recipe-content {
    margin-bottom: 20px;
    line-height: 1.7;
}

.recipe-content h4 {
    font-weight: 600;
    color: #4a5568;
    margin: 16px 0 8px 0;
    font-size: 1rem;
}

.recipe-content ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

.recipe-content li {
    margin-bottom: 4px;
}

.missing-ingredient {
    font-weight: 700;
    color: #e53e3e;
}

.recipe-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Saved Recipes */
.saved-recipes {
    display: grid;
    gap: 20px;
}

.saved-recipe {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    position: relative;
}

.saved-recipe .recipe-actions {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-width: 300px;
}

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

.toast.error {
    background: #f56565;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Settings Page Styles */
.settings-section {
    margin-bottom: 30px;
}

.settings-content {
    margin-top: 20px;
}

.settings-description {
    color: #718096;
    margin-bottom: 20px;
    line-height: 1.6;
}

.api-key-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.input-with-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-toggle input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: monospace;
    transition: border-color 0.3s ease;
}

.input-with-toggle input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.btn-toggle:hover {
    color: #4a5568;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Toggle Switch Styles */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #667eea;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    font-weight: 500;
    color: #2d3748;
}

.toggle-description {
    display: block;
    margin-top: 8px;
    color: #718096;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.nav-buttons .btn {
    flex: 1;
    text-align: center;
}

/* Instruction Modal Styles */
.instruction-step {
    margin-bottom: 24px;
}

.instruction-step h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

.instruction-step h3 i {
    color: #667eea;
}

.instruction-step p {
    margin-bottom: 8px;
    color: #4a5568;
    line-height: 1.6;
}

.instruction-step ul {
    margin-top: 8px;
    margin-left: 20px;
}

.instruction-step li {
    margin-bottom: 4px;
    color: #4a5568;
    font-style: italic;
}

.instruction-actions {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.data-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.api-status {
    margin-top: 20px;
    padding: 16px;
    border-radius: 8px;
    font-weight: 500;
}

.api-status.success {
    background: #c6f6d5;
    border: 1px solid #9ae6b4;
    color: #22543d;
}

.api-status.error {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    color: #c53030;
}

.api-status.info {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2a4365;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.info-item {
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Developer Credits Styles */
.developer-info {
    text-align: center;
    padding: 20px 0;
}

.developer-avatar {
    margin-bottom: 16px;
}

.profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #667eea;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.developer-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 16px;
}

.developer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.social-link:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.social-link i {
    font-size: 1.1rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    margin: 20px 0;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 0 24px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: #2d3748;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #718096;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-content {
    padding: 0 24px 24px 24px;
}

.welcome-step {
    margin-bottom: 30px;
}

.welcome-step h3 {
    color: #2d3748;
    font-size: 1.2rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-step p {
    color: #4a5568;
    margin-bottom: 12px;
    line-height: 1.6;
}

.welcome-step ol,
.welcome-step ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

.welcome-step li {
    margin-bottom: 8px;
    color: #4a5568;
    line-height: 1.5;
}

.welcome-step a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.welcome-step a:hover {
    text-decoration: underline;
}

.api-key-note {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2a4365;
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9rem;
}

.welcome-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-height: 90vh;
        margin: 10px 0;
    }
    
    .modal-header {
        padding: 20px 20px 0 20px;
    }
    
    .modal-content {
        padding: 0 20px 20px 20px;
    }
    
    .welcome-actions {
        flex-direction: column;
    }
    
    .welcome-actions .btn {
        width: 100%;
    }
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    section {
        padding: 20px;
    }
    
    .ingredients-input {
        flex-direction: column;
    }
    
    .recipe-actions {
        flex-direction: column;
    }
    
    .saved-recipe .recipe-actions {
        position: static;
        margin-top: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .nav-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .nav-buttons .btn {
        width: 100%;
    }
} 