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

:root {
    --bg-gradient: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ffcc00 100%);
    --card-bg: white;
    --card-text: #333;
    --card-desc: #666;
    --card-image-bg: linear-gradient(180deg, #ff8c42 0%, #ff6b35 100%);
    --modal-bg: white;
    --modal-text: #555;
    --hint-bg: #f8f8f8;
    --hint-text: #999;
    --tip-bg: #fff8f0;
    --rating-bg: #f8f8f8;
    --border-color: #eee;
}

body.dark-mode {
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --card-bg: #1e1e2e;
    --card-text: #e0e0e0;
    --card-desc: #a0a0a0;
    --card-image-bg: linear-gradient(180deg, #2d2d44 0%, #1a1a2e 100%);
    --modal-bg: #1e1e2e;
    --modal-text: #c0c0c0;
    --hint-bg: #252535;
    --hint-text: #888;
    --tip-bg: #252535;
    --rating-bg: #252535;
    --border-color: #333;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    background: var(--bg-gradient);
    overflow: hidden;
    transition: background 0.3s ease;
}

.app {
    max-width: 420px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 10px 0;
    position: relative;
}

.header-controls {
    position: absolute;
    top: 10px;
    right: 0;
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.theme-icon {
    font-size: 18px;
}

.lang-icon {
    font-size: 12px;
    font-weight: bold;
    color: white;
}

header h1 {
    color: white;
    font-size: 26px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 6px;
}

.tagline {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
}

.swipe-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    padding: 10px 0;
}

.card-stack {
    position: relative;
    width: 100%;
    max-width: 280px;
    height: 480px;
}

.menu-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    overflow: hidden;
    cursor: grab;
    transition: transform 0.3s ease, opacity 0.3s ease;
    user-select: none;
}

/* Previous card - left side, blurred */
.menu-card.prev-card {
    transform: translateX(-75%) scale(0.85);
    opacity: 0;
    filter: blur(3px);
    z-index: 1;
    pointer-events: none;
}

.menu-card.prev-card.visible {
    opacity: 0.6;
}

/* Current card - center */
.menu-card.current-card {
    z-index: 3;
    left: 0;
}

/* Next card - right side, blurred */
.menu-card.next-card {
    transform: translateX(75%) scale(0.85);
    opacity: 0.6;
    filter: blur(3px);
    z-index: 1;
    pointer-events: none;
}

.menu-card:active {
    cursor: grabbing;
}

.menu-card.swiping {
    transition: none;
}

.menu-card.swipe-left {
    animation: swipeLeft 0.4s ease forwards;
}

.menu-card.swipe-right {
    animation: swipeRight 0.4s ease forwards;
}

@keyframes swipeLeft {
    to {
        transform: translateX(-150%) rotate(-30deg);
        opacity: 0;
    }
}

@keyframes swipeRight {
    to {
        transform: translateX(150%) rotate(30deg);
        opacity: 0;
    }
}

.card-image {
    height: 240px;
    background: var(--card-image-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    position: relative;
}

.card-image::after {
    content: attr(data-emoji);
    font-size: 100px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.card-content {
    padding: 20px;
    text-align: center;
}

.card-tag {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 12px;
}

.card-name {
    font-size: 26px;
    color: var(--card-text);
    margin-bottom: 10px;
}

.card-description {
    color: var(--card-desc);
    font-size: 14px;
    line-height: 1.5;
}

.swipe-hint {
    display: flex;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--hint-bg);
    font-size: 11px;
    color: var(--hint-text);
    margin-top: auto;
}

.hint-left { color: #ff6b6b; }
.hint-right { color: #4ecdc4; }

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px 0;
}

.action-buttons button {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.action-buttons button:hover {
    transform: scale(1.1);
}

.action-buttons button:active {
    transform: scale(0.95);
}

.action-buttons button span {
    font-size: 22px;
}

.action-buttons button small {
    font-size: 9px;
    margin-top: 2px;
}

.btn-skip {
    background: var(--card-bg);
    color: #ff6b6b;
}

.btn-recipe {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--modal-bg);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    color: white;
}

.recipe-header {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    padding: 30px 20px;
    text-align: center;
    color: white;
}

body.dark-mode .recipe-header {
    background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%);
}

.recipe-emoji {
    font-size: 60px;
    display: block;
    margin-bottom: 10px;
}

.recipe-title {
    font-size: 26px;
    margin-bottom: 10px;
}

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

.recipe-body {
    padding: 25px;
}

.recipe-body h3 {
    color: #ff6b35;
    margin-bottom: 15px;
    font-size: 18px;
}

body.dark-mode .recipe-body h3 {
    color: #ff8c42;
}

.ingredients {
    list-style: none;
    margin-bottom: 25px;
}

.ingredients li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
    color: var(--modal-text);
}

.ingredients li::before {
    content: "•";
    color: #ff6b35;
    margin-right: 10px;
}

.steps {
    margin-left: 20px;
    margin-bottom: 25px;
}

.steps li {
    padding: 10px 0;
    color: var(--modal-text);
    line-height: 1.6;
}

.tip {
    background: var(--tip-bg);
    padding: 15px;
    border-radius: 10px;
    color: var(--modal-text);
    font-size: 14px;
    line-height: 1.6;
    border-left: 4px solid #ff6b35;
}

.recipe-rating {
    padding: 20px;
    background: var(--rating-bg);
    border-top: 1px solid var(--border-color);
}

.rating-counts {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    font-size: 14px;
}

.likes { color: #4ecdc4; }
.dislikes { color: #ff6b6b; }

.rating-buttons {
    display: flex;
    gap: 10px;
}

.rating-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.rating-buttons button:hover {
    transform: scale(1.02);
}

.rating-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-like {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

.btn-dislike {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
}

.btn-like.voted, .btn-dislike.voted {
    box-shadow: 0 0 0 3px #333;
}

/* Responsive adjustments */
@media (max-height: 700px) {
    .card-stack {
        height: 420px;
    }
    .card-image {
        height: 180px;
    }
    .card-image::after {
        font-size: 80px;
    }
    header {
        padding: 5px 0;
    }
    .action-buttons {
        padding: 15px 0;
    }
}
