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

:root {
    --deep-purple: #1a0a2e;
    --midnight: #0d0416;
    --magenta: #d946ef;
    --gold: #fbbf24;
    --cyan: #22d3ee;
    --pink: #f472b6;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--midnight) 0%, var(--deep-purple) 50%, #2d1b4e 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

.app-container {
    position: relative;
    min-height: 100vh;
}

/* Bubbles Animation */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bubble {
    position: absolute;
    bottom: -50px;
    background: radial-gradient(circle at 30% 30%, rgba(217, 70, 239, 0.4), rgba(217, 70, 239, 0.1));
    border-radius: 50%;
    animation: rise 12s infinite ease-in;
    opacity: 0.6;
}

@keyframes rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) scale(0.5);
        opacity: 0;
    }
}

/* Header */
.header {
    position: relative;
    z-index: 10;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(217, 70, 239, 0.2) 0%, transparent 100%);
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 3rem;
    animation: wobble 2s ease-in-out infinite;
}

@keyframes wobble {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.app-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--magenta), var(--gold), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(217, 70, 239, 0.5);
}

.tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    font-weight: 300;
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 0 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
        padding: 0 1rem 1rem;
    }
}

/* Panel Cards */
.panel-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
}

.input-panel .panel-card {
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.1) 0%, rgba(34, 211, 238, 0.05) 100%);
}

/* Toggle */
.toggle-container {
    margin-bottom: 1.5rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: var(--magenta);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-input:checked + .toggle-slider {
    background: rgba(34, 211, 238, 0.3);
}

.toggle-input:checked + .toggle-slider::after {
    transform: translateX(24px);
    background: var(--cyan);
}

.toggle-text {
    font-weight: 500;
}

/* Section Title */
.section-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.25rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

/* Selected Ingredients */
.selected-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    min-height: 60px;
}

.selected-ingredient {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, var(--magenta), var(--pink));
    border-radius: 20px;
    font-size: 0.875rem;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.remove-btn {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.2s;
}

.remove-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Custom Input */
.custom-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.custom-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.custom-input:focus {
    border-color: var(--magenta);
}

.custom-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.add-btn {
    width: 44px;
    height: 44px;
    background: var(--magenta);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.add-btn:hover {
    transform: scale(1.05);
    background: var(--pink);
}

/* Ingredients Grid */
.ingredients-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.ingredients-grid::-webkit-scrollbar {
    width: 6px;
}

.ingredients-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.ingredients-grid::-webkit-scrollbar-thumb {
    background: var(--magenta);
    border-radius: 3px;
}

.ingredient-chip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ingredient-chip:hover {
    background: rgba(217, 70, 239, 0.2);
    border-color: var(--magenta);
}

.ingredient-chip.selected {
    background: linear-gradient(135deg, var(--magenta), var(--pink));
    border-color: transparent;
    color: white;
}

.chip-icon {
    font-size: 1rem;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
}

.generate-btn {
    flex: 1;
    padding: 1rem 2rem;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--magenta), #9333ea);
    border: none;
    border-radius: 16px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.generate-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(217, 70, 239, 0.4);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.generate-btn.loading {
    pointer-events: none;
}

.shaker-animation {
    display: inline-block;
    animation: shake 0.5s ease-in-out infinite;
    font-size: 1.5rem;
}

@keyframes shake {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
}

.surprise-btn {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--gold), #f59e0b);
    border: none;
    border-radius: 16px;
    color: var(--midnight);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.surprise-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(251, 191, 36, 0.3);
}

.surprise-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Recipe Panel */
.recipe-panel {
    min-height: 400px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px dashed var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state h3 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.5rem;
    color: var(--magenta);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.5);
}

/* Recipe Card */
.recipe-card {
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.15) 0%, rgba(34, 211, 238, 0.1) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.recipe-name {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.75rem;
    background: linear-gradient(90deg, var(--gold), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.recipe-actions {
    display: flex;
    gap: 0.5rem;
}

.favorite-btn, .share-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.favorite-btn:hover, .share-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.favorite-btn.favorited {
    background: rgba(239, 68, 68, 0.3);
}

.recipe-description {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    font-style: italic;
}

.recipe-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.vibe-badge, .difficulty-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vibe-badge {
    background: linear-gradient(135deg, var(--magenta), var(--pink));
}

.difficulty-badge {
    background: linear-gradient(135deg, var(--cyan), #06b6d4);
    color: var(--midnight);
}

.recipe-section {
    margin-bottom: 1.5rem;
}

.recipe-section h3 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.ingredients-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.ingredients-list li {
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 0.9rem;
}

.ingredients-list li::before {
    content: '✦ ';
    color: var(--magenta);
}

.instructions-list {
    list-style: none;
    counter-reset: step;
}

.instructions-list li {
    counter-increment: step;
    padding: 0.75rem;
    padding-left: 3rem;
    position: relative;
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.instructions-list li::before {
    content: counter(step);
    position: absolute;
    left: 0.75rem;
    width: 24px;
    height: 24px;
    background: var(--magenta);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.taste-notes {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(217, 70, 239, 0.1) 100%);
    border-radius: 12px;
    padding: 1rem;
}

.taste-notes h3 {
    border: none;
    padding-bottom: 0;
}

.taste-notes p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* History Toggle */
.history-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--magenta), #9333ea);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(217, 70, 239, 0.4);
    transition: all 0.3s;
}

.history-toggle:hover {
    transform: scale(1.1);
}

/* History Sidebar */
.history-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: rgba(13, 4, 22, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    z-index: 99;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    0% { transform: translateX(100%); }
    100% { transform: translateX(0); }
}

.history-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.25rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.history-section {
    margin-bottom: 1.5rem;
}

.history-section-title {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.history-card:hover {
    background: rgba(217, 70, 239, 0.1);
    border-color: var(--magenta);
}

.history-card-content h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.history-vibe {
    font-size: 0.7rem;
    color: var(--magenta);
    text-transform: uppercase;
}

.delete-history-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.delete-history-btn:hover {
    opacity: 1;
}

.no-history {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.875rem;
    text-align: center;
    padding: 2rem 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--midnight);
    border: 1px solid var(--magenta);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    z-index: 1000;
    animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
    0% { transform: translateX(-50%) translateY(20px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Footer */
.footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 2rem;
}

.footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.footer a {
    color: var(--magenta);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--gold);
}

.disclaimer {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.4) !important;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .header {
        padding: 1.5rem 1rem;
    }
    
    .app-title {
        font-size: 1.75rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .history-sidebar {
        width: 100%;
    }
    
    .recipe-name {
        font-size: 1.3rem;
    }
    
    .ingredients-list {
        grid-template-columns: 1fr;
    }
}