:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.app-container {
    width: 100%;
    max-width: 1400px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

main {
    display: flex;
    gap: 2rem;
    height: 600px;
}

#map-container {
    flex: 1;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.controls {
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-panel {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

input[type="file"] {
    display: none;
}

.upload-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(56, 189, 248, 0.3);
}

.upload-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 10px -1px rgba(56, 189, 248, 0.4);
}

#file-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

.info-section {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.info-section h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

code {
    font-family: monospace;
    font-size: 0.85rem;
    color: #a78bfa;
    display: block;
    line-height: 1.5;
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    pointer-events: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    transition: opacity 0.2s ease;
    z-index: 10;
}

.tooltip strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--accent);
}

/* SVG Elements */
.prefecture {
    fill: #334155;
    stroke: #1e293b;
    stroke-width: 1px;
    transition: fill 0.3s;
}

.carto-circle {
    fill: var(--accent);
    stroke: #fff;
    stroke-width: 1.5px;
    opacity: 0.85;
    transition: opacity 0.2s;
    cursor: pointer;
}

.carto-circle:hover {
    opacity: 1;
    fill: #8b5cf6;
    stroke-width: 2px;
}

.carto-label {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 10px;
    fill: #fff;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

@media (max-width: 900px) {
    main {
        flex-direction: column;
        height: auto;
    }
    .controls {
        width: 100%;
    }
    #map-container {
        height: 500px;
    }
}
