:root {
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --border: #3f3f46;
    --border-subtle: #27272a;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #fafafa;
    --accent-hover: #e4e4e7;
    --destructive: #ef4444;
    --success: #22c55e;
    --shiny-gold: #fbbf24;
    --shiny-gradient: linear-gradient(135deg, #fbbf24, #f59e0b, #fcd34d);
    --ring: rgba(250, 250, 250, 0.1);
    --radius: 8px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 48px 24px;
}

header {
    margin-bottom: 48px;
    text-align: center;
}

h1 {
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: calc(var(--radius) + 4px);
    padding: 24px;
    margin-bottom: 16px;
}

.card-header {
    margin-bottom: 16px;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text-primary);
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea:focus {
    outline: none;
    border-color: var(--border);
    box-shadow: 0 0 0 3px var(--ring);
}

textarea::placeholder {
    color: var(--text-muted);
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
    outline: none;
    border-color: var(--border);
    box-shadow: 0 0 0 3px var(--ring);
}

select {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a1a1aa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

select:focus {
    outline: none;
    border-color: var(--border);
    box-shadow: 0 0 0 3px var(--ring);
}

.file-input-wrapper {
    position: relative;
    margin-top: 12px;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.file-input-label:hover {
    border-color: var(--text-muted);
    background: var(--bg-tertiary);
}

.file-input-label svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

input[type="file"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--border-subtle);
    border-color: var(--border);
}

.btn-shiny {
    background: var(--shiny-gradient);
    color: var(--bg-primary);
    font-weight: 600;
}

.btn-shiny:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--destructive);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.25);
}

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

.result-section {
    display: none;
}

.result-section.visible {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.value-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.value-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    font-size: 1.25rem;
}

.value-info {
    flex: 1;
}

.value-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.value-input {
    width: 100%;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    background: transparent;
    border: none;
    color: var(--text-primary);
}

.value-input:focus {
    outline: none;
}

/* Shiny Manager Styles */
.shiny-manager {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}

.shiny-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.shiny-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--shiny-gradient);
    border-radius: 50%;
    font-size: 1.25rem;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

.shiny-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.shiny-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.shiny-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.shiny-selector {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.shiny-selector select {
    flex: 1;
    min-width: 200px;
}

.pokemon-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    margin-top: 12px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.shiny {
    background: var(--shiny-gold);
    box-shadow: 0 0 8px var(--shiny-gold);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 8px var(--shiny-gold);
    }
    50% {
        box-shadow: 0 0 16px var(--shiny-gold), 0 0 24px var(--shiny-gold);
    }
}

.shiny-stats {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    margin-top: 16px;
    font-size: 0.8125rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value.shiny-count {
    color: var(--shiny-gold);
}

.output-area {
    position: relative;
}

.output-area textarea {
    padding-right: 44px;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.copy-btn:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 20px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.error-message {
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    color: var(--destructive);
    font-size: 0.8125rem;
    margin-top: 12px;
    display: none;
}

.error-message.visible {
    display: block;
}

/* Routes Manager Styles */
.routes-manager {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}

.routes-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.routes-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 50%;
    font-size: 1.25rem;
}

.routes-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.routes-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.routes-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.route-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 12px;
    transition: all 0.15s;
}

.route-card:hover {
    border-color: var(--border);
}

.route-card.maxed {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.1);
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.route-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.route-stars {
    font-size: 0.75rem;
    color: var(--shiny-gold);
}

.route-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.route-input {
    flex: 1;
    padding: 8px 10px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    text-align: center;
    transition: border-color 0.15s;
}

.route-input:focus {
    outline: none;
    border-color: var(--border);
}

.route-max-btn {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.route-max-btn:hover {
    background: rgba(34, 197, 94, 0.25);
}

.route-progress {
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.route-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--shiny-gold), #f59e0b);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.stars-summary {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.stars-progress {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.stars-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #fcd34d);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stars-info {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--shiny-gold);
}

footer {
    text-align: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.75rem;
}