* { margin: 0; padding: 0; box-sizing: border-box; -webkit-overflow-scrolling: touch; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #1a1a1a; color: #e0e0e0; line-height: 1.6; overflow-x: hidden; }
html { scroll-behavior: smooth; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.navbar { margin-bottom: 30px; padding: 15px 0; }
.navbar-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.navbar-brand { display: flex; align-items: center; }
.navbar-logo { height: 48px; filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.7)); }
.navbar-menu { display: flex; align-items: center; }
.navbar-nav { display: flex; align-items: center; gap: 20px; }
.nav-link { color: #e0e0e0; text-decoration: none; padding: 10px 18px; border-radius: 6px; transition: all 0.3s; cursor: pointer; font-weight: 500; }
.nav-link:hover, .nav-link.active { background: #4CAF50; color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3); }
.nav-search { margin-left: 15px; }
.search-input { background: #2a2a2a; border: 2px solid #444; color: #e0e0e0; padding: 8px 15px; border-radius: 25px; width: 200px; transition: all 0.3s; }
.search-input:focus { outline: none; border-color: #4CAF50; box-shadow: 0 0 10px rgba(76, 175, 80, 0.3); }
.content-section { display: none; }
.content-section.active { display: block; }
.stats { display: flex; justify-content: space-around; margin: 30px auto; padding: 20px; border-radius: 8px; max-width: 800px; }
.stat { text-align: center; }
.stat-label { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 0.9em; }
.stat-emoji { font-size: 1em; }
.stat-number { font-size: 2em; color: #4CAF50; font-weight: bold; }
.controls { display: flex; gap: 15px; margin-bottom: 30px; flex-wrap: wrap; justify-content: center; }
.controls select { background: rgba(42, 42, 42, 0.7); border: 1px solid #444; color: #e0e0e0; padding: 10px; border-radius: 5px; }
.controls button { background: #4CAF50; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; }
.controls button:hover { background: #45a049; }
.controls button:disabled { background: #666; cursor: not-allowed; }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding: 0; transition: opacity 0.3s ease; }
.recipe-grid.loading { opacity: 0.6; pointer-events: none; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 80px 20px; color: #bbb; }
.empty-icon { font-size: 4em; margin-bottom: 20px; opacity: 0.5; }
.empty-state h3 { color: #4CAF50; font-size: 1.8em; margin-bottom: 15px; }
.empty-state p { font-size: 1.1em; max-width: 400px; margin: 0 auto; line-height: 1.6; }
.recipe-card { 
    perspective: 1000px; 
    height: 400px; 
    cursor: pointer;
    border-radius: 8px;
}
.card-inner { 
    position: relative; 
    width: 100%; 
    height: 100%; 
    text-align: center; 
    transition: transform 0.6s; 
    transform-style: preserve-3d;
    border-radius: 8px;
    touch-action: auto;
}
.recipe-card.flipped .card-inner { transform: rotateY(180deg); }
.card-front, .card-back { 
    position: absolute; 
    width: 100%; 
    height: 100%; 
    backface-visibility: hidden; 
    background: rgba(42, 42, 42, 0.8); 
    border-radius: 8px; 
    border: 1px solid #333; 
    transition: box-shadow 0.2s;
    overflow: hidden;
    box-sizing: border-box;
}
.card-back { 
    position: absolute; 
    width: 100%; 
    height: 100%; 
    backface-visibility: hidden; 
    background: rgba(42, 42, 42, 0.95); 
    border-radius: 8px; 
    border: 1px solid #333; 
    transition: box-shadow 0.2s;
    overflow: hidden;
    box-sizing: border-box;
    padding: 15px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column;
}
.recipe-card:hover .card-front, .recipe-card:hover .card-back { box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.card-back { transform: rotateY(180deg); padding: 15px; overflow-y: auto; display: flex; flex-direction: column; }
.recipe-image { width: 100%; height: 200px; background: #333; display: flex; align-items: center; justify-content: center; color: #666; border-radius: 8px 8px 0 0; }
.recipe-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px 8px 0 0; }
.recipe-content { padding: 15px; height: calc(100% - 200px); display: flex; flex-direction: column; overflow: hidden; }
.recipe-title { font-size: 1.2em; margin-bottom: 8px; color: #4CAF50; line-height: 1.3; }
.recipe-meta { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.9em; color: #bbb; }
.recipe-stats { display: flex; gap: 8px; margin-bottom: 8px; font-size: 0.8em; flex-wrap: wrap; }
.stat-badge { background: #333; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.new-badge { background: #ff4444; color: white; padding: 2px 6px; border-radius: 12px; font-size: 0.7em; font-weight: bold; position: absolute; top: 8px; left: 8px; z-index: 10; }
.card-front .new-badge { opacity: 1; }
.card-back .new-badge, .recipe-card.flipped .card-front .new-badge { opacity: 0; pointer-events: none; }
.ingredients { font-size: 0.85em; color: #ccc; overflow: hidden; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.source-link { display: inline-block; margin-top: auto; color: #4CAF50; text-decoration: none; font-size: 0.9em; padding: 4px 0; }
.source-link:hover { text-decoration: underline; }
.pagination { text-align: center; margin: 30px auto 0; padding: 15px 20px; border-radius: 20px; width: 100%; }
.pagination a, .pagination button { background: rgba(51, 51, 51, 0.7); color: white; border: 1px solid rgba(255, 255, 255, 0.2); padding: 8px 12px; margin: 0 2px; text-decoration: none; display: inline-block; cursor: pointer; transition: all 0.3s ease; border-radius: 8px; }
.pagination a:hover, .pagination button:hover { background: rgba(76, 175, 80, 0.8); border-color: rgba(76, 175, 80, 0.5); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3); }
.pagination .active { background: rgba(76, 175, 80, 0.9); border-color: rgba(76, 175, 80, 0.7); box-shadow: 0 0 15px rgba(76, 175, 80, 0.4); }
.pagination button:disabled { background: rgba(102, 102, 102, 0.5); cursor: not-allowed; opacity: 0.5; border-color: rgba(255, 255, 255, 0.1); }
.pagination button:disabled:hover { background: rgba(102, 102, 102, 0.5); transform: none; box-shadow: none; }
.pagination-info { margin-top: 15px; color: white; font-size: 0.9em; }
.ingredients-detail { text-align: left; margin-bottom: 15px; }
.ingredients-detail h4 { color: #4CAF50; margin-bottom: 10px; font-size: 1.1em; }
.ingredient-item { padding: 3px 0; font-size: 0.9em; border-bottom: 1px solid #333; }
.ingredient-item:last-child { border-bottom: none; }
.back-meta { display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 0.9em; }
.back-stats { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.flip-hint { position: absolute; top: 8px; right: 8px; background: rgba(76, 175, 80, 0.9); color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.7em; z-index: 10; transition: opacity 0.3s; }
.recipe-card.flipped .flip-hint { opacity: 0; pointer-events: none; }
.back-title { color: #4CAF50; font-size: 1.2em; margin-bottom: 15px; text-align: center; }
.instructions-preview { font-size: 0.85em; color: #ccc; margin-bottom: 15px; text-align: left; }
.back-source { text-align: center; margin-top: auto; }
.back-source a { background: #4CAF50; color: white; padding: 8px 16px; border-radius: 5px; text-decoration: none; display: inline-block; }
.back-source a:hover { background: #45a049; }
.api-docs { max-width: 1000px; margin: 0 auto; padding: 20px; }
.api-docs h2 { color: #4CAF50; text-align: center; margin-bottom: 40px; font-size: 2.5em; font-weight: 700; }
.api-description { text-align: center; margin-bottom: 40px; font-size: 1.1em; font-weight: 600; }
.api-docs h3 { color: #4CAF50; margin: 40px 0 20px 0; border-bottom: 2px solid #4CAF50; padding-bottom: 15px; font-size: 1.8em; font-weight: 400; }
.api-docs h4 { color: #e0e0e0; margin: 25px 0 15px 0; font-size: 1.3em; }
.api-section { margin-bottom: 50px; background: rgba(42, 42, 42, 0.7); padding: 30px; border-radius: 12px; border: 1px solid #333; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.endpoint { padding: 25px 0; margin-bottom: 25px; position: relative; }
.example { margin: 20px 0; }
.parameters { margin: 20px 0; background: #222; padding: 20px; border-radius: 8px; border-left: 4px solid #2196F3; }
.api-docs code { background: linear-gradient(135deg, #333, #444); padding: 4px 8px; border-radius: 6px; color: #4CAF50; font-family: 'Courier New', monospace; font-weight: 600; border: 1px solid #555; }
.api-docs pre { background: linear-gradient(135deg, #1a1a1a, #111); padding: 20px; border-radius: 10px; overflow-x: auto; border-left: 4px solid #4CAF50; font-family: 'Courier New', monospace; line-height: 1.6; box-shadow: inset 0 2px 10px rgba(0,0,0,0.5); text-align: left; }
.api-docs ul { margin-left: 25px; }
.api-docs li { margin: 8px 0; padding: 5px 0; }
.api-docs p { line-height: 1.8; margin-bottom: 15px; color: #ccc; }
.api-docs strong { color: #4CAF50; font-weight: 600; }
.method-badge { background: #2196F3; color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.8em; font-weight: bold; margin-right: 10px; }
.status-code { background: #4CAF50; color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; font-weight: bold; }
.endpoint h4 { background: none; margin: 0; padding: 0; color: #e0e0e0; }
.endpoint h4 .method-badge { background: #4CAF50; }
.request-url { background: #222; padding: 15px; border-radius: 8px; border-left: 4px solid #2196F3; font-family: 'Courier New', monospace; color: #2196F3; font-weight: 600; margin: 10px 0; }
.loading-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(26, 26, 26, 0.8); display: none; align-items: center; justify-content: center; z-index: 1000; border-radius: 8px; }
.loading-overlay.visible { display: flex; }
.loading-spinner { width: 40px; height: 40px; border: 4px solid #333; border-top: 4px solid #4CAF50; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }        
@media (max-width: 1024px) {
    .container { padding: 15px; }
    .navbar-container { padding: 0 15px; }
}
@media (max-width: 768px) {
    .navbar-container { flex-direction: column; gap: 15px; padding: 0 15px; }
    .navbar-nav { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px; }
    .search-input { width: 250px; }
    .navbar-logo { height: 40px; }
    .stats { flex-wrap: wrap; gap: 20px; justify-content: center; }
    .stat { min-width: 120px; flex: 1; max-width: 150px; }
    .controls { gap: 10px; }
    .controls select, .controls button { min-width: 140px; }
    .api-docs { padding: 15px; }
    .api-section { padding: 20px; margin-bottom: 30px; }
}
@media (max-width: 640px) {
    .navbar-nav { flex-direction: column; width: 100%; gap: 8px; }
    .nav-search { margin-left: 0; margin-top: 10px; }
    .search-input { width: 100%; max-width: 300px; }
    .stats { flex-direction: column; align-items: center; gap: 15px; max-width: 400px; }
    .stat { max-width: 200px; }
    .controls { flex-direction: column; align-items: center; gap: 8px; }
    .controls select, .controls button { width: 100%; max-width: 280px; }
    .container { padding: 10px; }
    .pagination { padding: 0 10px; }
    .pagination a, .pagination button { padding: 6px 10px; margin: 0 1px; font-size: 0.9em; }
}
@media (max-width: 480px) {
    body { font-size: 14px; }
    .navbar { padding: 10px 0; }
    .navbar-container { padding: 0 10px; }
    .navbar-logo { height: 36px; }
    .nav-link { padding: 8px 12px; font-size: 0.9em; }
    .search-input { padding: 6px 12px; font-size: 0.9em; }
    .stats { max-width: 300px; }
    .stat-number { font-size: 1.5em; }
    .stat-label { font-size: 0.8em; }
    .recipe-title { font-size: 1em; }
    .recipe-meta, .recipe-stats { font-size: 0.8em; }
    .ingredients { font-size: 0.8em; }
    .api-docs h2 { font-size: 2em; }
    .api-docs h3 { font-size: 1.4em; }
    .api-section { padding: 15px; }
    .pagination a, .pagination button { padding: 4px 8px; font-size: 0.8em; }
    .empty-state { padding: 60px 20px; }
    .empty-icon { font-size: 3em; }
    .empty-state h3 { font-size: 1.5em; }
    .empty-state p { font-size: 1em; }
}