/* Crafting Recipes Tool Styles */

/* Base & Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 5px rgba(85, 255, 85, 0.2); } 50% { box-shadow: 0 0 20px rgba(85, 255, 85, 0.6); } 100% { box-shadow: 0 0 5px rgba(85, 255, 85, 0.2); } }
@keyframes floatItem { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* Split Layout */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 30px;
    align-items: start;
    position: relative;
    margin-bottom: 60px;
}

.items-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.recipe-panel {
    position: sticky;
    top: 20px;
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(15px);
    border: 2px solid #555;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.1);
    min-height: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Search Section - Enhanced */
.search-container {
    background: linear-gradient(145deg, rgba(50, 50, 50, 0.9), rgba(30, 30, 30, 0.9));
    padding: 1.2rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}

.search-input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #555;
    color: white;
    font-family: 'Noto Sans', sans-serif;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    outline: none;
    border-color: var(--minecraft-green, #55ff55);
    box-shadow: 0 0 20px rgba(85, 255, 85, 0.25);
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.01);
}

/* Categories - Enhanced */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.category-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ddd;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.3);
}

.category-btn:active {
    transform: translateY(-1px);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--minecraft-green, #55ff55), #2c9);
    color: #000;
    border-color: transparent;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(85, 255, 85, 0.5);
}

/* Items Grid - Enhanced */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 10px;
    padding: 20px;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
    min-height: 400px;
}

.item-slot {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(40, 40, 40, 0.6);
    border: 2px solid #4a4a4a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.item-slot:hover {
    background: rgba(70, 70, 70, 0.9);
    border-color: var(--minecraft-green);
    transform: scale(1.15) rotate(3deg);
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.item-slot img {
    width: 36px;
    height: 36px;
    image-rendering: pixelated;
    filter: drop-shadow(4px 4px 2px rgba(0,0,0,0.4));
    transition: transform 0.2s;
}

.item-slot:hover img {
    transform: scale(1.1);
}

/* Advanced Features Section Styling */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.feature-card {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(40, 40, 40, 0.8);
    border-color: var(--minecraft-green);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: inline-block;
    animation: floatItem 3s ease-in-out infinite;
}

.feature-title {
    color: var(--minecraft-green);
    font-family: 'Minecraft', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.feature-desc {
    color: #ccc;
    line-height: 1.6;
}

/* Steps Process Styling */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--minecraft-green);
}

.step-number {
    background: var(--minecraft-green);
    color: #000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h4 {
    color: #fff;
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

.step-content p {
    color: #aaa;
    margin: 0;
}

/* Recipe Card Glow */
.recipe-card.active-glow {
    animation: pulseGlow 2s infinite;
}


/* Selected Recipe View - Right Panel */
.selected-recipe-container {
    width: 100%;
    display: none; /* Hidden by default */
}

.selected-recipe-container.visible {
    display: block;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.recipe-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 25px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.recipe-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--minecraft-green), #2c9);
}

.recipe-header {
    width: 100%;
    margin-bottom: 25px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.recipe-title {
    color: #fff;
    font-size: 1.8rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    font-family: 'Minecraft', sans-serif;
    letter-spacing: 1px;
}

/* Crafting GUI */
.crafting-gui {
    background: #c6c6c6;
    padding: 10px;
    border-radius: 4px;
    border: 2px solid #373737;
    box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555, 0 10px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    width: fit-content;
    transform-origin: center;
    transition: transform 0.3s;
}

.crafting-gui:hover {
    transform: scale(1.02);
}

.crafting-grid {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px);
    gap: 2px;
}

.slot {
    width: 48px;
    height: 48px;
    background: #8b8b8b;
    border: 2px solid #373737;
    border-right-color: #fff;
    border-bottom-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.slot:hover {
    background: #a0a0a0;
}

.slot img {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.slot:hover img {
    transform: scale(1.2) rotate(5deg);
}

.crafting-arrow {
    width: 60px;
    height: 40px;
    margin: 0 20px;
    position: relative;
}

.crafting-arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: #555;
    transform: translateY(-50%);
    box-shadow: 0 1px 0 #fff;
}

.crafting-arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 16px;
    height: 16px;
    border-top: 4px solid #555;
    border-right: 4px solid #555;
    transform: translateY(-50%) rotate(45deg);
    box-shadow: 1px -1px 0 #fff;
}

.crafting-result {
    width: 70px;
    height: 70px;
    background: #8b8b8b;
    border: 2px solid #373737;
    border-right-color: #fff;
    border-bottom-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.crafting-result img {
    width: 56px;
    height: 56px;
    image-rendering: pixelated;
}

.item-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 2px 2px 0 #000;
    pointer-events: none;
}

/* Custom Tooltip */
.mc-tooltip {
    position: absolute;
    background: rgba(16, 0, 16, 0.95);
    border: 2px solid #300030;
    border-top-color: #500090;
    border-left-color: #500090;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    z-index: 9999;
    pointer-events: none;
    font-family: 'Minecraft', sans-serif;
    font-size: 14px;
    text-shadow: 2px 2px 0 #000;
    white-space: nowrap;
    display: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.mc-tooltip.visible {
    display: block;
    animation: tooltipFade 0.1s ease-out;
}

@keyframes tooltipFade {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.mc-tooltip .item-id {
    display: block;
    color: #aaa;
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
    opacity: 0.8;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.page-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: bold;
}

.page-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--minecraft-green);
    color: #111;
    border-color: var(--minecraft-green);
    box-shadow: 0 0 10px rgba(85, 255, 85, 0.3);
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* No Results / Empty State */
.empty-state {
    text-align: center;
    padding: 60px;
    color: #aaa;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px dashed #444;
}

.empty-state h3 {
    color: white;
    margin-bottom: 10px;
}

/* Initial State in Right Panel */
.select-prompt {
    text-align: center;
    color: #888;
    padding: 40px;
}

.select-prompt img {
    width: 64px;
    height: 64px;
    opacity: 0.5;
    margin-bottom: 20px;
    image-rendering: pixelated;
    animation: float 3s ease-in-out infinite;
}

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

/* Responsive */
@media (max-width: 1000px) {
    .split-layout {
        grid-template-columns: 1fr;
    }
    
    .recipe-panel {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        z-index: 1000;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        min-height: auto;
        border-bottom: none;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.7);
    }

    .recipe-panel.active {
        transform: translateY(0);
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }
}
