/* Color Palette - Modern Dark Mode */
:root {
    --minecraft-green: #7cb342;
    --minecraft-brown: #8b6f47;
    --minecraft-grass: #5d9c59;
    --minecraft-dirt: #8b6f47;
    --minecraft-sky: #1a1a2e;
    --minecraft-stone: #808080;
    --text-dark: #e4e4e7;
    --text-light: #a1a1aa;
    --text-muted: #71717a;
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --border-color: #3f3f46;
    --shadow: rgba(0, 0, 0, 0.5);
    --shadow-hover: rgba(0, 0, 0, 0.7);
    --error: #ef4444;
    --success: #22c55e;
    --accent: #7cb342;
    --accent-hover: #8bc34a;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow);
    border: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.minecraft-icon {
    width: 50px;
    height: 50px;
    animation: float 3s ease-in-out infinite;
}

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

h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    font-weight: 800;
    text-shadow: 2px 2px 4px var(--shadow);
}

.subtitle {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

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

/* Card Styles */
.card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 30px var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow-hover);
    border-color: var(--accent);
}

.card h2 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Input Section */
textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 250px;
    flex: 1;
    transition: border-color 0.3s ease, background 0.3s ease;
    background: var(--bg-tertiary);
    color: var(--text-dark);
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.1);
}

/* Button Styles */
.generate-btn {
    width: 100%;
    padding: 16px 30px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 179, 66, 0.3);
    margin-top: 20px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 179, 66, 0.5);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-icon {
    width: 22px;
    height: 22px;
}

/* Result Card */
.result-card {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 60px 20px;
}

.minecraft-loader {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.block {
    width: 30px;
    height: 30px;
    background: var(--minecraft-brown);
    animation: blockPulse 1.5s ease-in-out infinite;
}

.block:nth-child(1) { animation-delay: 0s; }
.block:nth-child(2) { animation-delay: 0.2s; }
.block:nth-child(3) { animation-delay: 0.4s; }
.block:nth-child(4) { animation-delay: 0.6s; }

@keyframes blockPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
}

.loading-state p {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 600;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-muted);
}

/* Result Content */
.result-content {
    flex: 1;
}

.result-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

.copy-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-dark);
}

.copy-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.copy-btn:hover svg {
    stroke: white;
}

.analogy-text {
    background: var(--bg-tertiary);
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    font-size: 1.05rem;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* Sources Section */
.sources-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.sources-section h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.sources-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.source-item {
    background: var(--bg-tertiary);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s ease;
    border: 1px solid var(--border-color);
}

.source-item:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.source-item a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    flex: 1;
}

.source-item a:hover {
    text-decoration: underline;
}

.source-number {
    background: var(--accent);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 60px 20px;
    text-align: center;
}

.error-icon {
    width: 80px;
    height: 80px;
    color: var(--error);
    margin-bottom: 20px;
}

.error-state h3 {
    color: var(--error);
    margin-bottom: 10px;
}

.error-state p {
    color: var(--text-dark);
    max-width: 400px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    border: 2px solid var(--border-color);
}

.footer p {
    color: var(--text-dark);
    margin-bottom: 5px;
}

.footer-note {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .main-content {
        gap: 20px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-content {
    animation: fadeIn 0.5s ease;
}
