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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --bg-color: #ecf0f1;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

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

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

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 30px;
}

#searchInput {
    width: 100%;
    padding: 18px 50px 18px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    background: var(--card-bg);
}

#searchInput:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    pointer-events: none;
}

.stats {
    text-align: center;
    color: white;
    font-size: 1.1rem;
    margin-bottom: 30px;
    font-weight: 500;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.item-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary-color);
}

.item-card h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

.item-description {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.materials-section {
    margin-top: 20px;
}

.materials-section h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.materials-list {
    list-style: none;
}

.material-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg-color);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.material-item:hover {
    background: #d5dbdb;
}

.material-name {
    font-weight: 500;
    color: var(--text-color);
}

.material-quantity {
    color: var(--secondary-color);
    font-weight: 600;
    background: white;
    padding: 4px 10px;
    border-radius: 4px;
}

.material-category {
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--bg-color);
    border-radius: 6px;
    border-left: 3px solid var(--secondary-color);
}

.material-category strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.category-items {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    display: block;
}

.crafting-time {
    margin-top: 15px;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 6px;
    color: #2e7d32;
    font-weight: 500;
    font-size: 0.9rem;
}

.item-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.item-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: white;
    font-size: 1.2rem;
}

footer {
    text-align: center;
    padding: 30px;
    color: white;
    opacity: 0.8;
}

footer a {
    color: white;
    text-decoration: underline;
}

footer a:hover {
    opacity: 1;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    #searchInput {
        font-size: 1rem;
        padding: 15px 45px 15px 15px;
    }
}

