:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --background: #ffffff;
    --surface: #f8fafc;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--surface);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* ヘッダー */
header {
    background: var(--background);
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    text-align: center;
    position: relative;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.icon {
    font-size: 2.5rem;
}

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

.language-selector {
    position: absolute;
    top: 24px;
    right: 24px;
}

#languageSelect {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

#languageSelect:hover {
    border-color: var(--primary-color);
}

/* メインコンテンツ */
main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

/* アップロードエリア */
.upload-area {
    background: var(--background);
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 40px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: scale(1.02);
}

.upload-content {
    max-width: 400px;
    margin: 0 auto;
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 16px;
}

.upload-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 地図コンテナ */
.map-container {
    background: var(--background);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

#map {
    height: 500px;
    width: 100%;
}

/* 画像リスト */
.image-list {
    background: var(--background);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.image-list h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.image-item {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.image-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.image-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.image-info {
    padding: 16px;
}

.filename {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location {
    color: var(--primary-color);
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.datetime {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* メッセージ */
.no-location-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-location-message svg {
    color: var(--warning);
    margin-bottom: 16px;
}

.no-location-message p {
    font-size: 1.125rem;
}

/* ポップアップ */
.popup-content {
    padding: 8px;
}

.popup-content img {
    margin-bottom: 12px;
    border-radius: 8px;
}

.popup-content p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.popup-content strong {
    color: var(--text-primary);
}

/* フッター */
footer {
    background: var(--background);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ユーティリティクラス */
.hidden {
    display: none !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    header {
        padding: 20px 0;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .language-selector {
        position: static;
        margin-top: 16px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    #map {
        height: 400px;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .image-list {
        padding: 24px 16px;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-item {
    animation: fadeIn 0.3s ease-out;
}

/* ダークモード対応（システム設定に従う） */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --surface: #1e293b;
        --border: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
    }
    
    .upload-area.dragover {
        background: #1e3a8a;
    }
}